Driver NUM GEC MK2S
20 Aug 2024 18:43 #308237
by PCW
Replied by PCW on topic Driver NUM GEC MK2S
There is a bug in MesaCT that does not connect the PID output
to the PWM value pin. You could try updating to the latest
MesaCT or patch the hal file.
Check out this thread:
forum.linuxcnc.org/49-basic-configuration/53561-7i97t-retrofit
to the PWM value pin. You could try updating to the latest
MesaCT or patch the hal file.
Check out this thread:
forum.linuxcnc.org/49-basic-configuration/53561-7i97t-retrofit
Please Log in or Create an account to join the conversation.
21 Aug 2024 09:34 - 21 Aug 2024 10:06 #308274
by greg23_78
Replied by greg23_78 on topic Driver NUM GEC MK2S
indeed it was missing
net joint.0.output => hm2_[MESA](BOARD).0.pwmgen.00.value
and I made the change, but my drivers still don't jog.
I tried my drivers by applying a DC power supply to my analog input (driver) and the driver works correctly.
HAL
INI
I have another question: what does [JOINT_1]SCALE correspond to, since we can see that the signal is scaled in relation to this variable?
SCALE = 1
setp hm2_[MESA](BOARD).0.pwmgen.00.scale [JOINT_0]SCALE
but what's the point of the
ANALOG_SCALE_MAX = 10
ANALOG_MIN_LIMIT = -10
ANALOG_MAX_LIMIT = 10
MAX_OUTPUT = 10
net joint.0.output => hm2_[MESA](BOARD).0.pwmgen.00.value
and I made the change, but my drivers still don't jog.
I tried my drivers by applying a DC power supply to my analog input (driver) and the driver works correctly.
HAL
# Axis: Z Joint: 1 Output: 1
# PID Setup
setp pid.z.Pgain [JOINT_1](P)
setp pid.z.Igain [JOINT_1](I)
setp pid.z.Dgain [JOINT_1](D)
setp pid.z.bias [JOINT_1](BIAS)
setp pid.z.FF0 [JOINT_1](FF0)
setp pid.z.FF1 [JOINT_1](FF1)
setp pid.z.FF2 [JOINT_1](FF2)
setp pid.z.deadband [JOINT_1](DEADBAND)
setp pid.z.maxoutput [JOINT_1](MAX_OUTPUT)
setp pid.z.error-previous-target True
# joint-1 enable chain
net joint-1-index-enable <=> pid.z.index-enable
net joint-1-index-enable <=> joint.1.index-enable
net joint-1-index-enable <=> hm2_[MESA](BOARD).0.encoder.01.index-enable
net joint-1-enable <= joint.1.amp-enable-out
net joint-1-enable => pid.z.enable
# PWM Generator setup
setp hm2_[MESA](BOARD).0.pwmgen.01.dither true
setp hm2_[MESA](BOARD).0.pwmgen.01.output-type 1 #PWM pin0
setp hm2_[MESA](BOARD).0.pwmgen.01.offset-mode 1 # offset mode so 50% = 0
setp hm2_[MESA](BOARD).0.pwmgen.01.scale [JOINT_1]SCALE
# ---Encoder feedback signals/setup---
setp hm2_[MESA](BOARD).0.encoder.01.counter-mode 0
setp hm2_[MESA](BOARD).0.encoder.01.filter 1
setp hm2_[MESA](BOARD).0.encoder.01.index-invert 0
setp hm2_[MESA](BOARD).0.encoder.01.index-mask 0
setp hm2_[MESA](BOARD).0.encoder.01.index-mask-invert 0
setp hm2_[MESA](BOARD).0.encoder.01.scale [JOINT_1]ENCODER_SCALE
# position command and feedback
net joint-1-pos-cmd <= joint.1.motor-pos-cmd
net joint-1-pos-cmd => pid.z.command
net joint-1-pos-fb <= hm2_[MESA](BOARD).0.encoder.01.position
net joint-1-pos-fb => joint.1.motor-pos-fb
net joint-1-pos-fb => pid.z.feedback
net joint.1.output <= pid.z.output
net joint.1.output => hm2_[MESA](BOARD).0.pwmgen.01.value
# Encoder Setup
setp hm2_[MESA](BOARD).0.encoder.01.scale [JOINT_1](ENCODER_SCALE)
setp hm2_[MESA](BOARD).0.encoder.01.counter-mode 0
setp hm2_[MESA](BOARD).0.encoder.01.filter 1
setp hm2_[MESA](BOARD).0.encoder.01.index-invert 0
setp hm2_[MESA](BOARD).0.encoder.01.index-mask 0
setp hm2_[MESA](BOARD).0.encoder.01.index-mask-invert 0
INI
[AXIS_Z]
MIN_LIMIT = 0
MAX_LIMIT = 1000
MAX_VELOCITY = 333.333
MAX_ACCELERATION = 400
[JOINT_1]
CARD = 0
TAB = 1
AXIS = Z
MIN_LIMIT = 0
MAX_LIMIT = 1000
MAX_VELOCITY = 333.333
MAX_ACCELERATION = 400
TYPE = LINEAR
SCALE = 1
ANALOG_SCALE_MAX = 10
ANALOG_MIN_LIMIT = -10
ANALOG_MAX_LIMIT = 10
ENCODER_SCALE = 1000
FERROR = 10000
MIN_FERROR = 1000
DEADBAND = 0
P = 1
I = 0
D = 0
FF0 = 0
FF1 = 0
FF2 = 0
BIAS = 0
MAX_OUTPUT = 10
MAX_ERROR = 0.0127
HOME = 10
HOME_OFFSET = 0
HOME_SEARCH_VEL = 5
HOME_LATCH_VEL = 0.5
HOME_FINAL_VEL = 20
HOME_SEQUENCE = 1
HOME_USE_INDEX = True
SCALE = 1
setp hm2_[MESA](BOARD).0.pwmgen.00.scale [JOINT_0]SCALE
but what's the point of the
ANALOG_SCALE_MAX = 10
ANALOG_MIN_LIMIT = -10
ANALOG_MAX_LIMIT = 10
MAX_OUTPUT = 10
Attachments:
Last edit: 21 Aug 2024 10:06 by greg23_78.
Please Log in or Create an account to join the conversation.
21 Aug 2024 14:07 #308290
by PCW
Replied by PCW on topic Driver NUM GEC MK2S
Looks like the PWM enables are missing also:
net joint-1-enable <= joint.1.amp-enable-out
net joint-1-enable => pid.z.enable
net joint-1-enable => hm2_[MESA](BOARD).0.pwmgen.01.enable
net joint-1-enable <= joint.1.amp-enable-out
net joint-1-enable => pid.z.enable
net joint-1-enable => hm2_[MESA](BOARD).0.pwmgen.01.enable
Please Log in or Create an account to join the conversation.
21 Aug 2024 15:31 #308304
by greg23_78
Replied by greg23_78 on topic Driver NUM GEC MK2S
thank you, I hadn't noticed that was missing.
now, when activating the drivers, the motor goes into Z+ at high speed.
now, when activating the drivers, the motor goes into Z+ at high speed.
Please Log in or Create an account to join the conversation.
21 Aug 2024 15:44 - 21 Aug 2024 15:45 #308307
by PCW
Replied by PCW on topic Driver NUM GEC MK2S
That's probably expected.
You have about a 50% chance of an initial
runaway because the feedback direction is
wrong, that is you have positive feedback = runaway
rather than negative feedback = position control.
If the encoder direction is correct, you fix this by
changing the sign of the PWM scale.
You have about a 50% chance of an initial
runaway because the feedback direction is
wrong, that is you have positive feedback = runaway
rather than negative feedback = position control.
If the encoder direction is correct, you fix this by
changing the sign of the PWM scale.
Last edit: 21 Aug 2024 15:45 by PCW.
Please Log in or Create an account to join the conversation.
22 Aug 2024 13:59 #308398
by greg23_78
Replied by greg23_78 on topic Driver NUM GEC MK2S
I changed the output-scale sign and now it works.
I've tried tuning my motor but I can't get it to work properly.
I find it strange that my motor remains stable when I activate my drivers with a P of 0.1. Above that, when I activate the motor, it races and oscillates.
After several searches, I find the same behavior as H bridge drives running PM DC motors.
I actually have a PM DC motor
I came across your procedure
and that of IRAK
forum.linuxcnc.org/10-advanced-configura...ge-tuning-servo-loop
What procedure should I follow for my driver and motor?
In the IRAK procedure, it says “Set P to low value - about 1/4 any possible oscillation.” oscillation when enable the drive or i jog? because when I set P to 0.9 sometimes the axis oscillates and sometimes it remains stable (I'm not talking about jog because in all cases it oscillates even before P=0.2).
then as I understand it I need to “Set OUTPUT_SCALE to encoder.N.velocity” to know maximum speed the table (I presume I need to look at the speed through the encoder).
How do you do “Set OUTPUT_SCALE to encoder.N.velocity”?
I've tried tuning my motor but I can't get it to work properly.
I find it strange that my motor remains stable when I activate my drivers with a P of 0.1. Above that, when I activate the motor, it races and oscillates.
After several searches, I find the same behavior as H bridge drives running PM DC motors.
I actually have a PM DC motor
I came across your procedure
Blatantly copied and pasted from a post made by PCW regarding H bridge drives:
Bare H-bridge drives running PM DC motors behave somewhat like velocity mode servos
(with quite low velocity feedback gain) So they end up being somewhere between velocity
and torque mode.
That is, you are setting the average motor drive voltage with the PWM value. This sets the
approximate motor velocity because the motor will accelerate to a velocity where the generated
back EMF is close to the supplied voltage. If the motor impedance was zero, you would have close
to a perfect velocity mode servo, but the impedance is substantial which leads to the low
inherent feedback gain.
Normally for Hbridges, I would start with a low P value and tune the D term as high as
possible without excessive buzzyness, then set FF1 so that the actual position does
not lead or lag the commanded position at full speed, then I would tune FF2 so that
the actual position does not lead or lag the commanded position during acceleration
Then I would tune P as high as possible without oscillation, overshoot and then when
everything else is close, add as much I term as possible without instability.
Thank you, PCW.
Please feel free to voice your advice, critique, additional info etc.
and that of IRAK
forum.linuxcnc.org/10-advanced-configura...ge-tuning-servo-loop
What procedure should I follow for my driver and motor?
In the IRAK procedure, it says “Set P to low value - about 1/4 any possible oscillation.” oscillation when enable the drive or i jog? because when I set P to 0.9 sometimes the axis oscillates and sometimes it remains stable (I'm not talking about jog because in all cases it oscillates even before P=0.2).
then as I understand it I need to “Set OUTPUT_SCALE to encoder.N.velocity” to know maximum speed the table (I presume I need to look at the speed through the encoder).
How do you do “Set OUTPUT_SCALE to encoder.N.velocity”?
Please Log in or Create an account to join the conversation.
22 Aug 2024 14:50 #308402
by PCW
Replied by PCW on topic Driver NUM GEC MK2S
1. If you have new drives, the drives themselves likely need
to be tuned first. This includes scaling the tachometer feedback
so you get full speed at 10V. It also means adjusting the drives
velocity loop gain as high as possible while remaining stable.
2. Since these are velocity drives, you should use a velocity mode
tuning guide. Note that for properly tuned velocity mode drives,
the most important LinuxCNC PID term is FF1.
3. As far as output scaling goes, setting the output scale to the machine
units per second of axis velocity at 10V, means that now all PID terms
are normalized to engineering units, and FF1 == 1.0. This also makes
it easier to compare setups.
to be tuned first. This includes scaling the tachometer feedback
so you get full speed at 10V. It also means adjusting the drives
velocity loop gain as high as possible while remaining stable.
2. Since these are velocity drives, you should use a velocity mode
tuning guide. Note that for properly tuned velocity mode drives,
the most important LinuxCNC PID term is FF1.
3. As far as output scaling goes, setting the output scale to the machine
units per second of axis velocity at 10V, means that now all PID terms
are normalized to engineering units, and FF1 == 1.0. This also makes
it easier to compare setups.
Please Log in or Create an account to join the conversation.
22 Aug 2024 15:09 - 22 Aug 2024 15:10 #308404
by greg23_78
Replied by greg23_78 on topic Driver NUM GEC MK2S
it's not news, but I prefer to control it.
if i understand correctly, i have just mechanically disconnected my motor from my Z axis.
i put 10V on the drive and control the speed with a tachometer ?
but how adjusting the drives velocity loop gain as high as possible while remaining stable ?
which button should I modify ?
-Zero offset
-Speed stability
-current limit
-Reference input
if i understand correctly, i have just mechanically disconnected my motor from my Z axis.
i put 10V on the drive and control the speed with a tachometer ?
but how adjusting the drives velocity loop gain as high as possible while remaining stable ?
which button should I modify ?
-Zero offset
-Speed stability
-current limit
-Reference input
Last edit: 22 Aug 2024 15:10 by greg23_78.
Please Log in or Create an account to join the conversation.
22 Aug 2024 15:29 #308405
by PCW
Replied by PCW on topic Driver NUM GEC MK2S
Is there a tachometer from the motor connected to the drive?
Please Log in or Create an account to join the conversation.
22 Aug 2024 15:47 #308407
by greg23_78
Replied by greg23_78 on topic Driver NUM GEC MK2S
yes, the tachometer is connected to the motor.
i wanted to talk about a laser tachometer to measure speed because my encoder is no longer connected to the motor.
I've just put 10V into the analog input and the motor is running correctly.
i wanted to talk about a laser tachometer to measure speed because my encoder is no longer connected to the motor.
I've just put 10V into the analog input and the motor is running correctly.
Please Log in or Create an account to join the conversation.
Time to create page: 0.112 seconds