Oak CNC12 v4.14 software crash M5 RTG < fixed>

All things related to Centroid Oak, Allin1DC, MPU11 and Legacy products

Moderator: cnckeith

Post Reply
burke_wl
Posts: 20
Joined: Wed May 22, 2019 9:14 am
Acorn CNC Controller: No
Allin1DC CNC Controller: No
Oak CNC controller: Yes
CNC Control System Serial Number: 0506190790
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Oak CNC12 v4.14 software crash M5 RTG < fixed>

Post by burke_wl »

Im having trouble with CNC12 turning off/crashing whenever an M5 spindle off command is issued. It responses the same way whether the M5 is issued via MDI or if it is with in a G-code program for example the provided PAWN.cnc program. It will run the entire program without issue until it gets to the line with M5 and then CNC12 shuts off.

I'm getting the same problem (CNC12 turning off/crashing) when I load a program and then press F8 to graph or if I'm in Intercon and press F8 graph. Once I try to use the graph function CNC12 shuts off

I don't know if this is related but there is also another issue with the analog spindle output voltage. The installed spindle drive requires +10/-10 so I have output 15 and 16 inverted. Using M4 the output voltage is scaled properly. Using M3 the voltage maxes out at half of rated speed.

ex:3000rpm max

M4 3000rpm = -10v
M4 1500rpm = -5v

M3 1500rpm = 10v
M3 750rpm = 5v
Attachments
report_0506190790_2019-07-22_20-35-15.zip
(391.03 KiB) Downloaded 91 times
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: Oak CNC12 v4.14 software crash M5 RTG

Post by cnckeith »

thanks for posting the report..it shows...the M5 macro is calling the M5 inside itself.. infinite loop. work around/fix by removing the M5 from inside mfunc5.mac
you can "spell out" the M5 with its base commands inside the macro if needed. or if you are not doing any custom work with the M5, just delete the mfunc5.mac 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
burke_wl
Posts: 20
Joined: Wed May 22, 2019 9:14 am
Acorn CNC Controller: No
Allin1DC CNC Controller: No
Oak CNC controller: Yes
CNC Control System Serial Number: 0506190790
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Re: Oak CNC12 v4.14 software crash M5 RTG

Post by burke_wl »

cnckeith wrote: Tue Jul 23, 2019 2:53 pm thanks for posting the report..it shows...the M5 macro is calling the M5 inside itself.. infinite loop. work around/fix by removing the M5 from inside mfunc5.mac
you can "spell out" the M5 with its base commands inside the macro if needed.
Hi Keith,

Thanks for the reply.

I deleted the M5 from the M5 macro and that has stopped CNC12 from crashing and is allowing the graph function to work on the .cnc files that do not require an encoder. When opening the encoder required files I get an error in the graph screen, and an error in the message window.
Attachments
graph M5 error.PNG
M5.PNG
cncsnw
Posts: 3855
Joined: Wed Mar 24, 2010 5:48 pm

Re: Oak CNC12 v4.14 software crash M5 RTG

Post by cncsnw »

Just delete the mfunc5.mac file. There is usually no need for a custom M5.
cncsnw
Posts: 3855
Joined: Wed Mar 24, 2010 5:48 pm

Re: Oak CNC12 v4.14 software crash M5 RTG

Post by cncsnw »

I don't know if this is related but there is also another issue with the analog spindle output voltage. The installed spindle drive requires +10/-10 so I have output 15 and 16 inverted. Using M4 the output voltage is scaled properly. Using M3 the voltage maxes out at half of rated speed.

ex:3000rpm max

M4 3000rpm = -10v
M4 1500rpm = -5v

M3 1500rpm = 10v
M3 750rpm = 5v
This is not related to the M5 issue. Instead, this is due to an error in the PLC program.

Inside "Minus5Or10ToPlus5Or10Stage", around lines 3084 - 3090, someone has written:

Code: Select all

;0 RPM = 32768
;IF command is CW (SpindleDirectionOut = OFF) + 32768
;IF command is CCW (SpindleDirectionOut = OFF), negate SixteenBitSpeed_W
;and add to 32768
IF !SpindleDirectionOut_O THEN SixteenBitSpeed_W = (SixteenBitSpeed_W + 32768)
IF SpindleDirectionOut_O
  THEN SixteenBitSpeed_W = (((SixteenBitSpeed_W * -1)*.5) + 32768)
Besides being less clear and less efficient than it might be, it is wrong in the case of forward rotation (SpindleDirectionOut_O not set). The SixteenBitSpeed_W value should be divided by two before it is added to 32768.

I would have written it something like this:

Code: Select all

IF !SpindleDirectionOut_O THEN SixteenBitSpeed_W = 32768+(SixteenBitSpeed_W/2)
IF SpindleDirectionOut_O  THEN SixteenBitSpeed_W = 32768 - (SixteenBitSpeed_W/2)
burke_wl
Posts: 20
Joined: Wed May 22, 2019 9:14 am
Acorn CNC Controller: No
Allin1DC CNC Controller: No
Oak CNC controller: Yes
CNC Control System Serial Number: 0506190790
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Re: Oak CNC12 v4.14 software crash M5 RTG

Post by burke_wl »

cncsnw wrote: Wed Jul 24, 2019 8:56 am
I don't know if this is related but there is also another issue with the analog spindle output voltage. The installed spindle drive requires +10/-10 so I have output 15 and 16 inverted. Using M4 the output voltage is scaled properly. Using M3 the voltage maxes out at half of rated speed.

ex:3000rpm max

M4 3000rpm = -10v
M4 1500rpm = -5v

M3 1500rpm = 10v
M3 750rpm = 5v
This is not related to the M5 issue. Instead, this is due to an error in the PLC program.

Inside "Minus5Or10ToPlus5Or10Stage", around lines 3084 - 3090, someone has written:

Code: Select all

;0 RPM = 32768
;IF command is CW (SpindleDirectionOut = OFF) + 32768
;IF command is CCW (SpindleDirectionOut = OFF), negate SixteenBitSpeed_W
;and add to 32768
IF !SpindleDirectionOut_O THEN SixteenBitSpeed_W = (SixteenBitSpeed_W + 32768)
IF SpindleDirectionOut_O
  THEN SixteenBitSpeed_W = (((SixteenBitSpeed_W * -1)*.5) + 32768)
Besides being less clear and less efficient than it might be, it is wrong in the case of forward rotation (SpindleDirectionOut_O not set). The SixteenBitSpeed_W value should be divided by two before it is added to 32768.

I would have written it something like this:

Code: Select all

IF !SpindleDirectionOut_O THEN SixteenBitSpeed_W = 32768+(SixteenBitSpeed_W/2)
IF SpindleDirectionOut_O  THEN SixteenBitSpeed_W = 32768 - (SixteenBitSpeed_W/2)
Thanks Marc for the clarification on this. I wasn't sure if this was caused by parameter setting or the PLC.

Deleting the mfunc5.mac file fixed the other errors.
Post Reply