following error while homing only

More
03 Dec 2018 21:52 #121775 by billykid
I noticed that by running homing sometimes a random axis give following error.
after also working for hours no problem.
the system is a closed loop 5i23-7i40 home switch + index.
I do not understand why only while homing ...
regards
Mauro

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

More
03 Dec 2018 23:23 #121783 by PCW
This can be related to homing to index because of the step in encoder position
when index is detected.

Do you have the per axis index-enable signals connected to the PID
components index enable pin?

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

More
04 Dec 2018 21:04 #121831 by billykid
this is the hal section of the x axis, however also y and z have the same defect.

#*******************
# 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
setp pid.x.error-previous-target true

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

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

setp hm2_5i23.0.pwmgen.01.output-type 1
setp hm2_5i23.0.pwmgen.01.scale [AXIS_0]OUTPUT_SCALE

net x-output => hm2_5i23.0.pwmgen.01.value
net x-pos-cmd axis.0.motor-pos-cmd
net x-enable axis.0.amp-enable-out => hm2_5i23.0.pwmgen.01.enable

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

setp hm2_5i23.0.encoder.01.counter-mode 0
setp hm2_5i23.0.encoder.01.filter 1
setp hm2_5i23.0.encoder.01.index-invert 0
setp hm2_5i23.0.encoder.01.index-mask 0
setp hm2_5i23.0.encoder.01.index-mask-invert 0
setp hm2_5i23.0.encoder.01.scale [AXIS_0]ENCODER_SCALE

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

# ---setup home / limit switch signals---

net home-x => axis.0.home-sw-in
#net x-home-sw => axis.0.home-sw-in
net x-neg-limit => axis.0.neg-lim-sw-in
net x-pos-limit => axis.0.pos-lim-sw-in

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

More
04 Dec 2018 21:52 #121834 by PCW
Could you include the entire hal file as an attachment?

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

More
04 Dec 2018 22:02 #121835 by billykid

File Attachment:

File Name: La_mia_cnc-pwm.hal
File Size:15 KB
Attachments:

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

More
04 Dec 2018 22:33 #121838 by PCW
OK look normal, what are your following error settings?

There can be a (supposedly small) error spike when index is detected
because the commanded and feedback position have a large step (especially if this is the first home after a startup)

This is patched around in the PID component by using the previous cycles PID output when the index is detected (index-enable falling edge) since the calculated derivatives would be broken in this case. This (one cycle stale PID output) will cause a small glitch especially if index happens during accelerated motion

You might try homing without index to see if the error is still there, and if so
a plot of the following error when homing might shed some light on whats happening.

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

More
05 Dec 2018 06:18 #121845 by tommylight
You should check the tuning, use halscope to track following error.

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

More
05 Dec 2018 09:23 #121854 by billykid
thanks Pcw
max_ferror = 1 min_ferror = 0.2 I had put them high for the tests.
before using index homing had no problems.
unfortunately this morning it always works and I can not analyze the error ... I will try again calmly.
home search_vel = 5 will not be high I think.

Thanks Tommy
I think the pid is well calibrated because it is perfect at any speed and never goes wrong. seen with halscope never exceeds 5 mv including start and stop at F1000 .. F300 2 mv.
1 mv = 0.001 mm
I feel very good values after I mounted 3600 ppr x 4 14400 cpr encoders
regards
Mauro
The following user(s) said Thank You: tommylight

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

Moderators: PCWjmelson
Time to create page: 0.093 seconds
Powered by Kunena Forum