- Configuring LinuxCNC
- Basic Configuration
- Can't get lathe closed loop servo spindle working (torque mode servo)
Can't get lathe closed loop servo spindle working (torque mode servo)
14 Aug 2020 13:38 #178185
by pippin88
Before I go and spend a lot of $$$ to just replace all these parts, I'm hoping someone can help solve the issue.
I cannot get a torque mode servo spindle to function properly.
I have a 750W brushed DC servo and a Copley 422 servo drive. No tachometer, so it has to be torque mode.
Setup:
7i76 Spindle out - GND to -, 12V to + and Spinout going to servo amplifier
Servo amplifier - Copley 422 in torque mode
What happens:
Spindle gets to commanded speed but is weak and stalls easily.
For example, I command 20rpm - it will hover around 20rpm. However, I can stall the spindle by hand easily. Motor current (measured with ammeter) only gets to ~2 amps before it gives up.
Spindle out voltage from 7i76 will be fairly stable, e.g. ~0.25V, without load. When I stall the spindle, the spindle out voltage will rise briefly to ~3.8V and then fall right back down.
The system makes some attempt at overcoming resistance but then just gives up.
I have tried a lot of different things.
I've tried many different PID/FF values. These change the stiffness and smoothness of the spindle a bit but don't change the overall behaviour.
I've tried setting
P=0
I=0
D=0
FF0=1
- this results in no spindle motion
Full .hal and .ini are attached.
I cannot get a torque mode servo spindle to function properly.
I have a 750W brushed DC servo and a Copley 422 servo drive. No tachometer, so it has to be torque mode.
Setup:
7i76 Spindle out - GND to -, 12V to + and Spinout going to servo amplifier
Servo amplifier - Copley 422 in torque mode
What happens:
Spindle gets to commanded speed but is weak and stalls easily.
For example, I command 20rpm - it will hover around 20rpm. However, I can stall the spindle by hand easily. Motor current (measured with ammeter) only gets to ~2 amps before it gives up.
Spindle out voltage from 7i76 will be fairly stable, e.g. ~0.25V, without load. When I stall the spindle, the spindle out voltage will rise briefly to ~3.8V and then fall right back down.
The system makes some attempt at overcoming resistance but then just gives up.
I have tried a lot of different things.
I've tried many different PID/FF values. These change the stiffness and smoothness of the spindle a bit but don't change the overall behaviour.
I've tried setting
P=0
I=0
D=0
FF0=1
- this results in no spindle motion
Full .hal and .ini are attached.
#*******************
# SPINDLE S
#*******************
loadrt abs names=abs.spindle
loadrt lowpass names=lowpass.spindle
addf abs.spindle servo-thread
addf lowpass.spindle servo-thread
setp pid.s.Pgain [SPINDLE_9]P
setp pid.s.Igain [SPINDLE_9]I
setp pid.s.Dgain [SPINDLE_9]D
setp pid.s.bias [SPINDLE_9]BIAS
setp pid.s.FF0 [SPINDLE_9]FF0
setp pid.s.FF1 [SPINDLE_9]FF1
setp pid.s.FF2 [SPINDLE_9]FF2
setp pid.s.deadband [SPINDLE_9]DEADBAND
setp pid.s.maxerror [SPINDLE_9]MAX_ERROR
setp pid.s.maxoutput [SPINDLE_9]MAX_OUTPUT
setp pid.s.error-previous-target true
net spindle-index-enable <=> pid.s.index-enable
net spindle-enable => pid.s.enable
net spindle-vel-cmd-rpm-abs => pid.s.command
net spindle-vel-fb-rpm-abs => pid.s.feedback
net spindle-output <= pid.s.output
# ---digital potentionmeter output signals/setup---
setp hm2_7i43.0.7i76.0.0.spinout-minlim [SPINDLE_9]OUTPUT_MIN_LIMIT
setp hm2_7i43.0.7i76.0.0.spinout-maxlim [SPINDLE_9]OUTPUT_MAX_LIMIT
setp hm2_7i43.0.7i76.0.0.spinout-scalemax [SPINDLE_9]OUTPUT_SCALE
net spindle-output => hm2_7i43.0.7i76.0.0.spinout
#set the spindle enable off at startup
setp hm2_7i43.0.7i76.0.0.output-09 false
net spindle-enable => hm2_7i43.0.7i76.0.0.output-09
net spindle-enable => hm2_7i43.0.7i76.0.0.spinena
setp hm2_7i43.0.7i76.0.0.spindir-invert false
net spindle-cw => hm2_7i43.0.7i76.0.0.spindir
# ---Encoder feedback signals/setup---
setp hm2_7i43.0.encoder.00.counter-mode 0
setp hm2_7i43.0.encoder.00.filter 1
setp hm2_7i43.0.encoder.00.index-invert 0
setp hm2_7i43.0.encoder.00.index-mask 0
setp hm2_7i43.0.encoder.00.index-mask-invert 0
setp hm2_7i43.0.encoder.00.scale [SPINDLE_9]ENCODER_SCALE
net spindle-revs <= hm2_7i43.0.encoder.00.position
net spindle-vel-fb-rps <= hm2_7i43.0.encoder.00.velocity
net spindle-index-enable <=> hm2_7i43.0.encoder.00.index-enable
setp scale.spindle.gain 60
net spindle-vel-fb-rps => scale.spindle.in
net spindle-vel-fb-rpm <= scale.spindle.out
net spindle-vel-fb-rpm => abs.spindle.in
net spindle-vel-fb-rpm-abs <= abs.spindle.out
# ---setup spindle control signals---
net spindle-vel-cmd-rps <= spindle.0.speed-out-rps
net spindle-vel-cmd-rps-abs <= spindle.0.speed-out-rps-abs
net spindle-vel-cmd-rpm <= spindle.0.speed-out
net spindle-vel-cmd-rpm-abs <= spindle.0.speed-out-abs
net spindle-enable <= spindle.0.on
net spindle-cw <= spindle.0.forward
net spindle-ccw <= spindle.0.reverse
net spindle-brake <= spindle.0.brake
net spindle-revs => spindle.0.revs
net spindle-at-speed => spindle.0.at-speed
net spindle-vel-fb-rps => spindle.0.speed-in
net spindle-index-enable <=> spindle.0.index-enable
# ---Setup spindle at speed signals---
net spindle-vel-cmd-rps => near.spindle.in1 #commanded speed in rps
net spindle-vel-fb-rps => near.spindle.in2 #real speed in rps
net spindle-at-speed <= near.spindle.out
setp near.spindle.scale 1.05 #spindle at speed if within 5%
#setp near.spindle.difference 3.333333 #spindle at speed if within 200rpm (specified in RPS)
#********************
# Spindle
#********************
[SPINDLE_9]
P = 50.0
#P = 0.0
#I = 0.0
I = 5.0
D = 0.0
#D = 5.0
FF0 = 1.0
FF1 = 0.0
FF2 = 0.0
BIAS = 0.0
DEADBAND = 0.0
MAX_ERROR = 0
# MAX_OUTPUT is 11.65V - therefore scale by 11.65*4500/10
MAX_OUTPUT = 4500
ENCODER_SCALE = 2048.0
OUTPUT_SCALE = 4500
OUTPUT_MIN_LIMIT = 0
OUTPUT_MAX_LIMIT = 2700
Please Log in or Create an account to join the conversation.
14 Aug 2020 14:24 - 14 Aug 2020 14:25 #178187
by PCW
Replied by PCW on topic Can't get lathe closed loop servo spindle working (torque mode servo)
in your ini file
OUTPUT_SCALE = 4500
and
OUTPUT_MAX_LIMIT = 2700
will limit the maximum _torque_
Also
This might result in no spindle motion at low commanded speeds
but must work at higher commanded speeds (since you are not setting
speed but torque and full velocity will command full torque)
If the drive is working in torque mode, FF0 is not appropriate because it will
apply a torque proportional to commanded spindle speed. A simple single PID
control for velocity command and feedback and torque output would normally be
a P+I only PID with perhaps a bit of FF1 to compensate for spindle inertia.
You might want to verify that you can get the full output swing with the drive disabled.
in this case the integral term should eventually saturate the output if the feedback does not
match the command.
OUTPUT_SCALE = 4500
and
OUTPUT_MAX_LIMIT = 2700
will limit the maximum _torque_
Also
I've tried setting
P=0
I=0
D=0
FF0=1
- this results in no spindle motion
This might result in no spindle motion at low commanded speeds
but must work at higher commanded speeds (since you are not setting
speed but torque and full velocity will command full torque)
If the drive is working in torque mode, FF0 is not appropriate because it will
apply a torque proportional to commanded spindle speed. A simple single PID
control for velocity command and feedback and torque output would normally be
a P+I only PID with perhaps a bit of FF1 to compensate for spindle inertia.
You might want to verify that you can get the full output swing with the drive disabled.
in this case the integral term should eventually saturate the output if the feedback does not
match the command.
Last edit: 14 Aug 2020 14:25 by PCW.
Please Log in or Create an account to join the conversation.
15 Aug 2020 00:48 - 15 Aug 2020 00:50 #178217
by pippin88
Replied by pippin88 on topic Can't get lathe closed loop servo spindle working (torque mode servo)
Thanks for the reply PCW.
I can now see why those settings were not appropriate for torque mode.
I've now set the scales properly.
MAX_OUTPUT = 12
OUTPUT_SCALE = 12
OUTPUT_MIN_LIMIT = 0
OUTPUT_MAX_LIMIT = 10
(scales in volts).
This results in 10V on 7i76 Spindle Out when ramping up to speed fast or when I stall the spindle.
So spindle out behaviour is now as expected.
However the spindle is still very weak at low speeds, easily stalled by hand.
The motor current only gets to ~1-2 amps when I stall the spindle at slow speeds.
Shouldn't the servo amp go right up to max current? It goes to to ~5-6amps when at spindle speed 2500.
I don't understand why it won't put out more amps at lower speed despite being the input being 10V. If I change the amplifier mode it causes the spindle to run away (as expected because I have no tach connected).
I can now see why those settings were not appropriate for torque mode.
I've now set the scales properly.
MAX_OUTPUT = 12
OUTPUT_SCALE = 12
OUTPUT_MIN_LIMIT = 0
OUTPUT_MAX_LIMIT = 10
(scales in volts).
This results in 10V on 7i76 Spindle Out when ramping up to speed fast or when I stall the spindle.
So spindle out behaviour is now as expected.
However the spindle is still very weak at low speeds, easily stalled by hand.
The motor current only gets to ~1-2 amps when I stall the spindle at slow speeds.
Shouldn't the servo amp go right up to max current? It goes to to ~5-6amps when at spindle speed 2500.
I don't understand why it won't put out more amps at lower speed despite being the input being 10V. If I change the amplifier mode it causes the spindle to run away (as expected because I have no tach connected).
Last edit: 15 Aug 2020 00:50 by pippin88.
Please Log in or Create an account to join the conversation.
- Mike_Eitel
- Offline
- Platinum Member
Less
More
- Posts: 1150
- Thank you received: 184
15 Aug 2020 13:45 - 15 Aug 2020 13:45 #178276
by Mike_Eitel
Replied by Mike_Eitel on topic Can't get lathe closed loop servo spindle working (torque mode servo)
Are you sure that you measure the current correct? I would gues at those low back-emv voltages you have a short pwm on the motor. Depending how your driver works. Try to control via oscilloscope if your "measure" is correct.
Mike
Mike
Last edit: 15 Aug 2020 13:45 by Mike_Eitel.
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 19209
- Thank you received: 6438
15 Aug 2020 14:52 #178290
by tommylight
Replied by tommylight on topic Can't get lathe closed loop servo spindle working (torque mode servo)
Check the minimum RPM the drive and the motor can do, 25RPM is to low for any normal spindle.
Please Log in or Create an account to join the conversation.
16 Aug 2020 00:31 #178339
by pippin88
Replied by pippin88 on topic Can't get lathe closed loop servo spindle working (torque mode servo)
Mike_Eitel: I'm measuring current with a DC analog ammeter in line with the DC power supply to the Copley drive. It's on the supply side to the drive, not on the motor side.
I don't have an oscilloscope unforunately.
tommylight: It's a brushed DC servo motor and a dedicated servo amplifier. It certainly should be able to do low RPM.
It seems weak to me at higher RPM also - it doesn't seem to increase the amp output. I tried the motor with a cheap DC motor driver (6-90V 15amp driver) and it seemed to have more grunt. However that $10 driver died fairly quickly.
I don't understand why it's not drawing full amps when the input to the drive is +10V.
I don't have an oscilloscope unforunately.
tommylight: It's a brushed DC servo motor and a dedicated servo amplifier. It certainly should be able to do low RPM.
It seems weak to me at higher RPM also - it doesn't seem to increase the amp output. I tried the motor with a cheap DC motor driver (6-90V 15amp driver) and it seemed to have more grunt. However that $10 driver died fairly quickly.
I don't understand why it's not drawing full amps when the input to the drive is +10V.
Please Log in or Create an account to join the conversation.
16 Aug 2020 01:45 - 16 Aug 2020 01:46 #178343
by PCW
Replied by PCW on topic Can't get lathe closed loop servo spindle working (torque mode servo)
The DC supply side current will be low even at full torque when the spindle speed is low
This is because the drive functions as a step down switching regulator and at low speeds
there is little motor Back EMF so the actual average motor voltage may only be 20V or so.
The means that if you have a 120V power supply 2A at 120V = ~10A at the motor
You would really need to measure the current at the motor to see if the drive is doing
the right thing.
NOTE! this is quite difficult to do without an isolated current sense device like a hall effect sensor,
do not attempt to do this with a DVM
This is because the drive functions as a step down switching regulator and at low speeds
there is little motor Back EMF so the actual average motor voltage may only be 20V or so.
The means that if you have a 120V power supply 2A at 120V = ~10A at the motor
You would really need to measure the current at the motor to see if the drive is doing
the right thing.
NOTE! this is quite difficult to do without an isolated current sense device like a hall effect sensor,
do not attempt to do this with a DVM
Last edit: 16 Aug 2020 01:46 by PCW.
Please Log in or Create an account to join the conversation.
16 Aug 2020 02:44 - 16 Aug 2020 03:08 #178345
by pippin88
Replied by pippin88 on topic Can't get lathe closed loop servo spindle working (torque mode servo)
PCW, thanks. The output voltage to the motor is lower at slow speeds as measured by a multimeter.
I forgot to post the motor specs:
Frame Size Nema34
Constant Torque 170 oz/in – 1.2 N.M
Peak Torque 840 oz/in – 6.0 N.M
Continuous Current 7.8 Amp
Peak Current 40 Amp
Maximum Speed 4500 RPM ±10 % AT 72V
2750 RPM ±10 % AT 50V
Resistance 0.983 ohm
Inductance 1.435 mh
Terminal Voltage 72 VDC
Should I be expecting more performance?
Easy to stop by hand at low RPM (applying friction to a lathe chuck).
Servo pulley 18 teeth, spindle pulley 30 teeth.
Power supply is an unregulated toroidal transformer with nominal 70V output, but seems to be closer to 67V output.
Could the motor have been damaged / overheated and cause weak performance?
I got it second hand.
I forgot to post the motor specs:
Frame Size Nema34
Constant Torque 170 oz/in – 1.2 N.M
Peak Torque 840 oz/in – 6.0 N.M
Continuous Current 7.8 Amp
Peak Current 40 Amp
Maximum Speed 4500 RPM ±10 % AT 72V
2750 RPM ±10 % AT 50V
Resistance 0.983 ohm
Inductance 1.435 mh
Terminal Voltage 72 VDC
Should I be expecting more performance?
Easy to stop by hand at low RPM (applying friction to a lathe chuck).
Servo pulley 18 teeth, spindle pulley 30 teeth.
Power supply is an unregulated toroidal transformer with nominal 70V output, but seems to be closer to 67V output.
Could the motor have been damaged / overheated and cause weak performance?
I got it second hand.
Last edit: 16 Aug 2020 03:08 by pippin88.
Please Log in or Create an account to join the conversation.
- Configuring LinuxCNC
- Basic Configuration
- Can't get lathe closed loop servo spindle working (torque mode servo)
Time to create page: 0.197 seconds