custom macro help (Resolved)
Moderator: cnckeith
-
- Posts: 18
- Joined: Sun Oct 15, 2017 10:03 pm
- Acorn CNC Controller: Yes
- Allin1DC CNC Controller: No
- Oak CNC controller: No
- CNC Control System Serial Number: B0D5CCFD5C69-0822170084
- DC3IOB: No
- CNC11: Yes
- CPU10 or CPU7: No
custom macro help (Resolved)
Hi everyone
i need to set up function "M106" (move plus to switch) for my plasma.
i have a limit switch on the plasma torch to automatically set the correct torch height.
i need m106 to move Z in + direction until the switch on input 8 closes at the set feed rate then that will be set to 0 in the next line of code then after that moved to -15 or whatever measurement..
i have tried writing the file into the cncm file but am doing it wrong and am so far unable to work it out.
can someone please help!?
thanks!
i need to set up function "M106" (move plus to switch) for my plasma.
i have a limit switch on the plasma torch to automatically set the correct torch height.
i need m106 to move Z in + direction until the switch on input 8 closes at the set feed rate then that will be set to 0 in the next line of code then after that moved to -15 or whatever measurement..
i have tried writing the file into the cncm file but am doing it wrong and am so far unable to work it out.
can someone please help!?
thanks!
(Note: Liking will "up vote" a post in the search results helping others find good information faster)
Re: custom macro help
in a file, saved in the c:cncm directory -let's call it mfunc28.mac-
to move until the switch is closed, write: M106 /Z P#5000* F.5
to move until the switch is open, write: M106 /Z P-#5000* F.5
Replace * with the input number the switch is wired into. F is the feedrate it will move at while looking for switch (.5" per minute here). You probably want to move at a faster rate until the switch trips and then use M105 to move in the negative direction at a slow rate until it changes state nad then use:
M26 /Z to set machine home there.
To run it, simply type M28 at MDI or put it in a program.
to move until the switch is closed, write: M106 /Z P#5000* F.5
to move until the switch is open, write: M106 /Z P-#5000* F.5
Replace * with the input number the switch is wired into. F is the feedrate it will move at while looking for switch (.5" per minute here). You probably want to move at a faster rate until the switch trips and then use M105 to move in the negative direction at a slow rate until it changes state nad then use:
M26 /Z to set machine home there.
To run it, simply type M28 at MDI or put it in a program.
(Note: Liking will "up vote" a post in the search results helping others find good information faster)
-
- Posts: 18
- Joined: Sun Oct 15, 2017 10:03 pm
- Acorn CNC Controller: Yes
- Allin1DC CNC Controller: No
- Oak CNC controller: No
- CNC Control System Serial Number: B0D5CCFD5C69-0822170084
- DC3IOB: No
- CNC11: Yes
- CPU10 or CPU7: No
Re: custom macro help
thanks for that!
the custom macro seems to be working but it is not recognising the limit switch opening, in the wizard what should i set input 8 to?
i have tried a few different one with no success
cheers
the custom macro seems to be working but it is not recognising the limit switch opening, in the wizard what should i set input 8 to?
i have tried a few different one with no success
cheers
(Note: Liking will "up vote" a post in the search results helping others find good information faster)
-
- Posts: 9932
- Joined: Tue Mar 28, 2017 12:01 pm
- Acorn CNC Controller: Yes
- Allin1DC CNC Controller: Yes
- Oak CNC controller: No
- CNC Control System Serial Number: none
- DC3IOB: No
- CNC12: Yes
- CNC11: Yes
- CPU10 or CPU7: Yes
- Location: Mesa, AZ
Re: custom macro help
You DO NOT set the input to anything in the Wizard.
The macro simply watches the state of input 8
Did you open the diagnostic screen from the main CNC12 screen (Alt+I) and manually trip the switch? Does input 8 toggle on and off as you trip the switch?
Marty
Reminder, for support please follow this post: viewtopic.php?f=20&t=383
We can't "SEE" what you see...
Mesa, AZ
We can't "SEE" what you see...
Mesa, AZ
(Note: Liking will "up vote" a post in the search results helping others find good information faster)
-
- Posts: 18
- Joined: Sun Oct 15, 2017 10:03 pm
- Acorn CNC Controller: Yes
- Allin1DC CNC Controller: No
- Oak CNC controller: No
- CNC Control System Serial Number: B0D5CCFD5C69-0822170084
- DC3IOB: No
- CNC11: Yes
- CPU10 or CPU7: No
Re: custom macro help
ok so i set input 8 to unused, NC
it comes up as a green dot in diagnostic screen when i trip the switch so that side seems to be good,
its probably a problem in my macro file which goes as follows..
M106 /Z P#50008 F300
M105 /Z P-#50008 F50
M26 /Z
what do you think?
cheers
it comes up as a green dot in diagnostic screen when i trip the switch so that side seems to be good,
its probably a problem in my macro file which goes as follows..
M106 /Z P#50008 F300
M105 /Z P-#50008 F50
M26 /Z
what do you think?
cheers
(Note: Liking will "up vote" a post in the search results helping others find good information faster)
-
- Posts: 8031
- 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: custom macro help
please post a report.zip file
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)
-
- Posts: 286
- Joined: Thu Mar 18, 2010 2:24 pm
Re: custom macro help
It appears that diycncscott got the P values reversed. When the P value is positive, the control is looking for the switch to open and when the P value is negative, the control is looking for the switch to close. Based on your original requirements, the M105/M106 logic in your program as well as the behavior of the switch is incorrect.
You stated that you wanted to move the Z axis in the positive direction until input 8 closes. That means that normally, that input is open until it hits at which point, that input is closed. Is that how you wish for it to operate? If so, in the wizard, you should set that input as NO as it's normally open until it trips. When you press ALT+I to look at the PLC Diagnostic menu in the CNC12 software, that input should be red until you trip it which will then turn green. You should also see a white line above that input which tells the control that input is NO logic rather than NC logic. If the input is behaving correctly, then you will need the following logic.
M106 /Z P-#50008 F300 ; Move Z in positive direction at 300in/min until input 8 closes
M105 /Z P#50008 F50 ; Move Z in negative direction at 50in/min until input 8 opens
M26 ; Set absolute encoder count to 0
You stated that you wanted to move the Z axis in the positive direction until input 8 closes. That means that normally, that input is open until it hits at which point, that input is closed. Is that how you wish for it to operate? If so, in the wizard, you should set that input as NO as it's normally open until it trips. When you press ALT+I to look at the PLC Diagnostic menu in the CNC12 software, that input should be red until you trip it which will then turn green. You should also see a white line above that input which tells the control that input is NO logic rather than NC logic. If the input is behaving correctly, then you will need the following logic.
M106 /Z P-#50008 F300 ; Move Z in positive direction at 300in/min until input 8 closes
M105 /Z P#50008 F50 ; Move Z in negative direction at 50in/min until input 8 opens
M26 ; Set absolute encoder count to 0
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..
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..
(Note: Liking will "up vote" a post in the search results helping others find good information faster)
-
- Posts: 18
- Joined: Sun Oct 15, 2017 10:03 pm
- Acorn CNC Controller: Yes
- Allin1DC CNC Controller: No
- Oak CNC controller: No
- CNC Control System Serial Number: B0D5CCFD5C69-0822170084
- DC3IOB: No
- CNC11: Yes
- CPU10 or CPU7: No
Re: custom macro help
yes you have it right centroidtech,
NO switch, when i go to cnc diagnostics the input 8 light is staying green and going red when i trip the switch, and yes it has the little line above it and is set to NO in the wizard,
macro is now as follows;
M106 /Z P-#50008 F300
M105 /Z P#50008 F50
M26 /Z
FYI im working in metric mm/min
and see attached report
must be getting close to it working!
thanks guys
NO switch, when i go to cnc diagnostics the input 8 light is staying green and going red when i trip the switch, and yes it has the little line above it and is set to NO in the wizard,
macro is now as follows;
M106 /Z P-#50008 F300
M105 /Z P#50008 F50
M26 /Z
FYI im working in metric mm/min
and see attached report
must be getting close to it working!
thanks guys
- Attachments
-
- report_B0D5CCFD5C69-0822170084_2018-06-13_07-07-39.zip
- (159.73 KiB) Downloaded 123 times
(Note: Liking will "up vote" a post in the search results helping others find good information faster)
-
- Posts: 286
- Joined: Thu Mar 18, 2010 2:24 pm
Re: custom macro help
I apologize. I didn't read your first post properly. I believe that if you switch that input back to being NC in the wizard, it should work.
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..
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..
(Note: Liking will "up vote" a post in the search results helping others find good information faster)
-
- Posts: 18
- Joined: Sun Oct 15, 2017 10:03 pm
- Acorn CNC Controller: Yes
- Allin1DC CNC Controller: No
- Oak CNC controller: No
- CNC Control System Serial Number: B0D5CCFD5C69-0822170084
- DC3IOB: No
- CNC11: Yes
- CPU10 or CPU7: No
Re: custom macro help
so i change the wizard to "NC" and now diagnostic input 8 light goes green when tripping the switch but Z is not stopping when it trips in the program..
any more ideas??
any more ideas??
(Note: Liking will "up vote" a post in the search results helping others find good information faster)