Hello Guest it is March 29, 2024, 07:32:15 AM

Author Topic: Modbus Simple spindle control brain........  (Read 4696 times)

0 Members and 1 Guest are viewing this topic.

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Modbus Simple spindle control brain........
« on: February 13, 2008, 09:48:45 AM »
Greetings here is a Brain to do Modbus Spindle control (Out), using Brians and Macropump (this is going to a PLC with a 12 bit Analog module, but you could write it to a M1 board, or Peters board).

When doing Spindle control over a modbus (I used TCP in this example), the M3 and M4 CAN happen at the same time. The DRO99 (Spindle percent), is always accurate for Mach regardless of Spindle over rides. It will max out at 1%, at the top of your pulley range, it doesnt matter how much your spindle over ride is.

You need to keep your m3 and m4 controls in Output range 1-6 for mach to use its native LEDs for CW, CCW.

Further When doing control over the Modbus, at the initilize of Mach you can get some wierd "Space junk" in spindle control OVR. I have also put some code you need to drop into your Macropump to set these to correct values on moving out of Reset. (It resets them, each time you move out of reset).

'Macropump.m1s

k=GetUserDRO(2000)                               'Interlock counter

If k=0 and Not(GetOEMLED(800)) Then     'reset off (mach in run condition)
DoOEMButton(183)                                 'Reset Spindle override
SetOEMDRO(99,0)                   'set % to zero
SetUserDRO(2000,1)                                'set interlock counter
End If

If GetOEMLED(800) Then                        'On reset (mach in Estop condition)
SetUserDRO(2000,0)                               'reset interlock counter
End If

'Scott (Brain Attached)
fun times
Re: Modbus Simple spindle control brain........
« Reply #1 on: February 23, 2009, 10:24:01 PM »
Thanks for posting this!

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Modbus Simple spindle control brain........
« Reply #2 on: February 24, 2009, 09:30:02 AM »
no prob
fun times