Expand description
One axis as PLCopen motion sees it: the function blocks MC_Power, MC_Home, MC_MoveAbsolute, MC_MoveRelative, MC_Stop and MC_Reset, and of synchronised motion MC_GearIn, MC_GearOut, MC_CamIn and MC_CamOut, as handshake variables, and the axis state machine behind them.
Each axis runs its own profile here and the link streams the positions to the controller with
Command::Setpoint, one per setpoint interval, as a PLC drives servo drives over a fieldbus. So axes move
independently and at the same time, MC_Stop brakes in the middle of a move, and a new move takes over from
the one under way at the position and speed the axis has.
The profile is a trapezoid: velocity, acceleration and deceleration are kept, jerk is not. The controller interpolates linearly between the streamed setpoints, so within one interval the speed is constant anyway. Parameters above the axis limits are cut to the limits.
Synchronised motion (PLCopen Motion Control Part 1): the blocks sit in the slave’s folder and name their master by
its axis id (GearIn.Master, CamIn.Master). The slave follows the master’s setpoint (MasterValueSource
mcSetValue) in the same setpoint interval, the master moved first (advance_all). MC_GearIn brings the slave’s
speed to the ratio times the master’s with its Acceleration (its Deceleration where the slave has to slow down),
then holds the slave on the master’s travel times the ratio: InGear. MC_CamIn holds the slave on the cam table at
the master’s position from its start: InSync. The table is the client’s (CamIn.Table, CamTableID 0) or the
machine’s own electronic cam for this axis (CamTableID 1, Machine::cam), whose master may also be the machine’s
virtual one (CamIn.Master empty), run up to the cam’s master speed. MC_GearOut and MC_CamOut end the coupling:
the slave goes on at its speed (ContinuousMotion) until another block takes it over. Another block started on the
slave aborts the coupling; a master that goes into ErrorStop or Disabled ends it with an error, the slave braking.
Structs§
- Axis
- Fb
- A function block’s inputs and outputs.
Activereads the same asBusy: there is no buffering.doneis MC_GearIn’sInGearand MC_CamIn’sInSync, true besidebusywhile the slave is coupled.
Enums§
- State
- PLCopen axis states, numbered as in TwinCAT’s
MC_AxisStates.
Constants§
- ERR_
BUSY - ERR_
CRASH - The drives went off because the machine ran into an obstacle (effects.crash).
- ERR_
DRIVES_ OFF - ERR_
MASTER - MC_GearIn, MC_CamIn: no axis of that id, the slave itself, a master that is a slave itself, or no virtual master (the machine has no cam); or the master went into ErrorStop or Disabled while coupled.
- ERR_
NOT_ POWERED ErrorIDvalues.- ERR_
PARAMETER - ERR_
RANGE - ERR_
REFUSED - ERR_
STATE - ERR_
TABLE - MC_CamIn: the client’s cam table cannot be read, or the machine has no cam of its own (CamTableID 1).
- FBS
- The function blocks with an
Executeinput, in this order, and their numeric inputs. - TEXTS
- The text inputs, block and name: the master’s axis id and the client’s cam table.
Functions§
- advance_
all - One setpoint interval
tof every axis (Axis::advance,setpointswhere the controller’s setpoint stands for each): the axes that follow no axis first, then the slaves at their masters’ new places. - cam_
table - A cam table as the client writes it (
CamIn.Table): lines of segmentsmaster span, slave rise, law(the laws ofLaw::from_name), or of pointsmaster, slave[, slope](sim_components::cam::parse_table).Nonewhere it cannot be read. - execute_
in Executeof blockkof axisiwritten (Axis::execute), with MC_GearIn’s and MC_CamIn’s master found amongaxesby its id: not the slave itself, and no slave of an axis itself (ERR_MASTERelse); an empty id is the machine’s virtual cam master (MC_CamIn only).