Another servo tuning

More
12 Apr 2022 15:00 #240052 by myval
Replied by myval on topic Another servo tuning
Spikiness zoomed in. Where does it come from?
Attachments:

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

More
12 Apr 2022 15:16 #240055 by andypugh
Replied by andypugh on topic Another servo tuning

I set it in position control without pid , motor-pos-cmd => stepgen.position-cmd 
just get this massive ferror spike but it runs ok. 
 

I am not sure that I believe those plots, I don't see how f-error can change that instantaneously. 

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

More
12 Apr 2022 15:16 #240056 by andypugh
Replied by andypugh on topic Another servo tuning

Spikiness zoomed in. Where does it come from?

How big is one encoder count, in mm? And how big is one step? 

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

More
13 Apr 2022 12:14 #240142 by myval
Replied by myval on topic Another servo tuning
motor is 877.7143 / mm and encoder is 2000 /mm 
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.

More
14 Apr 2022 08:41 #240214 by myval
Replied by myval on topic Another servo tuning
I thought it could be the " hochohmig / nicht hochohmig"   (how's my German hey) on the exe box so I have changed high impedance to low with no visible change.
Any idea how to troubleshoot those spikes?
Attachments:

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

More
14 Apr 2022 14:25 #240235 by myval
Replied by myval on topic Another servo tuning
Well I just discovered that he f-error spikes must come from linuxcnc / mesa since in open loop 
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.

More
19 Apr 2022 21:42 #240687 by andypugh
Replied by andypugh on topic Another servo tuning
It is possible that these spikes are happening every servo period, and correspond to the position error due to the servo thread latency.
(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.

More
22 Apr 2022 11:25 #240882 by myval
Replied by myval on topic Another servo tuning
I have some work for the machine at the moment so I had to go back to original settings and slow it down again.
It is set like servo drives are in position control and linux is set like this:

#*******************
#  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

If I don't use linear scales as feedback it drifts (X axis to the left/ negative direction)

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

Time to create page: 0.093 seconds
Powered by Kunena Forum