Ramp out step/dir servo spindle

More
19 Oct 2020 13:52 #186583 by jazial
Hello,

I'm trying to set up a spindle on a mill using a step/dir servo

I've managed to make it ramp in, using but i'm not sure the way to ramp out

Ideally I want M5 to ramp out, waiting for the spindle to deactivate stepgen.
As i need rigid tapping too, it's very confusing for me at this time

Background :
The machine I'm working on was retrofitted with linuxcnc 5 years ago (3 DC servos on axes, 1 three phase servo on spindle, +/- 10 signal for all), and everything goes well till summer 2020 when one DC driver fried both 7i77 and itself and 3 phases driver seems like to be near to death

I've changed every motors and drivers for AC 3 phases servos, tried to make them working with +/- 10v, and then figured that 7i77 didn't count anymore on some encoders inputs (worse, moving MPG on encoder 02 increased encoder 00 counts, so really hard to tune the system)

As I had a 7i76 laying around, I'm trying to redo my config with step/dir signals
I've added a 7i85s to read encoders, but closing loop is not done at this time on axes, I'm just trying to complete it on spindle first.


Thanks

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

More
20 Oct 2020 00:33 - 20 Oct 2020 00:36 #186640 by pippin88
Yes, you need to delay disabling the stepgen output until after spindle has slowed down.

Two ways:
Time delay
Wait until spindle rpm reaches certain level (near 0rpm)

I am currently using a simple time delay:

hal:
####  only code relevant to spindle ramp shown

# --- Spindle accel / decel --- #

loadrt limit3
addf limit3.0 		servo-thread

setp limit3.0.maxv 	[SPINDLE_9]SPINDLE_RAMP
setp limit3.0.enable 	true

net spindle-vel-cmd-rps 	=> 	limit3.0.in
net spindle-output 		<= 	limit3.0.out

net spindle-output     => 	hm2_7i43.0.stepgen.04.velocity-cmd

# --- timedelay before disable spindle output for deceleration ramp --- #
loadrt timedelay 	names=timedelay.spindle-enable-soft-stop
addf 			timedelay.spindle-enable-soft-stop    servo-thread

setp timedelay.spindle-enable-soft-stop.on-delay 	 	[SPINDLE_9]ON_DELAY
setp timedelay.spindle-enable-soft-stop.off-delay 	 	[SPINDLE_9]OFF_DELAY

net spindle-enable          	=> 	timedelay.spindle-enable-soft-stop.in
net spindle-enable-soft-stop	<= 	timedelay.spindle-enable-soft-stop.out
net spindle-enable-soft-stop	=> 	hm2_7i43.0.7i76.0.0.output-09 hm2_7i43.0.stepgen.04.enable


ini:
#********************
# Spindle 
#********************

#only code relevant to spindle ramp shown

SPINDLE_RAMP = 20
ON_DELAY = 0
OFF_DELAY = 5
Last edit: 20 Oct 2020 00:36 by pippin88.
The following user(s) said Thank You: partec, jazial

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

Time to create page: 0.072 seconds
Powered by Kunena Forum