Mesa 7i77 and linear encoder tuning PID.

More
13 Aug 2012 18:08 #23107 by ROG
1000 mm/min zoomed start
Attachments:

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

More
13 Aug 2012 18:11 - 13 Aug 2012 18:12 #23108 by ROG
Unintuitive Omron drive params ....
Attachments:
Last edit: 13 Aug 2012 18:12 by ROG. Reason: image too large

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

More
13 Aug 2012 18:22 #23109 by ROG
[EMCMOT]
EMCMOT = motmod
COMM_TIMEOUT = 1.0
COMM_WAIT = 0.010
SERVO_PERIOD = 600000
BASE_PEROID = 600000


AXES = 3
COORDINATES = X Z
LINEAR_UNITS = mm
ANGULAR_UNITS = degree
TRAJ_PERIOD = 600000
CYCLE_TIME = 0.010
DEFAULT_VELOCITY = 2
MAX_LINEAR_VELOCITY = 50
MAX_ACCELERATION = 300
NO_FORCE_HOMING = 1


#********************
# Axis X
#********************
[AXIS_0]
TYPE = LINEAR
MAX_VELOCITY = 50
MAX_ACCELERATION = 100


.....

# AXIS X
#*******************

setp pid.x.Pgain [AXIS_0]P
setp pid.x.Igain [AXIS_0]I
setp pid.x.Dgain [AXIS_0]D
setp pid.x.bias [AXIS_0]BIAS
setp pid.x.FF0 [AXIS_0]FF0
setp pid.x.FF1 [AXIS_0]FF1
setp pid.x.FF2 [AXIS_0]FF2
setp pid.x.deadband [AXIS_0]DEADBAND
setp pid.x.maxoutput [AXIS_0]MAX_OUTPUT

net x-index-enable <=> pid.x.index-enable
net x-enable => pid.x.enable
net x-output => pid.x.output
net x-pos-cmd => pid.x.command
net x-vel-fb => pid.x.feedback-deriv
net x-pos-fb => pid.x.feedback

# ---PWM Generator signals/setup---

setp hm2_5i25.0.7i77.0.1.analogout0-scalemax [AXIS_0]OUTPUT_SCALE
setp hm2_5i25.0.7i77.0.1.analogout0-minlim [AXIS_0]OUTPUT_MIN_LIMIT
setp hm2_5i25.0.7i77.0.1.analogout0-maxlim [AXIS_0]OUTPUT_MAX_LIMIT

net x-output => hm2_5i25.0.7i77.0.1.analogout0
net x-pos-cmd axis.0.motor-pos-cmd
net x-enable axis.0.amp-enable-out
# enable _all_ sserial pwmgens
net x-enable hm2_5i25.0.7i77.0.1.analogena

# ---Encoder feedback signals/setup---

setp hm2_5i25.0.encoder.00.counter-mode 0
setp hm2_5i25.0.encoder.00.filter 0
setp hm2_5i25.0.encoder.00.index-invert 0
setp hm2_5i25.0.encoder.00.index-mask 0
setp hm2_5i25.0.encoder.00.index-mask-invert 0
setp hm2_5i25.0.encoder.00.scale [AXIS_0]ENCODER_SCALE

net x-pos-fb <= hm2_5i25.0.encoder.00.position
net x-vel-fb <= hm2_5i25.0.encoder.00.velocity
net x-pos-fb => axis.0.motor-pos-fb
net x-index-enable axis.0.index-enable <=> hm2_5i25.0.encoder.00.index-enable
net x-pos-rawcounts <= hm2_5i25.0.encoder.00.rawcounts

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

More
13 Aug 2012 19:05 - 13 Aug 2012 19:35 #23110 by PCW
OK so you are running this in torque mode. This make tuning a little more interesting.

It looks like you need more P gain but you already have some oscillation so have you tried increasing the D term to eliminate this?

On the 1000 mm/sec move you can see where a little FF2 can be used to cancel the errors during the accel and decel phase

The lack of P gain (stiffness) is fairly obvious in most moves because of the stiction (the spike at the beginning)
(I was wrong before its not excessive acceleration that causes the spike but rather low gain and insufficient D term)

Think of torque mode as pulling your axis around with a spring (where the P term is the spring stiffness)

if you look at the expanded 50 mm/s move you can see the the mechanics did not even start moving until about 12 ms despite being commanded to move (this needs more P gain (which needs more D gain for stability), some FF2 and perhaps some I)
Last edit: 13 Aug 2012 19:35 by PCW. Reason: ommision

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

More
13 Aug 2012 19:57 #23112 by VNR

Unintuitive Omron drive params .... www.linuxcnc.org/media/kunena/attachment...mages/Untitled_1.jpg

Some things to consider:
How did you get the configurations values of the drive ? with autotune or something like that ?
The drive seems to support velocity command, perhaps it is better to use it.
Try setting the minimun in "torque command filter time constant" in order to have a better initial response.
my two cents

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

More
13 Aug 2012 20:25 #23117 by ROG
Ok ..
Drive has two sets of inputs, speed and torque.
I’m connected to speed, not torque.... Tried torque with disastrous results.
Params related to torque input, have no effect, seemingly position loop also.

VNR – hi ...... drive wont auto tune.
Params arrived at by working my way from defaults and from one extreme to the other for most combinations – hence weeks ....

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

More
13 Aug 2012 21:14 #23120 by ROG
If I increase P to any large degree .... (from previous “experiments”) this happens

Attachments:

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

More
13 Aug 2012 21:19 #23121 by ROG
The more I reduce "torque command filter time constant" then the more i have to reduce “speed loop gain” to prevent oscillations so severe the drive errors with an overload

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

More
13 Aug 2012 23:30 #23130 by VNR

Feedback is from a Heidenhain linear encoder with 10 micron grating pitch via 256 X interpolation giving a resolution of 0.0000390625 mm at 25600 counts per mm. Single ended encoder output is connected to a Mesa 7i77.

The servo drive can output 2048 quadrature pulse per revolution. If I connect this to a spare encoder channel and use this as velocity feedback, would this

Other things to consider:
- Usually Position Loop Gain is 1/4 of Speed Loop Gain (parameters of the drive).
- Instead of the linear encoder, use only the encoder output of the drive to see what happens.
- What happens if you use MAX_ACCELERATION 1/2 of MAX_VELOCITY ?
- What happens if you put SERVO_PERIOD = TRAJ_PERIOD * 0.5 (or 0.25) ? (and coment BASE_PERIOD if you are not using it).
- Do you have a another filter, feed-forward or delay parameter in the drive ?

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

More
14 Aug 2012 00:15 #23131 by PCW
If this is truly running as a velocity mode drive, the velocity loop on the drive should be tuned first (with no feedback from linuxCNC) Does Omron provide tuning software? If not it is possible to tune it via LinuxCNC (using linux CNC to provide step/ramp velocity commands and tuning for minimum difference between commanded and actual velocity)

Thats why I thought it was in torque mode as it was unresponsive to velocity commands (that 12 ms delay).

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

Time to create page: 0.199 seconds
Powered by Kunena Forum