Question: P value with MESA Setup without encoders
17 Mar 2023 09:43 #266897
by 5G-antry
Question: P value with MESA Setup without encoders was created by 5G-antry
Hi all,
I build up a 3 axis CNC milling tool with a MESA 7I76E based on LCNC 2.8.
The machine consists of closed-loop stepper motors, so no encoder feedback is given to the MESA or LCNC.
Due to a research project at my university, I am playing around with latency-loaded wireless networks. I managed to get the machine tool controlled wirelessly, but I have a question. When using PNCconf, "P" is set to 1000 by default. So to work with latency-loaded communication, the servothread is increased, and thus I decrease the P value.
However, why is the P value needed at all?
With P=0 the machine tool is running too (at least there is no control error, the resulting manufacturing quality has not yet been investigated).
In another thread, this was already discussed a little bit. However, I do not unterstand, why the setup then works with P=0.
forum.linuxcnc.org/39-pncconf/33320-how-...mesa-5i25-7i76-setup
Can you please help me in understanding the problem?
Should this already been answered in the forum, I am sorry for my lack of research skills.
I build up a 3 axis CNC milling tool with a MESA 7I76E based on LCNC 2.8.
The machine consists of closed-loop stepper motors, so no encoder feedback is given to the MESA or LCNC.
Due to a research project at my university, I am playing around with latency-loaded wireless networks. I managed to get the machine tool controlled wirelessly, but I have a question. When using PNCconf, "P" is set to 1000 by default. So to work with latency-loaded communication, the servothread is increased, and thus I decrease the P value.
However, why is the P value needed at all?
With P=0 the machine tool is running too (at least there is no control error, the resulting manufacturing quality has not yet been investigated).
In another thread, this was already discussed a little bit. However, I do not unterstand, why the setup then works with P=0.
forum.linuxcnc.org/39-pncconf/33320-how-...mesa-5i25-7i76-setup
Can you please help me in understanding the problem?
Should this already been answered in the forum, I am sorry for my lack of research skills.
Please Log in or Create an account to join the conversation.
17 Mar 2023 13:57 #266913
by PCW
Replied by PCW on topic Question: P value with MESA Setup without encoders
The way the Mesa hardware step generators work is that every servo thread
invocation, the step generator hardware is given a new velocity. Without feedback
(via the PID controller) the hardware position would slowly drift because of clock
speed and timing differences between LinuxCNC and the step generator hardware.
The PID controller gets feedback from the actual (fractional) step position and corrects for
these small differences. It can also be used to correct for read/update delays (by setting
FF2 to the time from position read to velocity write)
invocation, the step generator hardware is given a new velocity. Without feedback
(via the PID controller) the hardware position would slowly drift because of clock
speed and timing differences between LinuxCNC and the step generator hardware.
The PID controller gets feedback from the actual (fractional) step position and corrects for
these small differences. It can also be used to correct for read/update delays (by setting
FF2 to the time from position read to velocity write)
The following user(s) said Thank You: 5G-antry
Please Log in or Create an account to join the conversation.
20 Mar 2023 09:48 #267129
by 5G-antry
Replied by 5G-antry on topic Question: P value with MESA Setup without encoders
Thank you for you answer and sorry for my late response
One question, maybe I do not understand it correctly:
How does the PID controller in LinuxCNC get the feedback from the actual position?
In my understanding, there is no bidirectional communication between the drivers of the stepper motors and the MESA. Is this "actual" position calculated from the stepper generators of the MESA?
One question, maybe I do not understand it correctly:
How does the PID controller in LinuxCNC get the feedback from the actual position?
In my understanding, there is no bidirectional communication between the drivers of the stepper motors and the MESA. Is this "actual" position calculated from the stepper generators of the MESA?
Please Log in or Create an account to join the conversation.
20 Mar 2023 15:51 #267160
by PCW
Replied by PCW on topic Question: P value with MESA Setup without encoders
Yes, the stepgenerator hardware provides feedback position.
The following user(s) said Thank You: 5G-antry
Please Log in or Create an account to join the conversation.
22 Mar 2023 10:19 #267290
by 5G-antry
Replied by 5G-antry on topic Question: P value with MESA Setup without encoders
Thank you.
Brief check up question:
This feedback postition is calculated internally by the MESA, isnt it? How can the MESA be sure that the position is correct?
Maybe I have understanding issues but the drivers of the stepper motors already control the position of the motors. So how does the MESA know if a control step occured upfront.
Brief check up question:
This feedback postition is calculated internally by the MESA, isnt it? How can the MESA be sure that the position is correct?
Maybe I have understanding issues but the drivers of the stepper motors already control the position of the motors. So how does the MESA know if a control step occured upfront.
Please Log in or Create an account to join the conversation.
22 Mar 2023 14:54 #267306
by PCW
Replied by PCW on topic Question: P value with MESA Setup without encoders
The step generator keeps track of the steps it
generates but it does not know if the drive is following
the step commands (though drives with feedback
usually have an error output that can indicate
following errors.)
generates but it does not know if the drive is following
the step commands (though drives with feedback
usually have an error output that can indicate
following errors.)
The following user(s) said Thank You: 5G-antry
Please Log in or Create an account to join the conversation.
03 Apr 2023 07:32 - 03 Apr 2023 07:35 #268151
by 5G-antry
Replied by 5G-antry on topic Question: P value with MESA Setup without encoders
Sorry for my long time to answer.
Thank you, now I get it and understand the behavior!
One further question.With ~ 1 – 2 ms End-to-End latency and basically no Jitter, I can let the machine tool run “stable”.
For this, the watchdog of the Mesa and the servo thread are set higher than default.
However, if I want to initialize the connection with the mesa card with higher latency, I run into a timeout and LinuxCNC will not start at all.
In my opinion, it is due to the firmware. To be precise: “hm2_eth.c” of the firmware triggers the error. The error codes are attached (console_output.txt and the debug.txt) My idea is to adapt the code of “hm2_eth.c”.
I am no C Expert, but it It should have something to do with line 452 – 454 in the code (source: github.com/LinuxCNC/linuxcnc/blob/master...a-hostmot2/hm2_eth.c)
Is this correct? And is my approach purposeful? I know that this is not good regarding safety, but that is currently not a problem.If I want to change the C code of the firmware, how can I build/make the matching .bit-file?If my issue is “deeper”, you can feel yourself free to correct me
If I should open a new thread, I can do that too.
Best regards and thank you!
Thank you, now I get it and understand the behavior!
One further question.With ~ 1 – 2 ms End-to-End latency and basically no Jitter, I can let the machine tool run “stable”.
For this, the watchdog of the Mesa and the servo thread are set higher than default.
However, if I want to initialize the connection with the mesa card with higher latency, I run into a timeout and LinuxCNC will not start at all.
In my opinion, it is due to the firmware. To be precise: “hm2_eth.c” of the firmware triggers the error. The error codes are attached (console_output.txt and the debug.txt) My idea is to adapt the code of “hm2_eth.c”.
I am no C Expert, but it It should have something to do with line 452 – 454 in the code (source: github.com/LinuxCNC/linuxcnc/blob/master...a-hostmot2/hm2_eth.c)
Is this correct? And is my approach purposeful? I know that this is not good regarding safety, but that is currently not a problem.If I want to change the C code of the firmware, how can I build/make the matching .bit-file?If my issue is “deeper”, you can feel yourself free to correct me
If I should open a new thread, I can do that too.
Best regards and thank you!
Last edit: 03 Apr 2023 07:35 by 5G-antry.
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 19203
- Thank you received: 6437
03 Apr 2023 10:40 #268163
by tommylight
Replied by tommylight on topic Question: P value with MESA Setup without encoders
What are you trying to achieve?
What is the end goal?
I know for sure Mesa ethernet boards work with a servo period from 250000 up to 4000000, what period are you trying to use?
The error attached is usually due to ethernet on the host PC not being set up correctly.
What is the end goal?
I know for sure Mesa ethernet boards work with a servo period from 250000 up to 4000000, what period are you trying to use?
The error attached is usually due to ethernet on the host PC not being set up correctly.
Please Log in or Create an account to join the conversation.
03 Apr 2023 14:37 #268177
by 5G-antry
Replied by 5G-antry on topic Question: P value with MESA Setup without encoders
The setup is part of a research project at my university.
The goal is to have a wireless connection between LCNC and the MESA card based on a wireless token system for time-deterministic communication.
Currently, the machine works with 2ms latency and 0.2ms Jitter (Servothread 4ms; MESA Watchdog 10 or 15 ms). However, the hostmot2 firmware just loads up to a latency of 1ms and Jitter of 0.1ms due to an internal (I think hard coded (?)) "fail safe". My understanding is that the error occur when the inital time out of the packets (time between packets) is too long.
I know that this behaviour is totaly fine and correct. However, I want to "deactivate" or set this time out higher.
Just for understanding: I tested the described behaviour with the "netem" function (man7.org/linux/man-pages/man8/tc-netem.8.html). I added this to the real time kernel. It is not part of the kernel of the current stable LCNC version.
The goal is to have a wireless connection between LCNC and the MESA card based on a wireless token system for time-deterministic communication.
Currently, the machine works with 2ms latency and 0.2ms Jitter (Servothread 4ms; MESA Watchdog 10 or 15 ms). However, the hostmot2 firmware just loads up to a latency of 1ms and Jitter of 0.1ms due to an internal (I think hard coded (?)) "fail safe". My understanding is that the error occur when the inital time out of the packets (time between packets) is too long.
I know that this behaviour is totaly fine and correct. However, I want to "deactivate" or set this time out higher.
Just for understanding: I tested the described behaviour with the "netem" function (man7.org/linux/man-pages/man8/tc-netem.8.html). I added this to the real time kernel. It is not part of the kernel of the current stable LCNC version.
Please Log in or Create an account to join the conversation.
03 Apr 2023 14:58 - 03 Apr 2023 14:59 #268179
by PCW
Replied by PCW on topic Question: P value with MESA Setup without encoders
There is no hardware latency setting in the hostmot2 firmware. The hm2_eth driver does
time-out RX packets when the delay is more than a given percentage of the servo thread period.
The driver will also give up if timeouts occur at higher than a certain rate relative to
good transactions. This behaviour is all programmable with hm2_eth setup parameter and pins.
man hm2_eth
time-out RX packets when the delay is more than a given percentage of the servo thread period.
The driver will also give up if timeouts occur at higher than a certain rate relative to
good transactions. This behaviour is all programmable with hm2_eth setup parameter and pins.
man hm2_eth
Last edit: 03 Apr 2023 14:59 by PCW.
The following user(s) said Thank You: 5G-antry
Please Log in or Create an account to join the conversation.
Time to create page: 0.084 seconds