PnCConf & Mesact - step/dir spindle issue?

More
19 Jun 2023 20:27 #273871 by spumco
Setting up a step/dir servo spindle using mesact and I wondered how the spindle decel was handled.

Started digging in HAL and the forum, and I found a few posts where people were having issues with the spindle slamming to a halt rather than ramping down.  Seems like they got things sorted out, but I wondered why there was an issue in the first place.

I think I found the underlying issue and it's in PnCConf (and repeated in the mesact utility).  When a step.dir spindle is selected, the internal logic of PnCConf sets up the hal connections like so:
net spindle-enable <= spindle.0.on
net spindle-enable => pid.s.enable
net spindle-enable => stepgen.N.enable

So the spindle on/off output (from gcode, halui, etc) turns off the stepgen enable signal.

However... reading the hostmot2 MAN page on stepgen.N.enable:
This pin enables the step generator instance. When True, the stepgen instance works as expected. When False, no steps are generated and velocity-fb goes immediately to 0. If the stepgen is moving when enable goes False it stops immediately, without obeying the maxaccel limit.

No wonder the spindle slams to a halt.

I think Andy Pugh and PCW helped NoJo out with this here:
forum.linuxcnc.org/10-advanced-configura...-stop-command#205319

Looks like the (or a) solution is to disconnect stepgen enable from spindle.N.on, and connect to machine-on, and let the stepgen remain enabled using the velocity command to ensure 0 rpm.  An alternative would be to disconnect the enable signal once the spindle reaches zero (or near-zero) speed.  Not sure exactly what that would look like in HAL, but I'll throw the idea out there.

Leaving the sstepgen enabled would also make it easy to have a GUI or physical button to 'unlock' the spindle for setups - though this may depend on the drive's internal logic and additional connection(s) to drive-enable signals.  Perhaps a bit too specific for PnCConf...

I wouldn't consider this a bug, as LCNC is behaving as programmed... but whomever maintains or manages PnCConf might want to review the hal connections & logic scheme output by PnCConf & mesact.
 

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

More
19 Jun 2023 20:31 #273872 by spumco
And another thing...

This probably depends on the drive's settings.  If the spindle drive is in velocity mode (internally), then likely the internal decel settings control the behavior.  However, if the drive is in position mode (i.e. someone also wants a C-axis), then the drive interprets the off command as an instant halt.

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

Moderators: cmorley
Time to create page: 0.123 seconds
Powered by Kunena Forum