ATC Macro / PLC Help please <success!>

All things related to the Centroid Acorn CNC Controller

Moderator: cnckeith

Post Reply
cnckeith
Posts: 7334
Joined: Wed Mar 03, 2010 4:23 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: Yes
Oak CNC controller: Yes
CNC Control System Serial Number: none
DC3IOB: Yes
CNC11: Yes
CPU10 or CPU7: Yes
Contact:

Re: ATC Macro / PLC Help please

Post by cnckeith »

to see Graham's Emco PC Turn 120 Finished and working ! check out his post...
Post by QMC Graham » Fri Mar 16, 2018 9:31 am
viewtopic.php?f=57&t=1641
Need support? READ THIS POST first. http://centroidcncforum.com/viewtopic.php?f=60&t=1043
All Acorn Documentation is located here: viewtopic.php?f=60&t=3397
Answers to common questions: viewforum.php?f=63
and here viewforum.php?f=61
Gear we use but don't sell. https://www.centroidcnc.com/centroid_di ... _gear.html
Chaz
Posts: 392
Joined: Thu Feb 08, 2018 7:57 am
Acorn CNC Controller: No
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC11: No
CPU10 or CPU7: No

Re: ATC Macro / PLC Help please <success!>

Post by Chaz »

I am finding that 'resetting' the turret at times is a problem.

For example, both myself and QMC Graham use the same macro. He found, switching the machine off with tool 8, allows the logic to work when the machine is homed. This is because everything is reset and A = 0. If the tool changer asks for Tool 1, then it goes, 1 + 0 (existing axis) = 1, therefore do a move of 1 set of tools.

If my machine is on tool 3 and it goes out of sync for whatever reason, I need to 'bluff' the machine and get tool 8 back, then home and start again.

I would assume that a function could be written simply to ask 'What tool is currently in position'? This answer is then taken and applied to do an update to the A Axis machine coordinates. In Mach 3 (spit), it was possible to simply type in the Tool number in the DRO.

I could probably 'steal' some code from the speedtestspindle.cnc programme, showing how inputs are dealt with. This might be trivial for some. I then assume you can instruct A Axis (machine coord), to be that new value?

Thanks
Threedj16
Posts: 224
Joined: Thu Feb 22, 2018 1:21 am
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: C8FD19F23AFF-0213180659
DC3IOB: No
CNC11: No
CPU10 or CPU7: No
Location: Augusta, Ga

Re: ATC Macro / PLC Help please <success!>

Post by Threedj16 »

Curious if you have a switch to set tool 1 that can be used in your cnct.hom file? Or do you set home via a coordinate?
Chaz
Posts: 392
Joined: Thu Feb 08, 2018 7:57 am
Acorn CNC Controller: No
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC11: No
CPU10 or CPU7: No

Re: ATC Macro / PLC Help please <success!>

Post by Chaz »

Threedj16 wrote: Wed May 16, 2018 10:35 am Curious if you have a switch to set tool 1 that can be used in your cnct.hom file? Or do you set home via a coordinate?
I think this might be the answer. I assume M26 would be used here. Thing is, the A axis never actually zeros however (it has no sensor in my case). Perhaps fitting a sensor might help actually ..... but then Id need PLC coding which Id like to avoid.
Chaz
Posts: 392
Joined: Thu Feb 08, 2018 7:57 am
Acorn CNC Controller: No
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC11: No
CPU10 or CPU7: No

Re: ATC Macro / PLC Help please <success!>

Post by Chaz »

The answer might be here, from 'unwinding' a rotary axis.

http://www.cncsnw.com/4thHowTo.htm

"Unwinding the rotary axis
If you run jobs with continuous rotation, you will want a fast and simple way of resetting the rotary axis to zero turns.

Suppose your program starts at B0, and works its way around 100 turns to complete the part. If you leave the B axis sitting at B36000 and start the cycle over, it will probably want to "unwind" those 100 turns before it can start the first cut.

