Hello Guest it is December 14, 2024, 10:22:32 AM

Author Topic: Brains spindle control and a few other questions  (Read 5699 times)

0 Members and 1 Guest are viewing this topic.

Brains spindle control and a few other questions
« on: August 27, 2024, 08:45:45 AM »
Hi all
i'm busy doing my own ModBus-Brains control station and jog pendant using MEGA 2560
nearly finished got modbus working all my buttons led's and %controls working
having a few problems with a couple of items
some help would be appreciated

Spindle works through M03,M04,M05 and outputs 1 and 2 turn on but cant get spindle CW and CCW working properly using button (110 and 173). They work once then I have to do a control reset for them to work again.
what is the correct way to  use these two buttons and what is button (182)
scoured the posts but can't find any example brains.

Using an MPG decoded in the arduino to count pulses up and down. Pass this number into MPG counter 1 and it partially works. Until I pass a negative number over then it goes to 64567 counts for -1. using the multi-step mode
probably doing something wrong, what should I be doing.

is it possibble in brains to do an individual axis GoTo zero, can only find an all axis buttonpress

Thanks in advance
servomac

Offline TPS

*
  •  2,536 2,536
Re: Brains spindle control and a few other questions
« Reply #1 on: August 30, 2024, 09:50:03 AM »
i am afraid you will have to make a workaround to control spindle by brain
by using Userled's witch are set in the brain.
then macropump script can read these LED's and control spindle

example for macropump script:
Code: [Select]
'turn spindle on CW ----------------------------------------------
'check UserLed was set by brain and SingleShot LED is False
If (GetUserLed(1500) = True) And (GetUserLed(1501) = False) Then
DoSpinCW()
End If
'update status of single shot LED
SetUserLed(1501,GetUserLed(1500))

'turn spindle on CCW ---------------------------------------------
'check UserLed was set by brain and SingleShot LED is False
If (GetUserLed(1502) = True) And (GetUserLed(1503) = False) Then
DoSpinCCW()
End If
'update status of single shot LED
SetUserLed(1503,GetUserLed(1502))

'turn spindle OFF ------------------------------------------------
'check UserLed was set by brain and SingleShot LED is False
If (GetUserLed(1504) = True) And (GetUserLed(1505) = False) Then
DoSpinStop()
End If
'update status of single shot LED
SetUserLed(1505,GetUserLed(1504))

in this example
UserLed(1500) will turn on Spindle CW
UserLed(1502) will turn on Spindle CCW
UserLed(1504) will Stop Spindle

i have no idea for your MPG problem, but maybe this

https://www.youtube.com/watch?v=ICYedxkSXGc

can help.

individual axis GoTo zero can be done in the same way like spindle control.

anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Brains spindle control and a few other questions
« Reply #2 on: August 31, 2024, 03:20:41 PM »
Hi all
after reading as many posts have finally found out what I was doing wrong. I was writing my MPG value into DRO 101-MPG 0 count. I now put it into Mach variable MPG 1 count, everything is working fine now
thanks for looking
Re: Brains spindle control and a few other questions
« Reply #3 on: September 01, 2024, 02:41:06 PM »
hi
many thanks TPS, will go down this route when I get back from wandering round the scottish highlands
cheers
servomac