Machinekit Documentation

HAL Component — LGANTRY


All instantiable components can be loaded in two manners

Using loadrt with or without count= | names= parameters as per legacy components
Using newinst, which names the instance and allows further parameters and arguments
primarily pincount= which can set the number of pins created for that instance (where applicable)


lgantry — Machinekit HAL component for driving multiple joints from a single axis




loadrt lgantry
newinst lgantry <newinstname> [ pincount=N | iprefix=prefix ] [instanceparamX=X | argX=X ]

( args in [ ] denote possible args and parameters, may not be used in all components )


Drives multiple physical motors (joints) from a single axis input .LP The `pincount' value is the number of joints to control. Two is typical, but up to seven is supported (a three joint setup has been tested with hardware). .LP All controlled joints track the commanded position (with a per-joint offset) unless in the process of latching. Latching is when the commanded position is moving away the from the homing switches (as determined by the sign of search-vel), the joint home switches are not all in the same state and homing is active. When the system is latching and a joint home switch deactivates, the command value sent to that joint is "frozen" and the joint offset value is updated instead. Once all home switches are deactivated, there are no more adjustments made to the offset values and all joints run in lock-step once more. .LP For best results, set HOME_SEARCH_VEL and HOME_LATCH_VEL to the opposite direction and as slow as practical. When a joint home switch trips, the commanded velocity will drop immediately from HOME_SEARCH_VEL to zero, with no limit on accleration. .LP The latching gantry component is the opposite of the normal gantry component. It makes sense to use it with home switches that have a reproduceable deactivation hysteresis. .LP Using the per joint home-offset input it is possible add a small offset when latching. This makes it possible to adjust small differences in the endstop positions of the gantry setup. .LP The homing input must be connected to the axis homing output motion in order to enable the gantry component. When the axis is not homing latching will not be activated.

FUNCTIONS ( OR <newinstname>.read.funct (requires a floating-point thread) )

Update position-fb and home/limit outputs based on joint values

lgantry.N.write.funct ( OR <newinstname>.write.funct (requires a floating-point thread) )

Update joint pos-cmd outputs based on position-cmd in


lgantry.N.joint.%02d.pos-cmd float out (MM=00..pincount) ( OR <newinstname>.joint.%02d.pos-cmd float out (MM=00..pincount) ) - Per-joint commanded position

lgantry.N.joint.%02d.pos-fb float in (MM=00..pincount) ( OR <newinstname>.joint.%02d.pos-fb float in (MM=00..pincount) ) - Per-joint position feedback

lgantry.N.joint.%02d.home bit in (MM=00..pincount) ( OR <newinstname>.joint.%02d.home bit in (MM=00..pincount) ) - Per-joint home switch

lgantry.N.joint.%02d.home-offset float in (MM=00..pincount) ( OR <newinstname>.joint.%02d.home-offset float in (MM=00..pincount) ) - Per-joint home offset for fine tuning

lgantry.N.joint.%02d.offset float out (MM=00..pincount) ( OR <newinstname>.joint.%02d.offset float out (MM=00..pincount) ) - (debugging) Per-joint offset value, updated when homing

lgantry.N.position-cmd float in ( OR <newinstname>.position-cmd float in ) - Commanded position from motion

lgantry.N.position-fb float out ( OR <newinstname>.position-fb float out ) - Position feedback to motion

lgantry.N.homing bit in ( OR <newinstname>.homing bit in ) - Axis homing state from motion

lgantry.N.home bit out ( OR <newinstname>.home bit out ) - Combined home signal, true if all joint home inputs are true

lgantry.N.limit bit out ( OR <newinstname>.limit bit out ) - Combined limit signal, true if any joint home input is true float in ( OR <newinstname>.search-vel float in ) - HOME_SEARCH_VEL from ini file


pincount int (default: 7)