3 / 16 · Foundations

Axis states and drive enable

Read the state machine before issuing commands or attempting fault recovery.

Stationary does not always mean ready

A carriage has stopped. Its velocity reads zero, but a new move is rejected. If MC_Stop still holds the axis, the state can remain Stopping. Standstill has a different command-permission meaning. Read the state before deciding that the controller is ignoring your move.

The PLCopen single-axis state model describes how operations take control of an axis. It is separate from your machine sequence: a machine step called Loading can contain an axis in Standstill, DiscreteMotion or ErrorStop at different times.

StateTypical meaningA question before the next action
DisabledAxis drive enable is absentIs power permission available?
StandstillEnabled, with no active travel operationIs the coordinate valid and the machine ready?
HomingA reference operation is executingWhat ends the search, and what bounds it?
DiscreteMotionA positioning operation is executingWhich instance owns the target?
ContinuousMotionA continuous travel operation is executingWhich command will terminate it?
SynchronizedMotionAxis follows a master relationshipHow will it engage and leave synchronization?
StoppingStop operation is decelerating or holding controlHas Execute been released?
ErrorStopAxis reports a fault stateWhat caused it and what recovery is permitted?

TryPLC's current single-axis runtime does not implement SynchronizedMotion. The gearing and cam benches are mathematical models, so their drawings must not be interpreted as that state being executed by the ST engine.

Enable is level-driven

MC_Power uses Enable. Call it cyclically with the required enable permission. Its Status reports the runtime's power-enable result; consult the vendor for any separate direction-enable inputs, regulator-enable signals or drive status conditions.

A motion request should depend on readiness, but readiness also includes machine conditions outside MC_Power: a valid coordinate, tooling position, permission to enter the destination and the sequencer's ownership of the axis. MC_Power is not a safety permission and does not verify a clamp.

VAR
    FeedAxis : AXIS_REF;
    PowerFeed : MC_Power;
    MoveFeed : MC_MoveAbsolute;
    EnableRequest : BOOL;
    MoveRequest : BOOL;
END_VAR

PowerFeed(Axis := FeedAxis, Enable := EnableRequest);
MoveFeed(Axis := FeedAxis,
    Execute := MoveRequest AND PowerFeed.Status,
    Position := 200.0, Velocity := 100.0,
    Acceleration := 200.0, Deceleration := 200.0);

This listing shows call order and binding, not a complete machine controller. If a request stays high while Status changes from false to true, the expression passed to Execute can produce a rising edge. Decide whether your machine permits that delayed start. A latched operator request needs an explicit cancellation path.

Refusal and axis fault are different

A move with an invalid parameter can report Error without the physical drive being faulted. A drive fault can place the axis in ErrorStop. Record function-block ErrorID and the separate axis or drive fault information before choosing a reset action.

MC_Reset clears an axis fault through the vendor's supported recovery operation. It does not repair a cable, release a mechanical obstruction or establish a lost home reference. Repeatedly executing Reset every scan can hide the event sequence and cause unwanted repeated attempts.

Bench investigation

Issue Move Execute while the drive is disabled, then advance one scan. The bench reports ErrorID 1, its local code for an unpowered axis. These small teaching error numbers are not Beckhoff, Siemens or CODESYS diagnostic numbers. Enable the drive, lower Execute, advance a scan and raise it again. A new rising edge retries the command.

During motion, activate MC_Stop Execute. After velocity reaches zero, observe Stopping. Lower Stop Execute and advance scans before requesting another move. The bench deliberately demonstrates the lock; it does not model all vendor Busy-release timing.

Recovery worksheet

For a faulted feeder, record the last requested station, current feedback, current state, command outcome and product location. Then define the conditions for clearing the fault and for permitting a separate restart. Keep those actions separate. A cleared fault should not automatically start travel just because an old request remains true.

References

PLCopen specifications contain the state diagram. Beckhoff general motion rules explain function-block lifecycles and implementation details.

Check your reasoning

Zero velocity with MC_Stop.Execute held TRUE can mean:

  • Always Disabled
  • Stopping and locked
  • Always Standstill
Worked answer

Stopping and locked. State describes command permissions as well as movement.

A command is refused with a bad parameter. Should every refusal trigger MC_Reset?

  • No; diagnose the command error first
  • Yes, every scan
  • Disable all diagnostics
Worked answer

No; diagnose the command error first. A function-block error need not be a drive fault or an axis ErrorStop.