Steppers hunting

More
29 Dec 2023 19:01 #289326 by awetmore
Steppers hunting was created by awetmore
I upgraded to LinuxCNC 2.9.1 (and now 2.9.2) and somehow broke my configuration.  It is possible that I made a HAL change that broke it, not that it was the upgrade, but I think I've reverted my changes.

The steppers are hunting like a poorly tuned closed-loop servo (but these are open loop steppers) and I'm not sure how to diagnose the root cause.  This is a gantry machine and the hunting steppers are a mess because they pull the gantry out of square.

I'm testing now by just homing Z and when I do that I can see the DRO moving between -0.002 and 0.002 (and numbers in between) multiple times per second. 

My machine has a Mesa 7i96S and I've attached my HAL and INI files.  I'm running Debian 12 (bookworm) with the pre-empt kernel:
root@cnc-mr1:~# uname -a
Linux cnc-mr1 6.1.0-9-rt-amd64 #1 SMP PREEMPT_RT Debian 6.1.27-1 (2023-05-08) x86_64 GNU/Linux

Alex
Attachments:

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

More
29 Dec 2023 19:02 - 29 Dec 2023 19:03 #289327 by awetmore
Replied by awetmore on topic Steppers hunting
config files in this message 

Attachment not found

 

Attachment not found



I can't figure out attachments here, so I've put them on the web at:
www.phred.org/~alex/scratch/mr1.hal
www.phred.org/~alex/scratch/mr1.ini
Last edit: 29 Dec 2023 19:03 by awetmore.

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

More
29 Dec 2023 21:36 - 29 Dec 2023 21:36 #289333 by PCW
Replied by PCW on topic Steppers hunting
At least one issue is that your function order is incorrect:

addf hm2_7i96s.0.read servo-thread
addf hm2_7i96s.0.write servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf pid.x.do-pid-calcs servo-thread
addf pid.y.do-pid-calcs servo-thread
addf pid.y2.do-pid-calcs servo-thread
addf pid.z.do-pid-calcs servo-thread
addf pid.s.do-pid-calcs servo-thread
addf near.speed servo-thread
addf or2.drawbar servo-thread
addf or2.probe servo-thread

Should be:

addf hm2_7i96s.0.read servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf pid.x.do-pid-calcs servo-thread
addf pid.y.do-pid-calcs servo-thread
addf pid.y2.do-pid-calcs servo-thread
addf pid.z.do-pid-calcs servo-thread
addf pid.s.do-pid-calcs servo-thread
addf hm2_7i96s.0.write servo-thread
addf near.speed servo-thread
addf or2.drawbar servo-thread
addf or2.probe servo-thread

Last edit: 29 Dec 2023 21:36 by PCW.

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

More
29 Dec 2023 22:05 #289336 by awetmore
Replied by awetmore on topic Steppers hunting
Thank you, that fixed it. I had reordered those when cleaning up something else in my HAL file and had no idea that the ordering mattered.

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

More
29 Dec 2023 23:40 #289349 by PCW
Replied by PCW on topic Steppers hunting
The thread order is important because LinuxCNC is
basically in a loop running at the servo thread rate,
reading inputs, doing calculations and writing outputs
based on the calculated results from the inputs.

By putting the write function immediately after the read,
the write data is "stale", that is it has not been updated
since the last servo thread cycle, basically increasing
the time to react to inputs by a whole servo thread period.

This additional delay is what caused the instability in the step
generator control.

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

More
23 Apr 2024 02:51 #298886 by JohnBr00ker
Replied by JohnBr00ker on topic Steppers hunting
Hi Alex,
This is just a shout out to make contact after a post I addressed to you in Feb 2010 !!
I offered to email you a pdf of a cct diagram of the Super Tech controller that we both were having issues with.
Now that I have started again, under my own name, (rather than 'grey1beard - it's all white now) Ive lost the original circuit.
Do you by any chance have a copy ?
Regards
John Brooker

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

Time to create page: 0.091 seconds
Powered by Kunena Forum