Once again two servo's on one axis issues
29 Oct 2016 15:39 - 29 Oct 2016 15:40 #82233
by bevins
Once again two servo's on one axis issues was created by bevins
I am having a bit of a time trying to get a simple gantry machine with servos working correctly. I dont want to use trivkins until JA gets released with next version.
I dont want to use homing so should be simple but I cant get encoder signals into the slaved axis. IT works but the slave axis doesnt get error correction and eventually get f error.
Here is the relative clipped portion of the hal.
#*******************
# AXIS Y
#*******************
setp pid.y.FF0 [AXIS_1]FF0
setp pid.y.FF1 [AXIS_1]FF1
setp pid.y.FF2 [AXIS_1]FF2
setp pid.y.deadband [AXIS_1]DEADBAND
setp pid.y.maxoutput [AXIS_1]MAX_OUTPUT
net y-index-enable <=> pid.y.index-enable axis.1.index-enable <=> hm2_5i25.0.encoder.01.index-enable
net y-enable => pid.y.enable axis.1.amp-enable-out
net y-output => pid.y.output => hm2_5i25.0.7i77.0.1.analogout1
net y-pos-cmd => axis.1.motor-pos-cmd pid.y.command pid.a.command
net y-pos-fb <= hm2_5i25.0.encoder.01.position => pid.y.feedback => axis.1.motor-pos-fb
net y-vel-fb <= hm2_5i25.0.encoder.01.velocity => pid.y.feedback-deriv
net y-pos-rawcounts <= hm2_5i25.0.encoder.01.rawcounts
# ---PWM Generator signals/setup---
setp hm2_5i25.0.7i77.0.1.analogout1-scalemax [AXIS_1]OUTPUT_SCALE
setp hm2_5i25.0.7i77.0.1.analogout1-minlim [AXIS_1]OUTPUT_MIN_LIMIT
setp hm2_5i25.0.7i77.0.1.analogout1-maxlim [AXIS_1]OUTPUT_MAX_LIMIT
# ---Encoder feedback signals/setup---
setp hm2_5i25.0.encoder.01.counter-mode 0
setp hm2_5i25.0.encoder.01.filter 1
setp hm2_5i25.0.encoder.01.index-invert 0
setp hm2_5i25.0.encoder.01.index-mask 0
setp hm2_5i25.0.encoder.01.index-mask-invert 0
setp hm2_5i25.0.encoder.01.scale [AXIS_1]ENCODER_SCALE
#*******************
# AXIS A
#*******************
net a-index-enable <=> pid.a.index-enable axis.3.index-enable <=> hm2_5i25.0.encoder.03.index-enable
net a-enable => pid.a.enable axis.3.amp-enable-out
net a-output => pid.a.output => hm2_5i25.0.7i77.0.1.analogout3
net a-pos-cmd => axis.3.motor-pos-cmd
net a-pos-fb <= hm2_5i25.0.encoder.03.position => pid.a.feedback => axis.3.motor-pos-fb
net a-vel-fb <= hm2_5i25.0.encoder.03.velocity => pid.a.feedback-deriv
net a-pos-rawcounts <= hm2_5i25.0.encoder.03.rawcounts
# ---PWM Generator signals/setup---
setp hm2_5i25.0.7i77.0.1.analogout3-scalemax [AXIS_3]OUTPUT_SCALE
setp hm2_5i25.0.7i77.0.1.analogout3-minlim [AXIS_3]OUTPUT_MIN_LIMIT
setp hm2_5i25.0.7i77.0.1.analogout3-maxlim [AXIS_3]OUTPUT_MAX_LIMIT
# ---Encoder feedback signals/setup---
setp hm2_5i25.0.encoder.03.counter-mode 0
setp hm2_5i25.0.encoder.03.filter 1
setp hm2_5i25.0.encoder.03.index-invert 0
setp hm2_5i25.0.encoder.03.index-mask 0
setp hm2_5i25.0.encoder.03.index-mask-invert 0
setp hm2_5i25.0.encoder.03.scale [AXIS_3]ENCODER_SCALE
I dont want to use homing so should be simple but I cant get encoder signals into the slaved axis. IT works but the slave axis doesnt get error correction and eventually get f error.
Here is the relative clipped portion of the hal.
#*******************
# AXIS Y
#*******************
setp pid.y.FF0 [AXIS_1]FF0
setp pid.y.FF1 [AXIS_1]FF1
setp pid.y.FF2 [AXIS_1]FF2
setp pid.y.deadband [AXIS_1]DEADBAND
setp pid.y.maxoutput [AXIS_1]MAX_OUTPUT
net y-index-enable <=> pid.y.index-enable axis.1.index-enable <=> hm2_5i25.0.encoder.01.index-enable
net y-enable => pid.y.enable axis.1.amp-enable-out
net y-output => pid.y.output => hm2_5i25.0.7i77.0.1.analogout1
net y-pos-cmd => axis.1.motor-pos-cmd pid.y.command pid.a.command
net y-pos-fb <= hm2_5i25.0.encoder.01.position => pid.y.feedback => axis.1.motor-pos-fb
net y-vel-fb <= hm2_5i25.0.encoder.01.velocity => pid.y.feedback-deriv
net y-pos-rawcounts <= hm2_5i25.0.encoder.01.rawcounts
# ---PWM Generator signals/setup---
setp hm2_5i25.0.7i77.0.1.analogout1-scalemax [AXIS_1]OUTPUT_SCALE
setp hm2_5i25.0.7i77.0.1.analogout1-minlim [AXIS_1]OUTPUT_MIN_LIMIT
setp hm2_5i25.0.7i77.0.1.analogout1-maxlim [AXIS_1]OUTPUT_MAX_LIMIT
# ---Encoder feedback signals/setup---
setp hm2_5i25.0.encoder.01.counter-mode 0
setp hm2_5i25.0.encoder.01.filter 1
setp hm2_5i25.0.encoder.01.index-invert 0
setp hm2_5i25.0.encoder.01.index-mask 0
setp hm2_5i25.0.encoder.01.index-mask-invert 0
setp hm2_5i25.0.encoder.01.scale [AXIS_1]ENCODER_SCALE
#*******************
# AXIS A
#*******************
net a-index-enable <=> pid.a.index-enable axis.3.index-enable <=> hm2_5i25.0.encoder.03.index-enable
net a-enable => pid.a.enable axis.3.amp-enable-out
net a-output => pid.a.output => hm2_5i25.0.7i77.0.1.analogout3
net a-pos-cmd => axis.3.motor-pos-cmd
net a-pos-fb <= hm2_5i25.0.encoder.03.position => pid.a.feedback => axis.3.motor-pos-fb
net a-vel-fb <= hm2_5i25.0.encoder.03.velocity => pid.a.feedback-deriv
net a-pos-rawcounts <= hm2_5i25.0.encoder.03.rawcounts
# ---PWM Generator signals/setup---
setp hm2_5i25.0.7i77.0.1.analogout3-scalemax [AXIS_3]OUTPUT_SCALE
setp hm2_5i25.0.7i77.0.1.analogout3-minlim [AXIS_3]OUTPUT_MIN_LIMIT
setp hm2_5i25.0.7i77.0.1.analogout3-maxlim [AXIS_3]OUTPUT_MAX_LIMIT
# ---Encoder feedback signals/setup---
setp hm2_5i25.0.encoder.03.counter-mode 0
setp hm2_5i25.0.encoder.03.filter 1
setp hm2_5i25.0.encoder.03.index-invert 0
setp hm2_5i25.0.encoder.03.index-mask 0
setp hm2_5i25.0.encoder.03.index-mask-invert 0
setp hm2_5i25.0.encoder.03.scale [AXIS_3]ENCODER_SCALE
Last edit: 29 Oct 2016 15:40 by bevins. Reason: snipped out X axis for clarity.
Please Log in or Create an account to join the conversation.
29 Oct 2016 15:44 #82234
by bevins
Replied by bevins on topic Once again two servo's on one axis issues
Cannot use pid.a.command because it is being used with a-pos-cmd. So a never gets corrected error
Please Log in or Create an account to join the conversation.
30 Oct 2016 06:57 #82249
by bevins
Replied by bevins on topic Once again two servo's on one axis issues
Upgraded to get joint-axes.
Problem solved, well, its going to be.
Problem solved, well, its going to be.
Please Log in or Create an account to join the conversation.
31 Oct 2016 12:04 #82275
by andypugh
Replied by andypugh on topic Once again two servo's on one axis issues
There wasn't really enough of the HAL to tell how you were configuring things in the original setup.
But, if you were trying to send the same command to both servos then you would have needed two separate PIDs sharing a single command channel (axis.1.motor-pos-cmd) but with each PID getting feedback from its own encoder.
even then, I think that you might have had trouble at homing-time.
Switching to JA in 2.8 was the right decision.
But, if you were trying to send the same command to both servos then you would have needed two separate PIDs sharing a single command channel (axis.1.motor-pos-cmd) but with each PID getting feedback from its own encoder.
even then, I think that you might have had trouble at homing-time.
Switching to JA in 2.8 was the right decision.
Please Log in or Create an account to join the conversation.
04 Nov 2016 13:13 - 04 Nov 2016 13:15 #82416
by bevins
Replied by bevins on topic Once again two servo's on one axis issues
JA in 2.8 has fixed my issues I was having. Everything is working as expected except I cannot get servos tuned on Y.
Y is the axis that has two motors. I have these drives that has a closed loop within. There are options to open them up so that you can close the loop with Linuxcnc and I did. From what I understood from the manual was when you do that it doesnt use the pid or the adjustments within the drive that the PID is being controlled outside the drive. This doesnt seem to be the case. The parameters within the drive still effect the drive/motor and so does the parameters in Linuxcnc. So I am having a hard time getting them tuned so they stay synced. Problem is if they are not then when I turn on the machine it racks the gantry hard.
I am trying to get it close so when I engage the motors and turn on Liniuxcnc, it doesnt rack.
I attached some pics so you can see the motor drivetrain. Also some halscope images. This is the closest I can get.
The halscope shows the two joints on Y, F-error, vel-command and motor-fb
Note: the f-error is on 1m/div
Y is the axis that has two motors. I have these drives that has a closed loop within. There are options to open them up so that you can close the loop with Linuxcnc and I did. From what I understood from the manual was when you do that it doesnt use the pid or the adjustments within the drive that the PID is being controlled outside the drive. This doesnt seem to be the case. The parameters within the drive still effect the drive/motor and so does the parameters in Linuxcnc. So I am having a hard time getting them tuned so they stay synced. Problem is if they are not then when I turn on the machine it racks the gantry hard.
I am trying to get it close so when I engage the motors and turn on Liniuxcnc, it doesnt rack.
I attached some pics so you can see the motor drivetrain. Also some halscope images. This is the closest I can get.
The halscope shows the two joints on Y, F-error, vel-command and motor-fb
Note: the f-error is on 1m/div
Last edit: 04 Nov 2016 13:15 by bevins.
Please Log in or Create an account to join the conversation.
- Todd Zuercher
-
- Away
- Platinum Member
-
Less
More
- Posts: 4978
- Thank you received: 1377
04 Nov 2016 13:47 #82419
by Todd Zuercher
Replied by Todd Zuercher on topic Once again two servo's on one axis issues
What were your pid settings for the above trace? Specifically the FF1 and 2?
Looks like those need some fine tuning.
Looks like those need some fine tuning.
Please Log in or Create an account to join the conversation.
04 Nov 2016 14:40 #82424
by bevins
Replied by bevins on topic Once again two servo's on one axis issues
FF1 to get the ferror fixed and FF2 for the acel and decel?
I am not in front of it now but will post them later.
I am not in front of it now but will post them later.
Please Log in or Create an account to join the conversation.
04 Nov 2016 19:36 #82447
by andypugh
Replied by andypugh on topic Once again two servo's on one axis issues
The actual magnitude of the f-error seems quite small in absolute terms?
Is it a mm or inches machine?
Is it a mm or inches machine?
Please Log in or Create an account to join the conversation.
04 Nov 2016 21:02 - 04 Nov 2016 21:05 #82451
by bevins
The machine is in inches.
The pids for the two Y joints are as follows:
Y1
P = 20
I = 0
D = .5
FF1 = .257
FF2 = .00125
BIAS = .099
DEADBAND = 0
Y2
P = 20
I = .1
D = .5
FF1 = .257
FF2 = .00115
BIAS = .099
DEADBAND = 0
Replied by bevins on topic Once again two servo's on one axis issues
The actual magnitude of the f-error seems quite small in absolute terms?
Is it a mm or inches machine?
The machine is in inches.
The pids for the two Y joints are as follows:
Y1
P = 20
I = 0
D = .5
FF1 = .257
FF2 = .00125
BIAS = .099
DEADBAND = 0
Y2
P = 20
I = .1
D = .5
FF1 = .257
FF2 = .00115
BIAS = .099
DEADBAND = 0
Last edit: 04 Nov 2016 21:05 by bevins.
Please Log in or Create an account to join the conversation.
04 Nov 2016 21:10 #82455
by bevins
Replied by bevins on topic Once again two servo's on one axis issues
I cant seem to get the and decell spikes down. Those are the opnes causing the issues I think.
FF2 is not changing it. I am thinking it is in the drive somewhere.
FF2 is not changing it. I am thinking it is in the drive somewhere.
Please Log in or Create an account to join the conversation.
Time to create page: 0.152 seconds