Chinise mesa clone vs Original vs Ethercat

More
02 Aug 2026 20:34 #348394 by tuxcnc
Replied by tuxcnc on topic Chinise mesa clone vs Original vs Ethercat

hi,
with Pulse and direction top speed and precision calculus are clear  but

But how to calculate the bandwidth on a Ethercat servo drive and precision?
let say leadscrew pitch 0.100inch encoder servo 10000 ppr?
if bus cycle time is 1000000 and refClockSyncCycles=1
how to determine the top speed IPM and minimal resolution in  Inches (minimal cut).
 

In amateur machines, none of this matters.
You can count it for hours and buy a Chinese ball screw with a backlash  0.1 mm like me...
The following user(s) said Thank You: leexi

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

More
03 Aug 2026 06:19 #348403 by NWE

hi,
with Pulse and direction top speed and precision calculus are clear  but

But how to calculate the bandwidth on a Ethercat servo drive and precision?
let say leadscrew pitch 0.100inch encoder servo 10000 ppr?
if bus cycle time is 1000000 and refClockSyncCycles=1
how to determine the top speed IPM and minimal resolution in  Inches (minimal cut).
 

With ethercat servo drive operating in velocity mode, your main limitation will be the servo's rated/max speed. The resolution limitation will be time based, if I'm correct LinuxCNC EtherCAT will have something like a 2mS feedback latency on a 1mS thread, so this will limit your positioning accuracy during very fast moves. I am not aware that a regular machine tool is capable of reaching this speed limit.
Here is a detailed explanation how it is timed.  
The following user(s) said Thank You: leexi

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

More
03 Aug 2026 15:41 #348417 by PCW
For velocity mode servos (of any kind) one limitation is that the drive effectively does
linear interpolation between waypoints, so  you get what I would call a chord error
which depends on acceleration and servo thread rate.

For typical machine tool accelerations and  and say 1 KHz thread rates, this error is quite small
but machines that have high accelerations and need high precision may require either higher servo
thread rates or using second degree interpolation in the drive.


Chord error polygon vs circle =
R (1-cos(180/N))

R = radius
N = sides

R = Minimum Radius= V^2/A
N  = Sides = T_Circle/T_Sample

 
The following user(s) said Thank You: tommylight, leexi, NWE

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

More
04 Aug 2026 01:31 - 04 Aug 2026 02:07 #348431 by leexi
Replied by leexi on topic Chinise mesa clone vs Original vs Ethercat
Yes, this is very interesting.

and after reading

forum.linuxcnc.org/ethercat/58227-how-go...ion-control?start=20

From: NWE

this Make me feel that 1,000,000ns thread is slow for ethercat
But as the same time I start to fill myself in the place of look ahead reading paradigm where I can make interpolated circles as fast as my control system can respond on time without lose the path

Thinking in real world G0 at 200IPM and I never machine a part beyond 100 IPM, and high precision, this is not my goal, I guess I will need a controlled temp room for this propose and this is not my field. +-0.003inch it is fine.

My question is Ethercat is enough at 1khz thread to keep the path? ,or should I look for a 500,000 servo thread. Or less?

I have a system full LCNC and Ethercat control, my concern is, how to reach a 200IPM max speed and 0.0001 min resolution in a repeatable and stable motion system, I think now about what is on my control and what is not, what variables I can candle and what I cannot handle, and what is on my budget and what is not.
And as well I fill lack of experience and acknowledge on a perhaps non mature control method. Compared with analog or pulse and direction methods

compared with pulse and direction method mesa card at 100 or 200 kHz is enough for a 200 or 300 ipm at 0.0001inch min resolution. Where even with my parallel port 10kHz I was not far from my needs. And under this method I feel that I can handle all variables that the system have, and I can keep them under control.

But in the other hand I feel ethercat is the future, clean wiring, a lot information from servos and VFDs, closed loop etc. and every day you can find more and more equipment that offering this control method.

Someone has been working with smaller servo thread than 1,000,000ns.
someone on a multi thread CPU has been isolated the ethercat servo thread In one CPU thread, as the same is done with LCNC, Is that possible? Can be helpful?

Please share your experiences.
Last edit: 04 Aug 2026 02:07 by leexi.

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

More
09 Aug 2026 22:22 - 09 Aug 2026 22:26 #348620 by leexi
Replied by leexi on topic Chinise mesa clone vs Original vs Ethercat
With a new dual NIC PCIe intel 350 CPÜ intel i5 6 cores
I test this file to isolate some cpu tasks . Please have a look on it, make you comments please

