Best practice for spindle accelerating/decelerating in velocity mode

More
24 Jan 2024 06:59 #291495 by Gnevko
Hi people!

what is the best practice for accelerating (and more importantly, decelerating) the hm2 (MESA card 7i95) stepgen in velocity mode?

I ask because I found a parameter like this - hm2_7i95.0.stepgen.05.maxaccel - but it works a little bit strange: 
1) if I want to change spindle speed from 0 to 1000rpm - acceleration from stepgen works fine without problem (m3 S1000).
2) if I want to change spindle speed from 1000rpm to 1rpm - deceleration works also fine without problem (M3 S1000 then S1).
3) but if I want to change spindle speed from 1000rpm to 0rpm - the spindle stops immediately without any deceleration (M3 S1000 then S0).

Thank you in advance!
setp   hm2_7i95.0.stepgen.05.dirsetup        [SPINDLE_0]DIRSETUP
setp   hm2_7i95.0.stepgen.05.dirhold         [SPINDLE_0]DIRHOLD
setp   hm2_7i95.0.stepgen.05.steplen         [SPINDLE_0]STEPLEN
setp   hm2_7i95.0.stepgen.05.stepspace       [SPINDLE_0]STEPSPACE
setp   hm2_7i95.0.stepgen.05.position-scale  [SPINDLE_0]OUTPUT_SCALE
setp   hm2_7i95.0.stepgen.05.step_type        0 #0 = Step/Dir
setp   hm2_7i95.0.stepgen.05.control-type     1 #1 = velocity control mode
setp   hm2_7i95.0.stepgen.05.maxaccel        [SPINDLE_0]STEPGEN_MAXACCEL
setp   hm2_7i95.0.stepgen.05.maxvel          [SPINDLE_0]STEPGEN_MAXVEL
 

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

More
24 Jan 2024 12:36 #291511 by spumco
Because when you set spindle speed to 0, the stepgen turns off.  This results in your drive seeing an immediate command and thus no ramp-down.

The problem is caused by your stepgen.N.enable pin being connected to some pin (likley spindle.N.on) that shuts off when the spindle is turned off. 

This issue has been reported on GitHub, and I believe PnCconf has been (or is going to be) changed so the stepgen spindle connections are more appropriate.  Same with Mesact.

Try connecting stepgen enable to something like machine-is-on.  The stepgen will remain enabled during the desired ramp-down and that's when you can start seeing a changed with max_accel value tuning.
The following user(s) said Thank You: besriworld, Gnevko

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

Time to create page: 0.067 seconds
Powered by Kunena Forum