You could just go to the Part Setup screen (F1/Setup, F1/Part) and reset the rotary axis to a position of 0.0, but that is an extra step every time you run the program. It will also give you a surprise next time you cycle the power and home the machine: the control will remember that the B axis part zero has been reset several hundred turns away from its machine home position, so immediately after homing the DRO will display (minus) all those turns.

A better solution is to have your part program reset both machine home and part zero at the end of the cycle. Add two lines to the end of your program, similar to the following:

M26/B
G92 B0
If you are programming in Intercon you can do this with Intercon's Insert M&G Code option, on the F6/Other menu. If you generate your programs with a CAD/CAM system, you should see about adding the codes to your post processor so they are included automatically.
These commands will reset and re-zero the rotary axis wherever it may sit, without regard to its angle from the previous home position or part zero.

If it is important for you to maintain part zero (e.g. you are using a fixture that is level at B0.0), be sure to program it to move the remaining distance to a whole number of turns (to an even multiple of 360.0) before issuing the reset commands above.

If it is important for you to maintain machine zero (homed position) on the rotary axis as well, and it is not the same as part zero, then you will either need some more advanced codes, or you can just repeat the rotary axis operations from your homing macro file (CNC7.HOM or cnc10m.hom). The most typical example would be:

M91/B
M26/B
In this case the G92 is not needed. The M91 move goes back to the home switch, just as it did on initial homing after power-up; and the M26 sets home there.
In rare cases, you may need to reset a rotary axis in the middle of a program cycle, rather than just at the end. This would occur if there was a chance of exceeding 231 (about 2.1 billion) encoder counts on the rotary axis servo during the job. To estimate whether you need to worry about this, divide 2.1 billion by your encoder counts per turn, motor turns per degree, and 360 degrees per revolution. For example, a rotary table with an 8000-count encoder and 90:1 gearbox (0.25 motor revs per degree) could go slightly less than 3000 turns before needing to be reset with an M26.

231
----------------- = 2982.6
8000 * 0.25 * 360
If you do put M26 and/or G92 in the middle of your program, or even just a G92 at the beginning, be aware that this will have side effects when you use the Centroid control's Search and Resume features."


So, will this work?

How do I tell the machine to do 'Reset A axis to whatever number I give you'?
Looking at the spindlebenchtest code in another thread. This is what I see of interest

";Variables
#100 = 0
;#101 = System Test progress
#102 = 59 ; ascii value for ;
#103 = 0 ; 0 = start system test from the beginning,
; 1 = continue from last completed operation
;#29001 = Spindle Analog Reading #1
;#29002 = Spindle Analog Reading #2
;#29003 = Spindle Analog Reading #3
;#29004 = Spindle Analog Reading #4


M225 #100 "For testing purposes, please set your max spindle speed to 3000rpm.\nPlease make sure your spindle drive is diconnected from the Acorn before proceeding\nPress Cycle Start to continue"
M121 "c:\cncm\testingresults.txt"
M223 "%c" #102
M127
G65 "C:\cncm\testingresults.txt"
IF #103 == 0 THEN M223 "%cBenchtesting started\n" #102
M223 "%c" #102
M127
IF #103 == 0 THEN #101 = 0
IF #103 == 0 THEN M223 "#101 = 0 \n"
IF #103 == 0 THEN M225 #100 "Welcome to the Bench Testing Utility.\nPlease make sure you have a DVM and a copy of the Installation Manual on hand.\n Press Cycle start (alt-s) to continue"


