axis.5.motor-pos-cmd = -nan
03 Nov 2017 11:06 #101254
by Henk
axis.5.motor-pos-cmd = -nan was created by Henk
Hi
I have looked for the source of this error but have reached a dead end..., perhaps a fresh pair of eyes can spot the obvious mistake.
current version is 2.7.8. when i start the machine the C-axis runs at full speed without giving an f-error. I traced this back to axis.5.motor-pos-cmd which strangely equals "-nan", which i assume means "not a number". other motion pins is also strange....
axis.5.motor-pos-cmd = -inf
axis.5.motor-offset = -inf
axis.5.joint-pos-fb = inf
axis.5.joint-pos-cmd = inf
The system worked before, i must have changed something by mistake that i cannot find now.
Axis C section of the HAL file below and the INI file attached. I have replaced the INI file with the old version and get the same result so i dont think the error is there.
thanks in advance.
Henk
#*******************
# AXIS C
#*******************
setp pid.c.Pgain [AXIS_5]P
setp pid.c.Igain [AXIS_5]I
setp pid.c.Dgain [AXIS_5]D
setp pid.c.bias [AXIS_5]BIAS
setp pid.c.FF0 [AXIS_5]FF0
setp pid.c.FF1 [AXIS_5]FF1
setp pid.c.FF2 [AXIS_5]FF2
setp pid.c.deadband [AXIS_5]DEADBAND
setp pid.c.maxoutput [AXIS_5]MAX_OUTPUT
setp pid.c.error-previous-target true
net c-pos-cmd => pid.c.command
net c-enable => pid.c.enable
net c-index-enable <=> pid.c.index-enable
net c-vel-cmd => pid.c.command-deriv
net c-pos-fb => pid.c.feedback
net c-output <= pid.c.output
# ---PWM Generator signals/setup---
setp hm2_7i92.0.7i77.0.4.analogout0-scalemax [AXIS_5]OUTPUT_SCALE
setp hm2_7i92.0.7i77.0.4.analogout0-minlim [AXIS_5]OUTPUT_MIN_LIMIT
setp hm2_7i92.0.7i77.0.4.analogout0-maxlim [AXIS_5]OUTPUT_MAX_LIMIT
net c-output => hm2_7i92.0.7i77.0.4.analogout0
net c-pos-cmd <= axis.5.motor-pos-cmd
net c-enable <= axis.5.amp-enable-out
# ---Encoder feedback signals/setup---
#net or2resetout => hm2_7i92.0.encoder.01.reset <= or2reset.out
setp hm2_7i92.0.encoder.01.counter-mode 0
setp hm2_7i92.0.encoder.01.filter 1
setp hm2_7i92.0.encoder.01.index-invert 0
setp hm2_7i92.0.encoder.01.index-mask 0
setp hm2_7i92.0.encoder.01.index-mask-invert 0
setp hm2_7i92.0.encoder.01.scale [AXIS_5]ENCODER_SCALE
#----activate estop when ferrored _______________
net c_ferrored <= axis.5.f-errored => halui.estop.activate
# component connections
net spindle-revs => gearhob.masterenc-0
net z-pos-fb => gearhob.masterenc-1
net y-pos-fb => gearhob.masterenc-2
net c-pos-fb => gearhob.slaveenc-0
#net gearhob-enable-clq => gearhob.enable
net c-pos-fb <= gearhob.sync-out
#reset signal for spindle and table enc
net reset_enc <= gearhob.reset
net reset_enc => hm2_7i92.0.encoder.01.reset
net reset_enc => hm2_7i92.0.encoder.00.reset
net c-pos-fb <= hm2_7i92.0.encoder.01.position
net c-vel-fb <= hm2_7i92.0.encoder.01.velocity
net c-pos-fb => axis.5.motor-pos-fb
net c-index-enable axis.5.index-enable <=> hm2_7i92.0.encoder.01.index-enable
net c-pos-rawcounts <= hm2_7i92.0.encoder.01.rawcounts
# ---setup home / limit switch signals---
I have looked for the source of this error but have reached a dead end..., perhaps a fresh pair of eyes can spot the obvious mistake.
current version is 2.7.8. when i start the machine the C-axis runs at full speed without giving an f-error. I traced this back to axis.5.motor-pos-cmd which strangely equals "-nan", which i assume means "not a number". other motion pins is also strange....
axis.5.motor-pos-cmd = -inf
axis.5.motor-offset = -inf
axis.5.joint-pos-fb = inf
axis.5.joint-pos-cmd = inf
The system worked before, i must have changed something by mistake that i cannot find now.
Axis C section of the HAL file below and the INI file attached. I have replaced the INI file with the old version and get the same result so i dont think the error is there.
thanks in advance.
Henk
#*******************
# AXIS C
#*******************
setp pid.c.Pgain [AXIS_5]P
setp pid.c.Igain [AXIS_5]I
setp pid.c.Dgain [AXIS_5]D
setp pid.c.bias [AXIS_5]BIAS
setp pid.c.FF0 [AXIS_5]FF0
setp pid.c.FF1 [AXIS_5]FF1
setp pid.c.FF2 [AXIS_5]FF2
setp pid.c.deadband [AXIS_5]DEADBAND
setp pid.c.maxoutput [AXIS_5]MAX_OUTPUT
setp pid.c.error-previous-target true
net c-pos-cmd => pid.c.command
net c-enable => pid.c.enable
net c-index-enable <=> pid.c.index-enable
net c-vel-cmd => pid.c.command-deriv
net c-pos-fb => pid.c.feedback
net c-output <= pid.c.output
# ---PWM Generator signals/setup---
setp hm2_7i92.0.7i77.0.4.analogout0-scalemax [AXIS_5]OUTPUT_SCALE
setp hm2_7i92.0.7i77.0.4.analogout0-minlim [AXIS_5]OUTPUT_MIN_LIMIT
setp hm2_7i92.0.7i77.0.4.analogout0-maxlim [AXIS_5]OUTPUT_MAX_LIMIT
net c-output => hm2_7i92.0.7i77.0.4.analogout0
net c-pos-cmd <= axis.5.motor-pos-cmd
net c-enable <= axis.5.amp-enable-out
# ---Encoder feedback signals/setup---
#net or2resetout => hm2_7i92.0.encoder.01.reset <= or2reset.out
setp hm2_7i92.0.encoder.01.counter-mode 0
setp hm2_7i92.0.encoder.01.filter 1
setp hm2_7i92.0.encoder.01.index-invert 0
setp hm2_7i92.0.encoder.01.index-mask 0
setp hm2_7i92.0.encoder.01.index-mask-invert 0
setp hm2_7i92.0.encoder.01.scale [AXIS_5]ENCODER_SCALE
#----activate estop when ferrored _______________
net c_ferrored <= axis.5.f-errored => halui.estop.activate
# component connections
net spindle-revs => gearhob.masterenc-0
net z-pos-fb => gearhob.masterenc-1
net y-pos-fb => gearhob.masterenc-2
net c-pos-fb => gearhob.slaveenc-0
#net gearhob-enable-clq => gearhob.enable
net c-pos-fb <= gearhob.sync-out
#reset signal for spindle and table enc
net reset_enc <= gearhob.reset
net reset_enc => hm2_7i92.0.encoder.01.reset
net reset_enc => hm2_7i92.0.encoder.00.reset
net c-pos-fb <= hm2_7i92.0.encoder.01.position
net c-vel-fb <= hm2_7i92.0.encoder.01.velocity
net c-pos-fb => axis.5.motor-pos-fb
net c-index-enable axis.5.index-enable <=> hm2_7i92.0.encoder.01.index-enable
net c-pos-rawcounts <= hm2_7i92.0.encoder.01.rawcounts
# ---setup home / limit switch signals---
Please Log in or Create an account to join the conversation.
03 Nov 2017 16:56 #101274
by andypugh
Replied by andypugh on topic axis.5.motor-pos-cmd = -nan
NAN and INF are signs that things have gone wrong in a numerical calculation.
I would guess that the problem is a divide-by-zero in the gearhob component, and that you are trying to cut a zero-toothed gear.
Do you have the sourcecode for gearhob.comp? It ought to sanity-check the inputs to prevent exactly this problem.
I would guess that the problem is a divide-by-zero in the gearhob component, and that you are trying to cut a zero-toothed gear.
Do you have the sourcecode for gearhob.comp? It ought to sanity-check the inputs to prevent exactly this problem.
Please Log in or Create an account to join the conversation.
06 Nov 2017 07:07 #101388
by Henk
Replied by Henk on topic axis.5.motor-pos-cmd = -nan
HI Andy
gearhob.comp attached.
The inputs to gearhob comes from a Pyvcp panel in which the tooth number is limited, but yes, there should be some sanity checks...it is still a work in progress but i cannot start testing because of the above issue.
What is strange about the issue is that gearhob.comp intercepts the feedback signal. With this intercept removed as in the hal file attached, motor-pos-cmd still show nan.
The comp shouldnt be able to influence the commanded position at all.
Thanks for your help
Henk
gearhob.comp attached.
The inputs to gearhob comes from a Pyvcp panel in which the tooth number is limited, but yes, there should be some sanity checks...it is still a work in progress but i cannot start testing because of the above issue.
What is strange about the issue is that gearhob.comp intercepts the feedback signal. With this intercept removed as in the hal file attached, motor-pos-cmd still show nan.
The comp shouldnt be able to influence the commanded position at all.
Thanks for your help
Henk
Please Log in or Create an account to join the conversation.
06 Nov 2017 09:01 #101392
by andypugh
Replied by andypugh on topic axis.5.motor-pos-cmd = -nan
I had been assuming that the gearhob.comp was handling the C axis movement to synchronise with the hobbing spindle.
(which I thought I had a component for, but perhaps not looking at wiki.linuxcnc.org/cgi-bin/wiki.pl?Hobbing
I suspect that it would have been easier to do what your hobbing.comp does in Python/userspace rather than in a realtime comp.
You can remove gearhob.comp from all suspicion by simply commenting out the line that adds it to a thread. If it never runs it can't do any harm.
If helix-angle is zero or hob-starts is zero then you also have a divide by zero problem.
(which I thought I had a component for, but perhaps not looking at wiki.linuxcnc.org/cgi-bin/wiki.pl?Hobbing
I suspect that it would have been easier to do what your hobbing.comp does in Python/userspace rather than in a realtime comp.
You can remove gearhob.comp from all suspicion by simply commenting out the line that adds it to a thread. If it never runs it can't do any harm.
If helix-angle is zero or hob-starts is zero then you also have a divide by zero problem.
Please Log in or Create an account to join the conversation.
06 Nov 2017 09:05 #101393
by Henk
Replied by Henk on topic axis.5.motor-pos-cmd = -nan
Thanks
I will remove it from the thread and check again, but somehow I suspect it isn't going to solve the axis.5.motor-pos-cmd problem
will let you know
Henk
I will remove it from the thread and check again, but somehow I suspect it isn't going to solve the axis.5.motor-pos-cmd problem
will let you know
Henk
Please Log in or Create an account to join the conversation.
06 Nov 2017 09:08 #101395
by andypugh
I think you are correct that it isn't the problem, but it's a simple check to be sure.
Where does the C-axis command come from? HAL calculations?
Replied by andypugh on topic axis.5.motor-pos-cmd = -nan
Thanks
I will remove it from the thread and check again, but somehow I suspect it isn't going to solve the axis.5.motor-pos-cmd problem
I think you are correct that it isn't the problem, but it's a simple check to be sure.
Where does the C-axis command come from? HAL calculations?
Please Log in or Create an account to join the conversation.
06 Nov 2017 09:13 #101396
by Henk
Replied by Henk on topic axis.5.motor-pos-cmd = -nan
No, it s a standard C-axis config. command comes from motion.
axis.5.motor-pos-cmd => pid => 7i77 analog-out...
C-axis movement is achieved by fiddling with the feedback signal in gearhob.comp.
Henk
axis.5.motor-pos-cmd => pid => 7i77 analog-out...
C-axis movement is achieved by fiddling with the feedback signal in gearhob.comp.
Henk
Please Log in or Create an account to join the conversation.
06 Nov 2017 09:17 #101398
by Henk
Replied by Henk on topic axis.5.motor-pos-cmd = -nan
#ing out the addf line for gearhob.comp doesn't solve the issue as suspected.
thanks
Henk
thanks
Henk
Please Log in or Create an account to join the conversation.
06 Nov 2017 09:24 #101400
by andypugh
OK, and that output only goes to the PID, I assume? (This doesn't matter for investigating this problem, I am just curious about whether your way is better than my way as I do a fair bit of gear hobbing myself).
When does the NaN appear? I wonder if Halscope would be able to track it propogating through the system.
Replied by andypugh on topic axis.5.motor-pos-cmd = -nan
No, it s a standard C-axis config. command comes from motion.
C-axis movement is achieved by fiddling with the feedback signal in gearhob.comp.
OK, and that output only goes to the PID, I assume? (This doesn't matter for investigating this problem, I am just curious about whether your way is better than my way as I do a fair bit of gear hobbing myself).
When does the NaN appear? I wonder if Halscope would be able to track it propogating through the system.
Please Log in or Create an account to join the conversation.
06 Nov 2017 09:34 #101401
by Henk
Replied by Henk on topic axis.5.motor-pos-cmd = -nan
As soon as the gui loads, I check this in Hal configuration and it shows nan. this is before the e-stop is released on the gui and the machine still off. it seems as if it starts up that way.
Henk
Henk
Please Log in or Create an account to join the conversation.
Time to create page: 0.082 seconds