this script acts as a fail-safe backup. It sweeps up the parent application threads, locks them to Core 3, and ensures that the human-machine interface (HMI/GUI) stays back on Cores 0–2 so it cannot starve the machine loop of processor time.
Automation Script
Open or make a script file (sudo nano /usr/local/bin/linuxcnc-rt-tune.sh)
#!/bin/bash
### ========================================================================
### LinuxCNC Real-Time Optimization Script (6 Threads, 3 Isolated Cores)
### Core Mapping: Core 3 (LinuxCNC), Core 4 (EtherCAT IRQs), Core 5 (Mesa IRQs)
### ========================================================================

# 1. Wait for network interfaces to fully come online
sleep 5

# 2. Bind EtherCAT Port Interrupts (Port 1: enp1s0f0) to Core 4 (Hex Mask 10)
for irq in $(cat /proc/interrupts | grep "enp1s0f0" | awk '{print $1}' | tr -d ':'); do
echo "Routing EtherCAT IRQ $irq to Core 4"
echo 10 > /proc/irq/$irq/smp_affinity 2>/dev/null
done

# 3. Bind Mesa Port Interrupts (Port 2: enp1s0f1) to Core 5 (Hex Mask 20)
for irq in $(cat /proc/interrupts | grep "enp1s0f1" | awk '{print $1}' | tr -d ':'); do
echo "Routing Mesa IRQ $irq to Core 5"
echo 20 > /proc/irq/$irq/smp_affinity 2>/dev/null
done

# 4. Wait for EtherCAT Master Daemon to launch, then pin it to Core 5 (Hex Mask 20)
for i in {1..30}; do
ETH_PID=$(pgrep ethercat)
if [ ! -z "$ETH_PID" ]; then
echo "Found EtherCAT Master (PID: $ETH_PID). Tasksetting to Core 5."
taskset -p 20 $ETH_PID
break
fi
sleep 1
done

# 5. Continuous Loop: Safely lock any running LinuxCNC instances to Core 3 (Hex Mask 08)
# This loops indefinitely in the background to catch LinuxCNC whenever it is started by the user.
echo "Starting continuous background monitor for LinuxCNC instances..."
while true; do
# Find the process ID for the real-time interaction layer (linuxcnc or rtapi)
LCNC_PID=$(pgrep -f "rtapi_app" || pgrep -f "linuxcnc")

if [ ! -z "$LCNC_PID" ]; then
# Check if it is already pinned to Core 3 to minimize CPU usage of this script
CURRENT_AFFINITY=$(taskset -p $LCNC_PID | awk '{print $NF}')
if [ "$CURRENT_AFFINITY" != "08" ] && [ "$CURRENT_AFFINITY" != "8" ]; then
echo "LinuxCNC instance detected (PID: $LCNC_PID). Locking safely to Core 3."
taskset -p 08 $LCNC_PID >/dev/null 2>&1
fi
fi
# Sleep for 5 seconds between checks to keep system overhead near zero
sleep 5
done

exit 0

Because we added an infinite loop to the end of the script to monitor for LinuxCNC starting up at any time, we need to change the systemd service type from oneshot to simple. This ensures systemd knows the script is intentionally running in the background.
• Open the service file:
sudo nano /etc/systemd/system/linuxcnc-rt-tune.service
• Update the contents to match this configuration:
[Unit]
Description=LinuxCNC EtherCAT and Mesa CPU Thread Affinity Tuner
After=network.target ethercat.service
Wants=ethercat.service

[Service]
Type=simple
ExecStart=/usr/local/bin/linuxcnc-rt-tune.sh
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target
• Save and exit the file, then apply the changes and restart the background tuner:
• sudo systemctl daemon-reload
• sudo systemctl restart linuxcnc-rt-tune.service

.hal fiel
And adding cpu_affinity=3 into your .hal file tells the internal motion controller what to do
loadrt motmod servo_period_nsec=1000000 cpu_affinity=3
addf motion-command-handler servo-thread
addf motion-controller servo-thread

and delate any: loadrt base-thread ( this is not need any more and takes more pc resources )
Last edit: 09 Aug 2026 22:26 by leexi.

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

More
11 Aug 2026 12:46 #348646 by rodw
The ethercat thread and linuxcnc thread should be the same, On startup, the 2 thread synchronise. If you use the ethercat drivers on the linuxcnc-ethercat github page, this has been improved with changes to linuxcnc and the ethercat master to improve this sync. You probably need master to get these changes.

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

More
11 Aug 2026 14:53 #348655 by besriworld
Replied by besriworld on topic Chinise mesa clone vs Original vs Ethercat
I wonder if there are two interfaces. For example, the X and Y axes are controlled by the Ethercat and the Z axis is controlled by a Mesa card, will there be synchronized movements?

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

More
11 Aug 2026 20:01 #348659 by rodw
Yes, there will be synchronized movement as its all controlled by Linuxcnc on the single servo thread

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

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