How to ramp spindle down on stop?

More
10 Jan 2021 23:06 #194802 by strantor
I would like to ramp my spindle speed down to zero on stops, instead of coming to an abrupt halt. I figured out how to do a ramp, and it works, but only when changing speeds.



With the above lines added/changed in my hal file, I enable the spindle and click the speed +/- buttons and it will gently ramp up and down, but when I click stop, it still slams to a stop. What more can I do?
Attachments:

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

More
10 Jan 2021 23:41 #194814 by tommylight
That is done on the VFD, not software, although i am pretty sure it can be done in software with a timedelay on the ON pin and a ramp down on the PWM pin.
VFD has that setting in seconds, i usually set that at 5.
The following user(s) said Thank You: strantor

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

More
11 Jan 2021 00:45 #194831 by alkabal
Yes as tommylight says on most drive analog/pwm a timedelay do the job
I have use that before writing a component with more control, but timedelay work really fine !
The following user(s) said Thank You: tommylight, strantor

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

More
11 Jan 2021 01:44 #194841 by strantor
Yup, stupid question. I had my head stuck in the past. I'm not used to being able to change parameters in the drive (AB Ultra 3000, no LCD, bad serial port). I was looking for a workaround solution before it blew up, I knew it was going to happen sooner or later, it did, and I replaced it. After it blew up and I replaced it, I continued on trying to force my workaround, when it should have been obvious that I no longer need a workaround because I now have a working serial port. Thanks for talking sense into me.

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

More
11 Jan 2021 12:55 #194894 by andypugh
Just for reference, you could do it all in HAL with a limit2 HAL component to limit the rate of change of spindle speed command. Though you would also need a delay on the drive enable pin to give it time to stop.

Spindle speed rate and speed limiting is on my mental list of things to add now that spindles look like Axes.
Homing too.

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

More
11 Jan 2021 13:19 #194899 by alkabal

To andy

You speak about homing spindle so this is impossible for me to resist, sorry ^^
As starting point your really welcome for review my attempt with orientv2

Br

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

More
11 Jan 2021 14:06 #194907 by strantor
Not that it matters for my scenario (I am going to implement ramp in the drive) but since we are talking publicly and I'm still curious, what's the reason for using limit2 instead of limit3? I am already using limit3 to do this. Limit3 has .maxA (max acceleration I assume, not documented) and .maxV (max velocity I assume) where limit 2 has only .maxV

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

More
11 Jan 2021 14:18 #194909 by andypugh

Not that it matters for my scenario (I am going to implement ramp in the drive) but since we are talking publicly and I'm still curious, what's the reason for using limit2 instead of limit3?


Just a _fractionally_ smaller CPU load.

Bear in mind that if the output is a spindle _velocity_ then limitV is a limit on the rate of change of velocity and limitA is a limit on the rate of change of the rate of change of velocity.

limit / limitdxdt / limitd2xdt2 might have been better pin names.
The following user(s) said Thank You: strantor

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

Time to create page: 0.378 seconds
Powered by Kunena Forum