How motor-pos-fb and motor-pos-cmd coexist?

More
21 Aug 2010 16:37 #3837 by aike
Hi!
The question:
How axis.N.motor-pos-fb and axis.N.motor-pos-cmd operate in emc?
I use such code:

setp hm2_5i20.0.encoder.00.scale INPUT_SCALE
net Xpos-fb hm2_5i20.0.encoder.00.position => axis.0.motor-pos-fb
net Xpos-cmd axis.0.motor-pos-cmd => hm2_5i20.0.stepgen.00.position-cmd
net Xenable axis.0.amp-enable-out => hm2_5i20.0.stepgen.00.enable

INPUT_SCALE adjust encoder to show the axis way in machine unit.
The following error (FERROR) increase and decrease during the moving.
Is the internal true feedback in emc, wich correct (make more steps for example)
the trajectory?
How this feedback accurate?

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

More
21 Aug 2010 17:18 #3838 by aike
If the difference between feedback and command will increase, will this corrected by emc itself or axis.N.motor-pos-fb ONLY SHOW the feedback
and do nothing? The border of switch off the amplifier determined by FERROR and FERROR_MIN (all depends the speed)

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

More
21 Aug 2010 17:56 - 21 Aug 2010 18:00 #3839 by PCW
You need a PID loop (using the HAL PID component) to correct the error.

Basically for stepgen with encoder feedback you want position command and position feedback to go into the appropriate
PID component inputs and the output of the PID component to drive the stepgen in velocity mode (as I mentioned before)
(Position mode stepgen is for open loop systems)
Last edit: 21 Aug 2010 18:00 by PCW. Reason: ommission

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

More
17 Mar 2019 03:07 - 17 Mar 2019 03:08 #128797 by Emanresu
Hello all,

sorry, for reaktivating such an old topic, but it almost perfekt fits my situation.

- I have verry different workloads on my machinetable. From acrylic up to car-engines
- My servodrives work like a charm in positionmode while open-loop (using the internal PID)

But i wona use my linear-scales for Ferror, DRO and indexing.

Is there a way to do this without the EMC PID?

DRO is no problem. https://www.youtube.com/watch?v=w1gpdlsom6k

But is there something simple like = hm2_5i20.0.encoder.00.position - hm2_5i25.0.stepgen.00.position-fb < +-10
Last edit: 17 Mar 2019 03:08 by Emanresu.

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

More
17 Mar 2019 03:17 #128798 by PCW
You need a PID loop to add the linear encoder feedback to the control loop,
and set the tuning parameters.

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

More
17 Mar 2019 03:42 #128799 by Emanresu
Well, i dont wona control any motion.
I just wish to compare encoder and stepgen.
Activating the EMC PID just wastes my Setup.

For for homing, i sent my Z encoder Signal to HomeSW. Which works. But it would be better if it works from the encoder input itself tho.

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

More
17 Mar 2019 10:34 - 17 Mar 2019 10:48 #128810 by Richard J Kinch

Emanresu wrote: But i wona use my linear-scales for Ferror, DRO and indexing. ... Is there a way to do this without the EMC PID?


This is what I've termed "adaptive positioning", to reach an position goal that is non-linear, hysteric, and measured independently of the motion apparatus. My analysis is that it can't be achieved with any feedback method that LinuxCNC currently provides because of hysteresis between the axis motor and linear scales (cf the unsolved "two-encoder problem"). Adaptive positioning requires implementing another feedback layer that is not PID, but instead one-sided, which I have achieved (but not yet published, 600 lines of G-code hackery!) in G-code subroutines. I explained the method in G-pseudocode in the forum thread Clarification of subroutine return data . Lately I'm thinking this would be best done in a Python add-on library of subroutines.
Last edit: 17 Mar 2019 10:48 by Richard J Kinch.

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

More
17 Mar 2019 12:59 - 17 Mar 2019 13:25 #128816 by Emanresu
deleted *unnecessary*
Last edit: 17 Mar 2019 13:25 by Emanresu.

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

More
17 Mar 2019 13:23 - 17 Mar 2019 13:30 #128818 by Emanresu
I hope this helps you too @Richard J Kinch!


OOHHH!!!

There is a NEAR Component in HAL!

Please correct me, if im wrong:

loadrt near
addf near.0 servo-thread
setp near.0.scale 1.01

net *example0* hm2_5i25.0.encoder.00.position => near.0.in1
net *example2* axis.0.motor-pos-cmd => near.0.in2
net *example3* hm2_5i25.0.stepgen.00.enable <= near.0.out ( or maybe axis.0.neg-lim-sw-in. Whatever creates a rapid STOP )

If im right i just have to figure out, if i better use position or velocity and so on right?

If that works, we finaly have a dual encoder setup :) (kinda)
Last edit: 17 Mar 2019 13:30 by Emanresu.

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

More
18 Mar 2019 08:23 #128876 by Richard J Kinch

Emanresu wrote: If im right i just have to figure out, if i better use position or velocity and so on right?


Sorry, not right. Detecting the error (the inverse of "nearness") is easy (in HAL, Python, G-code, take your pick), but that is not the problem. The problem is the motion control algorithm must be both stable and precise despite the hysteresis of the mechanical action. PID is necessarily unstable to twice the magnitude sum of all hysteresis in the system. A different feedback control algorithm is needed, which LinuxCNC does not provide, such as my pseudocode.

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

Time to create page: 0.077 seconds
Powered by Kunena Forum