M Codes For Open/Close Chuck

All things related to the Centroid Acorn CNC Controller

Moderator: cnckeith

Ken Rychlik
Posts: 353
Joined: Wed Jan 23, 2019 4:19 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 80F5B5B92C3A-0213236854
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Re: M Codes For Open/Close Chuck

Post by Ken Rychlik »

Are you just using one output for opening and closing the chuck? Say for instance, it is output 4

Using Mick's method.....

Your macro could be something like
M64 (turns on ouput 4)
G4 P2 (2 second pause)
M84 (turns off output 4)
Ken
eflor8234
Posts: 29
Joined: Fri Apr 05, 2019 2:59 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Re: M Codes For Open/Close Chuck

Post by eflor8234 »

Ken Rychlik wrote: Mon Apr 08, 2019 7:59 pm Are you just using one output for opening and closing the chuck? Say for instance, it is output 4

Using Mick's method.....

Your macro could be something like
M64 (turns on ouput 4)
G4 P2 (2 second pause)
M84 (turns off output 4)
That's all I'm doing. I'm new to this and some of the macros looked pretty intimidating. If it's that simple, I'm a happy man.

Would that macro result in an auto off for the output? Right now my open/close sequence looks like this:

m35- output seven turns on (hydraulic solenoid activates to open chuck)
m36- output seven turns off (solenoid is inactive)
m33- output eight turns on (hydraulic solenoid activates to close chuck)
m34- output eight turns off (hydraulic solenoid inactive)

What I'd like to have happen and what the wizard says should happen is:

chuckopen m14- output seven turns on (hydraulic solenoid activates to open chuck)

The wizard instructs to go to parameter 992 to set the auto off timer for the m14 command. Since this isn't working, I'd like the result of the single M-code to be this:

OpenChuck M14: output turns on for 2 seconds and then turns off automatically.
CloseChuck M16: output turns on for 2 seconds and then turns off automatically.

If this is my starting macro...

;------------------------------------------------------------------------------
; Filename: mfunc64.mac
; Wizard OUTPUT4 M-code Macro: M64
; Description: User Customizable Macro
; Notes: Use Acorn Wizard i/o map to set Acorn Output 4 = to "OUTPUT4" then this macro (M64) will turn on that output
; Requires:
; Please see TB300 for tips on writing custom macros.
;------------------------------------------------------------------------------

IF #50010 ;Prevent lookahead from parsing past here
IF #4201 || #4202 THEN GOTO 1000 ;Skip macro if graphing or searching

N100 ;Insert your code between N100 and N1000

M94 /64 ;Request OUTPUT4

N1000 ;End of Macro



Would this be what my finished macro would look like?


;------------------------------------------------------------------------------
; Filename: mfunc64.mac
; Wizard OUTPUT4 M-code Macro: M64
; Description: User Customizable Macro
; Notes: Use Acorn Wizard i/o map to set Acorn Output 4 = to "OUTPUT4" then this macro (M64) will turn on that output
; Requires:
; Please see TB300 for tips on writing custom macros.
;------------------------------------------------------------------------------

IF #50010 ;Prevent lookahead from parsing past here
IF #4201 || #4202 THEN GOTO 1000 ;Skip macro if graphing or searching

N100 ;Insert your code between N100 and N1000

M94 /64 ;Request OUTPUT4
G04 P2
M95 /64
N1000 ;End of Macro


Thanks! My big concern is that during MDI operations I will forget to shutoff one of my open/close inputs before activating the opposite. Both sides of the solenoid would be receiving current.
eflor8234
Posts: 29
Joined: Fri Apr 05, 2019 2:59 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Re: M Codes For Open/Close Chuck

Post by eflor8234 »

mick41zxr wrote: Mon Apr 08, 2019 6:26 pm Looking at the Macro's in your report I don't think you have your outputs configured correctly.

Try testing by leaving the output set as OUTPUT#
Then using a,
M94 /61 ;to open output 1.... 62 for out2 etc
To close output use,
M95 /61 ;to close output 1
or you can use a M61 & M81 directly.
Thanks!

How much will my formatting of the macro come into play? Does each line need certain symbols or capitalization?

Is it as simple as...

;M94 /61
;G04 P2
;M95 /61

Thanks!
Ken Rychlik
Posts: 353
Joined: Wed Jan 23, 2019 4:19 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 80F5B5B92C3A-0213236854
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Re: M Codes For Open/Close Chuck

Post by Ken Rychlik »

Try each command one at a time in the MDI and then stack them in your macro. If you enter something that it won't accept, it will give you a message. Capitols do not matter.
Last edited by Ken Rychlik on Tue Apr 09, 2019 7:55 am, edited 1 time in total.
Ken
Ken Rychlik
Posts: 353
Joined: Wed Jan 23, 2019 4:19 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 80F5B5B92C3A-0213236854
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Re: M Codes For Open/Close Chuck

Post by Ken Rychlik »

try this in your macro. No warranty expressed or implied. lol

M5 ;Turn off spindle (there could be a better "if spindle is on abort" type of safety
M67 ;Turn on output 7
G04 P2 ;2sec pause
M87 ;Turn off output 7
M200 "#)**Change Tool Now**\nPress Cycle Start to continue"
M68 ; Turn on output 8
G04 P2 ;2sec pause
M88 ; turn off output 8

If I messed anything up, maybe the guru's will help.
Ken
Ken Rychlik
Posts: 353
Joined: Wed Jan 23, 2019 4:19 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 80F5B5B92C3A-0213236854
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Re: M Codes For Open/Close Chuck

Post by Ken Rychlik »

Then when you get it doing what you want, you can assign it one of the aux buttons on top.

Also for the M67 M87 to work the output 7 needs to be on ouput 7 in the wizzard screen. Otherwise you will have to substitue the commands you have working there.
Ken
eflor8234
Posts: 29
Joined: Fri Apr 05, 2019 2:59 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Re: M Codes For Open/Close Chuck

Post by eflor8234 »

I have this working for both M68 and M67

I'll try the suggested ones when I get more time to play. Thanks!
Thanks for the help

N100 ;Insert your code between N100 and N1000

M94 /68 ;Request OUTPUT8

G4 p3

M95 /68 ;Request OUTPUT8

N1000 ;End of Macro
Centroid_Tech
Posts: 286
Joined: Thu Mar 18, 2010 2:24 pm

Re: M Codes For Open/Close Chuck

Post by Centroid_Tech »

Looks like there was a piece of logic in the PLC program that was preventing the ChuckTimer from actually being set. Please copy the attached file into the c:\cnct\WizardResources\Template directory. You will need to open up the Wizard and change something in the I/O list of the main page in order for the Wizard to create a new PLC program with the update .src file.
Attachments
acorn_universal_template.src
(184.13 KiB) Downloaded 133 times
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..
Post Reply