Repository navigation
Replies: 2 comments 1 reply
|
Makes me wonder if we should have adopted cia402 component in linuxcnc rather than linuxcnc-ethercat... |
0 replies
|
In addition to limit3 there is also simple_tp: |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
LinuxCNC already drives axes that are not interpolated by the trajectory planner: extra joints
(
motmod num_extrajoints=,joint.N.posthome-cmd) and drives in HAL-only configurations. Today thein-tree tool for that is
limit3: it follows an input with position/velocity/acceleration limits, but ithas no notion of a command. The logic around it cannot tell when a move is done (a
nearguesses), cannothalt a move (dropping
enabledrives the output to 0), does not see a following error or a drive fault,and clips a target outside the limits instead of refusing it.
mc_axisis the axis of PLCopen Motion Control Part 1 — the model PLC programmers already know — as aplain HAL component, one instance per axis:
power(MC_Power),execute+mode/position/velocity/acceleration/deceleration/jerk(MC_MoveAbsolute / MC_MoveRelative / MC_MoveVelocity),halt,stop,reset,home(the drive's own homing, CiA-402),set-position(MC_SetPosition);busy,done,active,command-aborted,error,error-id,axis-error-id,in-velocity,state(PLCopen state diagram: Disabled, Standstill, Homing, DiscreteMotion,ContinuousMotion, Stopping, ErrorStop), plus command numbers (
command-id,done-id,aborted-id,failed-id) so that several callers can share one axis;a drive fault or a drive leaving operation-enabled puts the axis into ErrorStop;
resetleaves it;drive-profilehands a move to a drive in CiA-402 Profile Position.Wiring to an extra joint is the same three nets as with
limit3(pos-cmd→joint.4.posthome-cmd,joint.4.pos-fb→pos-fb,joint.4.homed→stat-op-enabled); to an EtherCAT drive it is thecia402component of linuxcnc-ethercat (nets in the man page notes).Why in LinuxCNC: it lets LinuxCNC run PLC-style machines without G-code — positioners, pallet handlers,
conveyors, a rotary table beside a mill — with the axis semantics a PLC has; logic on top (ladder, or
anything that writes HAL pins) only raises
executeand readsdone/error.Field run (2026-10-06). Inovance SV660N servo on EtherCAT (linuxcnc-ethercat, cyclic synchronous
position),
mc_axis+cia402, LinuxCNC 2.10 uspace. Buttons drove the same HAL pinsthrough our PLC layer (not part of this proposal). MC_SetPosition 0 at 1333.46° without motion, then
(axis position, degrees):
done;done;Drive encoder 31071849 → 33403250 (+2331401 counts ≈ 100.05° × 23301.69 counts/°) → 31071713, so the
shaft really moved; no drive fault (statusword bit 3) during the run. With
powerheld at 0 the drive wasnever enabled (statusword 0x1650 throughout).
On the branch:
src/hal/components/mc_axis.comp(man page fromdescription/notes), a row indocs/src/hal/components.adoc,docs/po4a.cfg;tests/mc-axis/— power, MoveAbsolute (Done, velocity ≤ maxv), Halt (the move CommandAborted, the haltDone), a target outside the soft limits refused without motion, SetPosition, MoveRelative,
MoveVelocity + Halt, drive fault → ErrorStop → Reset, power off. Pins through
hal.set_p/get_p,every wait on a HAL state, one
timeoutintest.sh; the component is built in-tree, so noskip;configs/sim/axis/extrajoints/mc_axis.{ini,hal,txt}—1extrajointwithmc_axisinstead oflimit3,sim_pinbuttons for position / execute / halt / reset.runtests on the branch (master
7f67ef2e4, uspace, Ubuntu 24.04, no sudo):tests/mc-axis1/1 passed(22 checks);
tests/limit3+tests/halcompile17/17 passed; halcompile of the component without warnings.Branch: https://github.com/SyncTwin/linuxcnc/tree/synctwin/mc-axis
Question: would you take
mc_axisinto the tree, next tolimit3? If yes I'll open a PR againstmaster. Opinions on naming (pins;
mc_axisvs e.g.plcopen_axis) and on scope (e.g. leavingdrive-profilefor a later PR) are welcome.All reactions