Sequencing events - delaying spindle speed command until x time after enable

More
10 Apr 2024 01:28 #297884 by Bennett
Hello, I'm trying to solve the following issue: 

Firstly, I'm using a Mesa 7i76e card to retrofit a Hardinge CHNC lathe. Special thanks to those who have shared info on the turret indexing etc (John!). 

I have made a spindle driver for the DC spindle motor that these things were shipped with. I want to sequence a few events when the spindle is commanded ON (M03). 

M03 needs to equal: 
1. Engage contactor (easy)
2. Delay x amount of time (1 second or so, precharge capacitors)
3. ramp up spindle speed (using mesa's 'potentiometer replacement' section of card) and PID control speed to by using the spindle encoder for feedback 

M05 needs to equal the same steps in reverse:
1. ramp down spindle speed
2. delay or look to see that spindle is near zero rpm, either is fine
3. disengage contactor 

I saw posts on how to hold feed moves until spindle is up to speed but I have not seen anything yet on how to delay speed command for a duration after spindle enable is used for something. Maybe theres a way to do this? 

Looking forward to any tips you may have! 

Thanks very much.  

Please Log in or Create an account to join the conversation.

More
10 Apr 2024 02:46 - 10 Apr 2024 02:47 #297889 by tommylight
Probably sending the PWM signale through timedelay or oneshot will work for M3, but that would also delay M5, so not good.
No idea if something could be done with remaping M3 and M5, but being LinuxCNC, i would venture a guess at yes.
Might also be possible without any of that,just in gcode, using M3 to turn on the relay then waiting for a sec or two with G04 P1 and following with another M3 with S value. To stop it, M3 S0, then G04 P1, then M5.
Hmmm, this might just work, granted the ini should be set for 0 spindle speed.
Last edit: 10 Apr 2024 02:47 by tommylight. Reason: typo

Please Log in or Create an account to join the conversation.

More
10 Apr 2024 16:41 #297943 by Bennett

Probably sending the PWM signale through timedelay or oneshot will work for M3, but that would also delay M5, so not good.
No idea if something could be done with remaping M3 and M5, but being LinuxCNC, i would venture a guess at yes.
Might also be possible without any of that,just in gcode, using M3 to turn on the relay then waiting for a sec or two with G04 P1 and following with another M3 with S value. To stop it, M3 S0, then G04 P1, then M5.
Hmmm, this might just work, granted the ini should be set for 0 spindle speed.

Yes, looks like this gcode solution will work to get me started, thanks! I would like to find a HAL or under-the-hood solution though because the machine will be shared at a maker space where people may forget to replace the spindle commands with the delayed version.

Maybe there's a way...
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

Time to create page: 0.135 seconds
Powered by Kunena Forum