Hello Guest it is May 26, 2019, 09:50:29 PM

Author Topic: Step/dir + ESS spindle acceleration/deceleration  (Read 2669 times)

0 Members and 1 Guest are viewing this topic.

Step/dir + ESS spindle acceleration/deceleration
« on: July 21, 2013, 03:06:54 PM »
Hi

The DC servo driver for my spindle motor does not not have configurable acceleration/deceleration ramp. I guess the original CNC system of my machine took care of the ramping.

I am now converting to Mach3 + Ethernet Smoothstepper + cnc4pc C23 breakout board. The analog out is configured as step/dir (as needed for the C23) in the ESS config. When starting/stopping the spindle, the level of the analog out is changed instantly causing the driver to try to accelerate/deceperate the spindle almost infinitely fast. When stopping the spindle (or decreasing the speed a lot), this fast deceleration causes the driver to trip due to overvoltage (the spindle motor now "produces" current instead of "drawing").

I have tried to slow down the acceleration by adding a 2nd order low pass filter between the analog out of the C23 board and the analog in on the driver, and this would probably work if I fiddle enough with the values. A better solution though, would be if I could just set a suitable accceleration/deceleration (preferably in rpm/s) in Mach3.

There is another solution, and that would be to simply disable the spindle driver letting the spindle coast to a stop when a "spindle off" command is issued. I don't really like this solution, and I would still have problems with overvoltage when decreasing from high speed to low speed without stopping the spindle.

I have looked everywhere in Mach3 but can not find any setting for this. Is there any way of achieving this, or should I maybe place a request for the next update of Mach3? :)

I'm running Mach3 v 3.043.062.
Why do it the easy way?

One of my other projects:
http://svarthaletracing.se
Re: Step/dir + ESS spindle acceleration/deceleration
« Reply #1 on: July 21, 2013, 04:07:08 PM »
I just found some new info about setting up Mach 3 + ESS for step/dir spindle control.
I thought up til now that the settings under "motor tuning" had no impact on speed/acceleration when using the ESS, but apparently they do.

The notes I have made now are:
Motor tuning
Velocity: 60
Steps per (max step frequency): As high as possible. For example 25kHz
Acceleration: As required

ESS Config
Check step/dir mode
Set pulse length to 1/"steps per" (40 us for 25kHz)

Maybe this will work. I do not remember what values I have been using but I think they are not even close to these. With the values I used before, I could not get a relatively low acceleration/deceleration because I could not set the "Acceleration" parameter under motor tuning low enough.
Why do it the easy way?

One of my other projects:
http://svarthaletracing.se
Re: Step/dir + ESS spindle acceleration/deceleration
« Reply #2 on: July 23, 2013, 05:31:59 PM »
So...
After even more tests I have found out that it is impossible to set low enough acceleration values in the "Motor tuning" dialog. If I set a really low value, it will be changed to a much higher one as soon as I focus on another textbox or click Save.

The only way to get it working is to edit the XML file manually. There I can enter any value I want, and get the spindle to accelerate from 0 to 5000rpm in about 5 secs. Actually, as I mentioned, the acceleration is not a problem but I need long enough deceleration not to cause overvoltage in the driver. Since there are no separate settings for acceleration/deceleration the acceleration will be a lot longer than necessary. Not a big deal...
Why do it the easy way?

One of my other projects:
http://svarthaletracing.se