;Spindle Analog Section
N0
M3 S500
M224 #29001 "Voltage Reading #1 - S500\n Enter the voltage (VDC) read between Spindle Analog and Spindle Analog Com\n Press Cycle start (alt-s) to continue"
IF [[[#29001] < 1.49] || [[#29001] > 1.852]] THEN M225 #100 "Invalid voltage. Voltage should be within +-10 percent .6VDC\Please connfirm Max spindle is 3000rpm.\nPress Cycle start (alt-s) to retry"
IF [[[#29001] < 1.49] || [[#29001] > 1.852]] THEN GOTO [#101]
M223 "%c" #102
M127
M223 "#29001 = %.4f %cFirst spindle analog reading(.6 nom) was %.4f\n" #29001 #102 #29001
#101 = #101 + 1
M223 "#101 = %0.f\n" #101
"
How do I capture input from the user and then tell it to set A Axis Machine to that value?
Chaz
Posts: 392
Joined: Thu Feb 08, 2018 7:57 am
Acorn CNC Controller: No
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC11: No
CPU10 or CPU7: No

Re: ATC Macro / PLC Help please <success!>

Post by Chaz »

Turns out this macro doesnt work if you have more than 2 tool changes. The 'distance to go' value is interferring. We have tried to read the G54 A Axis value, not sure which one is correct (5043 or 2700 / 2701), nothing seems to work.
Chaz
Posts: 392
Joined: Thu Feb 08, 2018 7:57 am
Acorn CNC Controller: No
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC11: No
CPU10 or CPU7: No

Re: ATC Macro / PLC Help please <success!>

Post by Chaz »

What difference is there running this ATC in MDI versus in Program? Why does it work via MDI but not via the programme, related to G54?
Chaz
Posts: 392
Joined: Thu Feb 08, 2018 7:57 am
Acorn CNC Controller: No
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC11: No
CPU10 or CPU7: No

Re: ATC Macro / PLC Help please <success!>

Post by Chaz »

M0 seems to allow an 'reset' but then needs Cycle Start to resume, it works but need manual intervention. Can we do something else in the macro or produced code to reset as if doing an MDI command that then ends and removes the 'distance to go' measurement back to 0. It not, it interferres with the calcs.
Centroid_Tech
Posts: 286
Joined: Thu Mar 18, 2010 2:24 pm

Re: ATC Macro / PLC Help please <success!>

Post by Centroid_Tech »

Please post a current report from your system. You should not need to "unwind" a turret axis. Performing a tool change in MDI should be exactly the same as when running it from a program. Please also provide a copy of the program that you are running.
When requesting support, please ALWAYS post a current report. Find out how to take a report from your Acorn, CNC11 or CNC10 system here: https://www.youtube.com/watch?v=Ecvg0VJp1oQ.

If your question is PLC, Macro or program related, please also post a copy of the program or macro as well.

Without the above information we may not be able to help and/or reply until the required information is posted..
QMC Graham
Posts: 15
Joined: Tue Jan 30, 2018 3:08 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 38D269531FCE-0118180555
DC3IOB: No
CNC11: No
CPU10 or CPU7: No
Location: London uk

Re: ATC Macro / PLC Help please <success!>

Post by QMC Graham »

Please find attached my report and the program I was using, which was written with intercon.
Both my self and Chaz use the same macro for tool turret. we both have different turrets on different machines, but both turrets have no switches or sensors of any kind.
My turret will index any of its 8 available tools all day long in MDI or using the ATC function.
Problem comes when running a program.
Start with tool 1 A axis displays 1 for tool 1 = correct. Distance to go 0 = correct.
Program runs tool 1 faces.

G28 return index to tool 2 ,display shows A axis 2 = correct. Distance to go -2 = not correct. (this - figure does not appear in MDI or ATC. distance to go always resets to 0)

With the distance to go showing -2 tool 2 will turn its features fine then G28 return index to tool 3, but now there is -2 in the distance to go the turret will move a distance of 3 not 1 i.e tool 2 to tool 3 move of 1 (all this works in MDI/ATC) IT MOVES 1 + -2 = MOVE OF 3.. Ends up on tool 5.

As Chaz says using M0 sorts out the reset of distance to go.(whilst running a program)

As i hope what is a Temporary measure we added the M0 to our tool change macro after the M26 / A L {#.....*#.....]
This has the effect of pausing after tool change, waiting for cycle start to pressed. This causes the distance to go to reset to 0.
Meaning all tool changes in the program will now move to the correct tool.
Attachments
test.lth
(1.02 KiB) Downloaded 151 times
report_38D269531FCE-0118180555_2018-06-11_19-48-53.zip
(200.59 KiB) Downloaded 162 times
Post Reply