Another servo tuning
Please Log in or Create an account to join the conversation.
I am not sure that I believe those plots, I don't see how f-error can change that instantaneously.I set it in position control without pid , motor-pos-cmd => stepgen.position-cmd
just get this massive ferror spike but it runs ok.
Please Log in or Create an account to join the conversation.
How big is one encoder count, in mm? And how big is one step?Spikiness zoomed in. Where does it come from?
Please Log in or Create an account to join the conversation.
linear scale is 20um grating and EXE box multiply it by 10.
What do I do to make those plots believable?
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
this is input into f-error calculation instead of encoder
net x-pos-fb <= hm2_7i95.0.stepgen.00.position-fb
net x-pos-fb => joint.0.motor-pos-fb
and I am guessing it will be the other input into the f-error calculation so the motor pos cmd? I dont know the inside of the system so it is my guess only but process of elimination.
is some wrong mesa setting? or is it linux cnc setting? computer problems?
don't tell me that I am the only one in the world with this problem?
Please Log in or Create an account to join the conversation.
(Though it would have to be an aliasing problem, as there are 200 servo periods per square on the time axis)
You could switch to the approach commonly used with the Mesa stepgens of running them in velocity mode with a PID component. You then run a fixed P of 1000 and FF1 of 1.0 and the servo thread jitter is accounted for a little better.
But: Do you still have encoders? What do you see if you use those for feedback?
Please Log in or Create an account to join the conversation.
It is set like servo drives are in position control and linux is set like this:
If I don't use linear scales as feedback it drifts (X axis to the left/ negative direction)#*******************
# AXIS X JOINT 0
#*******************
setp pid.x.Pgain [JOINT_0]P
setp pid.x.Igain [JOINT_0]I
setp pid.x.Dgain [JOINT_0]D
setp pid.x.bias [JOINT_0]BIAS
setp pid.x.FF0 [JOINT_0]FF0
setp pid.x.FF1 [JOINT_0]FF1
setp pid.x.FF2 [JOINT_0]FF2
setp pid.x.deadband [JOINT_0]DEADBAND
setp pid.x.maxoutput [JOINT_0]MAX_OUTPUT
setp pid.x.error-previous-target true
# This setting is to limit bogus stepgen
# velocity corrections caused by position
# feedback sample time jitter.
setp pid.x.maxerror 0.012700
net x-index-enable <=> pid.x.index-enable
net x-enable => pid.x.enable
net x-pos-cmd => pid.x.command
net x-pos-fb => pid.x.feedback
net x-output <= pid.x.output
# Step Gen signals/setup
setp hm2_7i95.0.stepgen.00.dirsetup [JOINT_0]DIRSETUP
setp hm2_7i95.0.stepgen.00.dirhold [JOINT_0]DIRHOLD
setp hm2_7i95.0.stepgen.00.steplen [JOINT_0]STEPLEN
setp hm2_7i95.0.stepgen.00.stepspace [JOINT_0]STEPSPACE
setp hm2_7i95.0.stepgen.00.position-scale [JOINT_0]STEP_SCALE
setp hm2_7i95.0.stepgen.00.step_type 0
setp hm2_7i95.0.stepgen.00.control-type 1 #0 position/ 1 velocity
setp hm2_7i95.0.stepgen.00.maxaccel [JOINT_0]STEPGEN_MAXACCEL
setp hm2_7i95.0.stepgen.00.maxvel [JOINT_0]STEPGEN_MAXVEL
# ---closedloop stepper signals---
net x-pos-cmd <= joint.0.motor-pos-cmd
net x-vel-cmd <= joint.0.vel-cmd
net x-output => hm2_7i95.0.stepgen.00.velocity-cmd
net x-pos-fb => joint.0.motor-pos-fb
net x-enable <= joint.0.amp-enable-out
net x-enable => hm2_7i95.0.stepgen.00.enable
# ---Encoder feedback signals/setup---
#setp hm2_7i95.0.encoder.muxed-sample-frequency 2000000
setp hm2_7i95.0.encoder.00.counter-mode 0
setp hm2_7i95.0.encoder.00.filter 1
setp hm2_7i95.0.encoder.00.index-invert 0
setp hm2_7i95.0.encoder.00.index-mask 0
setp hm2_7i95.0.encoder.00.index-mask-invert 0
setp hm2_7i95.0.encoder.00.scale [JOINT_0]ENCODER_SCALE
net x-pos-fb <= hm2_7i95.0.encoder.00.position
net x-vel-fb <= hm2_7i95.0.encoder.00.velocity
net x-index-enable joint.0.index-enable <=> hm2_7i95.0.encoder.00.index-enable
net x-pos-rawcounts <= hm2_7i95.0.encoder.00.rawcounts
Please Log in or Create an account to join the conversation.