The number that matters is the accumulated encoder count, not the displayed zero. With scaling of 300,000 pulses per software unit, MC_SetPosition can move the visible coordinate to zero while an underlying count such as dwActPosition continues accumulating toward its numeric limit. Apply MC_SetPosition to the logical encoder axis, and use that same logical axis exclusively as the CAM or gear master. MC_Home is not the reset method for this encoder arrangement.
Reading the Position Discontinuity
The reported sequence controls 12 motors from an LMC078, with a SoftMotion encoder below IME_EncIn and a logical drive in the device tree. Camming couples each physical slave to the encoder-derived master. When the master coordinate suddenly changes from a large positive value to a negative value, the slaves interpret the change as real motion and attempt to recover the new commanded relationship. The resulting deceleration or reversal produces the machine jerk.
A zero shown in factPosition immediately after MC_SetPosition proves that a coordinate was shifted; it does not prove that every upstream count was cleared. Trend the displayed coordinate, dwActPosition, the logical-axis position, the CAM master position, and at least one slave position in the same motion-task capture. The first signal that makes the positive-to-negative transition identifies the coordinate path exposing the rollover.
| Quantity | Known value or limit | Where to read it | Diagnostic meaning |
|---|---|---|---|
| Encoder scaling | 300,000 pulses per software unit | Logical encoder scaling configuration | Equivalent resolution is 1/300,000 software unit per pulse. |
| Displayed position | Reset target: zero |
factPosition and logical-axis status |
A successful coordinate shift can occur without clearing the raw count. |
| Accumulated count | Numeric boundary depends on its declared data type |
dwActPosition, variable declaration, and controller documentation |
A sign change at the boundary indicates rollover. |
| Master discontinuity | Any unexpected cycle-to-cycle jump | Position actually selected by the CAM or gear function | A jump propagates directly into the slaves' commanded relationship. |
| Axis reference | One logical encoder axis | Online instance paths for set-position and coupling blocks | Different references create separate coordinate frames. |
Raw Counts and Logical Coordinates
This is numeric range and trajectory continuity, not motor current. Conceptually, a logical position is formed from the scaled raw count plus a coordinate offset:
logical position = raw encoder count / 300000 + coordinate offset
Setting the position to zero can change the offset so that the logical coordinate becomes zero at the current raw count. The hardware-facing accumulator may continue counting because clearing it would break input acquisition or discard the encoder's physical reference. That separation explains why factPosition can change while dwActPosition does not.
At the accumulator's positive numeric boundary, the next increment can appear as a negative value. The exact boundary must come from the declared type and the LMC078 diagnostic or programming documentation; the variable name alone is not enough to assign a width. Position scaling changes how quickly the application consumes software units, but it does not enlarge the underlying numeric type.
The CAM reacts to the position source wired to its master input. If that source is the hardware-facing encoder object or another coordinate that exposes the rollover, resetting a separate logical axis cannot protect the slaves. One axis instance must own both operations: the position reset and the master coordinate supplied to every CAM or gear relationship.
Logical-Master Correction Procedure
Identify the exact axis instance currently connected as the master of every CAM and gear operation. Record its full online instance path rather than relying on similar device-tree names.
Identify the axis reference passed to
MC_SetPosition. Compare that instance path with the logical encoder axis. If it points toIME_EncIn, a physical encoder object, a logical drive, or any other axis instance, redirect it to the logical encoder axis.Use only the logical encoder axis as the master for downstream CAM and gear operations. Remove parallel references that allow a slave coupling block to read the physical encoder coordinate directly.
Command
MC_SetPositionagainst the logical encoder axis at the intended sequence boundary. Set its coordinate to zero and confirm completion through the function block's normal status outputs before advancing the sequence.Keep
MC_Homeout of this reset sequence. Homing establishes a machine reference for axis types that implement a homing procedure; it is not the applicable operation for this encoder object.Test the sequence with the slave coupling disabled or under the machine's controlled commissioning conditions. Trend raw input, logical master, coupling state, and slave command together before restoring production motion.
The reset event must also be placed at a valid motion-state boundary. Changing the coordinate of an actively coupled master creates a commanded discontinuity unless the coupling implementation explicitly applies the new coordinate frame without changing the slave relationship. Decouple, reset, and recouple when the application cannot prove continuity through an online coordinate change.
Verification at the Rollover Boundary
First verify axis identity. Online monitoring must show that the axis receiving MC_SetPosition is the same logical encoder axis consumed by every coupling block. A successful block completion on another axis is not a valid test.
Next repeat the forward-motion and zero-reset cycle while recording all relevant positions. Each reset should move the logical master to zero without a corresponding jump in the slave command. dwActPosition may continue increasing; that is acceptable when the CAM master remains continuous and no raw rollover is exposed downstream.
Continue the test long enough to cross the count region where the failure previously occurred. Verify three results: the logical master follows the intended reset sequence, the slave command has no unexpected positive-to-negative step, and the slave following diagnostic remains within the machine's accepted commissioning limits. Also check the LMC078 diagnostic buffer at the event time for axis, arithmetic, or coupling diagnostics.
Recurring Integration Pitfalls
Matching names treated as matching objects: A physical input, SoftMotion encoder, logical encoder, and logical drive can expose similar position fields while maintaining different state. Compare full references online.
Displayed zero treated as a cleared accumulator:
MC_SetPositionchanges an axis coordinate. Use the raw-count trend to determine whether the input accumulator continues running.Mixed master references: One slave may use the logical axis while another consumes the encoder-facing axis. Audit all 12 motor relationships rather than correcting only the first CAM.
Reset during active coupling: Even a deliberate coordinate change can become an instantaneous slave command. Coordinate the decouple-reset-recouple sequence with the motion state.
Scaling used as overflow protection: The 300,000-pulse scaling defines engineering units; it does not change the storage capacity of the raw accumulator.
Firmware defect declared before reference tracing: Capture the first variable that rolls over, its declared type, the axis instance paths, the coupling state, and the controller diagnostics. Those records separate an exposed raw rollover from an internal logical-axis failure.
FAQ
What happens if MC_SetPosition resets factPosition but not dwActPosition?
The logical coordinate can show zero while the hardware-facing count continues accumulating. This is acceptable only when the logical encoder axis is the sole CAM or gear master and its coordinate remains continuous.
What happens if the physical encoder is used directly as the CAM master?
A raw positive-to-negative rollover can enter the CAM calculation as a real master-position jump. Coupled slaves may stop abruptly or reverse their correction to match the new coordinate.
What happens if MC_SetPosition is called while the slaves are cammed?
A coordinate step can immediately change the slaves' commanded relationship. Use a controlled decouple-reset-recouple sequence unless online trending proves that the selected coupling path preserves continuity.
When should an LMC078 encoder overflow be escalated?
Stop commissioning if the logical encoder axis itself rolls over after the axis references are corrected, or if a slave still receives a discontinuous command that can cause equipment damage or injury. Send Schneider Electric's official motion support the controller project, device tree, diagnostic buffer, declared type of dwActPosition, and synchronized traces covering the reset and rollover.