Why is spindle not commanded when using variables within my program?
Moderator: cnckeith
-
- Posts: 2
- Joined: Sat Dec 11, 2021 5:28 pm
- Acorn CNC Controller: Yes
- Allin1DC CNC Controller: No
- Oak CNC controller: No
- CNC Control System Serial Number: 0c1c57097662-0717203538
- DC3IOB: No
- CNC12: Yes
- CNC11: No
- CPU10 or CPU7: No
Why is spindle not commanded when using variables within my program?
Long story short, I'm trying to use my 4 axis acorn to control 5 axis (4+1). I have 3 boards, 1 mill pro, 1 lathe pro and one I use as a test board. I am using variables to store and recall A axis positions (yes, I know, but I started all of this before you guys came out with the Acorn six). I got everything to work on my test board. Moved everything to my G0704 mill and found out that the acorn would not turn on the relay (3) for the spindle (found out later this was true on my test board also when I added the spindle forward output in the wizard). Discovered that if the M3 command comes before any variable call outs the spindle will come on but once any spindle off is read (m6, m5, m30, tool check etc.), I have to power cycle the board and re home to regain control of the spindle (not much fun if you have more than one tool). Attached is a link to photos of my conversions and a simple program using my 5 axis post to drill some holes in the xy plane just to keep the code short.
- Attachments
-
- report_E062347DFE48-0126225581_2023-09-21_16-23-23.zip
- report file from test board
- (797.08 KiB) Downloaded 7 times
-
- Photos.txt
- link to photos
- (43 Bytes) Downloaded 12 times
-
- op-3.nc
- sample program
- (731 Bytes) Downloaded 10 times
(Note: Liking will "up vote" a post in the search results helping others find good information faster)
-
- Site Admin
- Posts: 8841
- 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: Why is spindle not commanded when using variables within my program?
please post a fresh report.zip
and for anyone else the photos are here.
and for anyone else the photos are here.
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
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
(Note: Liking will "up vote" a post in the search results helping others find good information faster)
-
- Site Admin
- Posts: 8841
- 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: Why is spindle not commanded when using variables within my program?
and can you describe how the system you've built with a diagram, how and when and where is information being stored etc. what you are trying to accomplish with each step. this will give us a better understanding so we can give you good guidance.
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
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
(Note: Liking will "up vote" a post in the search results helping others find good information faster)
Re: Why is spindle not commanded when using variables within my program?
I don't see any variable references in his M3 or M5 macros.
He does use CNC variables in the "op-3.cnc" program, apparently do manipulate the fourth axis positions. In the absence of comments, it is pretty hard to tell what he is trying to do exactly, but it is suspect in part because he is mixing local part positions (e.g. #5044) with machine-coordinates positions (e.g. #2801). Presumably he is going to see incorrect results if the A axis part zero is not located at A axis machine zero.
If he has problems restarting the spindle once it has been started and stopped once, that probably relates to his PLC logic rather than the variables in the CNC program.
If he has problems with the order of operations -- e.g. if the 4th axis part zero location, via #2801, changes before the part of the program that led up to the change has actually executed, that is not surprising.
Any change to a variable with long-lasting side effects, such as a static variable (#150-#159); a part zero location; a Machine Parameter; etc., should be preceded by the "IF #50001" idiom to ensure that the change is not executed until execution of the CNC code has caught up to that point. Otherwise, the variable will be updated during read-ahead in G code parsing.
He does use CNC variables in the "op-3.cnc" program, apparently do manipulate the fourth axis positions. In the absence of comments, it is pretty hard to tell what he is trying to do exactly, but it is suspect in part because he is mixing local part positions (e.g. #5044) with machine-coordinates positions (e.g. #2801). Presumably he is going to see incorrect results if the A axis part zero is not located at A axis machine zero.
If he has problems restarting the spindle once it has been started and stopped once, that probably relates to his PLC logic rather than the variables in the CNC program.
If he has problems with the order of operations -- e.g. if the 4th axis part zero location, via #2801, changes before the part of the program that led up to the change has actually executed, that is not surprising.
Any change to a variable with long-lasting side effects, such as a static variable (#150-#159); a part zero location; a Machine Parameter; etc., should be preceded by the "IF #50001" idiom to ensure that the change is not executed until execution of the CNC code has caught up to that point. Otherwise, the variable will be updated during read-ahead in G code parsing.
(Note: Liking will "up vote" a post in the search results helping others find good information faster)
-
- Posts: 2
- Joined: Sat Dec 11, 2021 5:28 pm
- Acorn CNC Controller: Yes
- Allin1DC CNC Controller: No
- Oak CNC controller: No
- CNC Control System Serial Number: 0c1c57097662-0717203538
- DC3IOB: No
- CNC12: Yes
- CNC11: No
- CPU10 or CPU7: No
Re: Why is spindle not commanded when using variables within my program?
After a long pause, I revisited my issue with my 4th and 5th axis setup. I was wrong. The variables I was using were not causing the problem restarting the spindle. I was using M10 and M11 to control relay 6 to switch between axis 4 and axis 5. These two m codes were the cause of the spindle being disabled not any of the variables I used. I replaced m10 with m66 and m11 with m86 in my program and everything works! 5 axis control with acorn 4 axis controller. Acorn 6 would have been simpler and so would the post processor!
1 user liked this post
(Note: Liking will "up vote" a post in the search results helping others find good information faster)
(Note: Liking will "up vote" a post in the search results helping others find good information faster)
-
- Posts: 153
- Joined: Sun Jan 08, 2023 9:48 pm
- Acorn CNC Controller: Yes
- Allin1DC CNC Controller: No
- Oak CNC controller: No
- CNC Control System Serial Number: 6665
- DC3IOB: No
- CNC12: Yes
- CNC11: No
- CPU10 or CPU7: No
- Location: Louisiana
- Contact:
Re: Why is spindle not commanded when using variables within my program?
Good pick on motors. I have had nothing but good things to say about Teknic...
Seth
P.S. Even their older controllers still work with updated technologies. Anyway, good pick.
Seth
P.S. Even their older controllers still work with updated technologies. Anyway, good pick.
1 user liked this post
(Note: Liking will "up vote" a post in the search results helping others find good information faster)
(Note: Liking will "up vote" a post in the search results helping others find good information faster)