AutomateDirectUSAMotion LibraryIndustrial monitors & PCs

Troubleshooting

Why MC_MoveJog reverses intermittently on a 1215C

Servo and stepper motion Published 8 min read By AutomateDirectUSA engineering team

Short answer

When a 1215C PTO axis reverses on some jog requests and ignores others, the CPU is healthy and the command path is at fault: both direction inputs TRUE at once, a faulted axis that is never reset, a second motion block aborting the jog, or a program write to the direction output. Run one MC_MoveJog per axis with interlocked direction bits, hold MC_Power Enable TRUE, clear faults with MC_Reset, and leave the direction outputs to the pulse generator.

On this page
  1. How MC_MoveJog takes a direction
  2. First reading: the block outputs
  3. Axis enable and fault state
  4. Competing commands on one axis
  5. PTO ownership of the direction outputs
  6. Driver setup time and pulse mode
  7. The fix in six steps
  8. Verification
  9. Questions asked

Your 1215C is not the problem. When a PTO stepper axis reverses on some jog requests, ignores others, and changes speed mid-move, the fault sits in the command path or in the pulse-train configuration, and it shows in the block outputs long before it reaches the motor. On your wiring the pulses leave on Q0.0 and Q0.2 and direction on Q0.1 and Q0.3, and the axis technology object owns all four once configured. Four causes cover nearly every case, cheapest to check first: both direction inputs TRUE at once, a faulted axis that is never reset, a second motion block aborting the jog, and a program write to a direction output or a driver that misses a fast direction edge. The cure is one MC_MoveJog per axis with interlocked direction bits.

How MC_MoveJog takes a direction #

MC_MoveJog starts its job when you set JogForward or JogBackward to TRUE, and the axis moves only while one of them stays TRUE; drop the bit and the job ends. The technology object's pulse generator drives both the direction output and the pulse frequency, so in a healthy project your ladder never touches the direction bits. Three documented behaviors decide whether a reversal lands:

  • Both JogForward and JogBackward TRUE at the same time is an invalid request. The S7-1200 help for the instruction specifies that the axis stops with the configured deceleration instead of choosing a direction; the S7-1500T documentation reports the same mistake as error 16#8007. Either way the axis brakes, and an operator reads that as "it did not reverse".
  • Only one motion command can be active on an axis. A second command started mid-jog aborts the jog, and the jog block flags that with CommandAborted.
  • InVelocity is a status output that goes TRUE when the commanded velocity is reached; it is not an error. The fault outputs are Error, ErrorID and, where your firmware provides it, ErrorInfo.

Illustrative example of why the both-TRUE case looks random: take a 4 ms scan, as read in the online diagnostics, and an operator rolling a thumb from one pushbutton to the other who holds both for roughly 30 ms. The overlap is 30 ms ÷ 4 ms = 7.5 scans, so the block sees both bits TRUE and brakes the axis. An operator with a clean release leaves no overlapping scan, and the same machine reverses fine. Same program, opposite results.

First reading: the block outputs #

Open a watch table on the MC_MoveJog instance DB and the MC_Power instance DB, and monitor Error, ErrorID, CommandAborted, Busy, InVelocity and the MC_Power output Status. Healthy readings: Status TRUE and Error FALSE before any jog, Busy TRUE while jogging, CommandAborted FALSE throughout. Then branch:

  • Status drops or Error turns TRUE: take the enable and fault readings below.
  • CommandAborted pulses while the pushbuttons behave: take the competing-command readings.
  • Every output clean and the shaft still refuses to reverse: the command path is fine, and the fault lies between the CPU and the motor, so move to the PTO and driver readings.

When ErrorID shows a value, look it up in the diagnostics help of the TIA Portal version you run. The number alone does not name the cause, and a code quoted for another controller family does not transfer to your CPU.

Axis enable and fault state #

A jog on a disabled or faulted axis is refused, and a program that never clears faults reproduces your symptom exactly: the first jog after power-up works, and every jog after a fault is ignored until the next power cycle. Two readings settle it:

  • MC_Power Enable held TRUE for the whole session, and the axis shown as enabled in the technology object diagnostics. An Enable that drops when another part of the program finishes, such as a step sequence or an HMI page change, disables the axis behind your back.
  • After any axis fault, for example an active limit switch, MC_Reset with a rising edge on Execute must clear it before the next jog. Trigger that edge from your fault-recovery logic or your reset button, not from a one-shot that ran once at startup.

If your drive also has a hardware enable input, that circuit is its own subject: why a servo amplifier enable should follow the software axis state covers the pattern.

Competing commands on one axis #

Run a cross-reference search for every instruction that references the axis technology object. The reading you want is exactly one command source able to start at any moment. The patterns that produce intermittent reversal:

  • Two MC_MoveJog calls with different instance DBs on one axis, both called every scan. Each scan the later call takes the axis and the earlier one reports CommandAborted; which direction wins depends on the call order in your program, not on the pushbutton you pressed.
  • A second block such as MC_MoveVelocity or MC_Halt triggered on the same axis mid-jog. The jog is aborted, the new block owns the axis, and the reversal never happens.
  • Pushbuttons wired straight to JogForward and JogBackward with no interlock, so a fast changeover overlaps the bits and the axis brakes as described above.
  • Speed that changes mid-jog: check whether another block also commands the axis, and whether the Velocity tag is written from the HMI or from logic. A jog velocity above the maximum configured in the axis technology object is rejected with an error, which is where your speed errors come from.

All four resolve the same way: one MC_MoveJog instance per axis with interlocked inputs, and every other command block gated off while jogging, as assembled in the fix below.

PTO ownership of the direction outputs #

With clean block outputs, take these readings between the CPU and the driver:

  • In the Drive screen of the axis configuration, confirm each pulse generator is enabled with pulses on Q0.0 and Q0.2 and direction on Q0.1 and Q0.3, with no address overlap between the axes. If you use drive enable and feedback signals, they are assigned in the same screen.
  • Search the program for writes to Q0.1 and Q0.3 and delete them. Once the PTO is configured, the pulse generator owns those bits, and a user write fighting it is a classic source of direction that works only sometimes. What happens when user logic and a configured pulse generator share an output is covered in why the Q0.0 and Q0.1 outputs stop working after PTO configuration.
  • Confirm the axis is allowed to travel in both directions. The S7-1200 G2 mechanics dialog offers that as an explicit choice between both directions and one direction only, and a one-direction setting refuses every reverse jog, so a machine that has reversed even once does not carry this fault. Read it once and move on.
  • Probe the direction output with a meter or scope while commanding reversals; it must change state on every reversal. If it toggles and the motor keeps the old direction, the fault is in the driver, the wiring or the supply: the DC outputs of a DC/DC/DC CPU are sinking transistor outputs, so verify the driver's input polarity and the 24 V loop. If the axis never reverses at all rather than intermittently, work through troubleshooting a stepper axis that moves in one direction only.

Driver setup time and pulse mode #

Two driver readings close the electrical side:

  • Pulse type: the axis must output the mode the driver expects, pulse plus direction, as set by the driver's switches and stated in its datasheet.
  • Direction setup time: most stepper drivers require the direction signal to be stable for a specified time before the first pulse of a new move, and that time is a datasheet figure. When the first pulse lands inside that window, some drivers ignore the edge and keep stepping the old way, a failure that appears only on quick reversals, exactly the randomness you are chasing. Fix it by lowering the start velocity or inserting a short delay between the direction change and the next move, sized from the datasheet number. The drive-side pattern of a direction change lost while pulses keep running is covered in why a stepper motor will not change direction while running.

The fix in six steps #

  1. One MC_Power per axis, with Enable held TRUE for the whole session.
  2. One MC_Reset per axis, triggered by a rising edge on Execute from your fault-recovery logic.
  3. One MC_MoveJog per axis, called every scan, with Velocity inside the axis limits.
  4. Interlock the direction inputs at the source: JogForward = forward pushbutton AND NOT reverse pushbutton, and JogBackward = reverse pushbutton AND NOT forward pushbutton. The two pushbutton tags are your Bool inputs; in ladder that is two contacts in series with one negated, and it makes the both-TRUE state unreachable.
  5. Remove every other motion block that can start on the same axis, or gate it so it executes only while both jog bits are FALSE.
  6. Delete every write to Q0.1 and Q0.3; the pulse generator owns them.

Verification #

Run these jog tests as commissioning, with guards in place, the axis in view, and the jog velocity at the reduced speed your machine's risk assessment allows.

  • Jog forward, release, jog backward, and repeat until the shaft has reversed on 20 consecutive attempts: Busy TRUE during each jog and the direction output toggling on every reversal.
  • Press both pushbuttons together: the interlocked jog bits stay FALSE, the axis stops cleanly, and Error stays FALSE.
  • Jog at working speed: InVelocity TRUE once speed is reached, ErrorID 0.
  • Repeat the three readings on the second axis, then jog both axes at once: each moves independently and neither block reports CommandAborted.

Five passes close the command side for good. If the shaft still misses a reversal after that, one suspect remains: the driver's direction setup time. Put a scope on the direction line and the pulse line together, and read the gap between the direction edge and the first pulse against the datasheet figure.

Questions asked

Is MC_MotionJog a valid instruction on an S7-1200?

No. The jog block in Step 7 Basic is called MC_MoveJog and sits in the Instructions tree under Technology, Motion Control; there is no MC_MotionJog. A project that will not compile on that name is not missing a library, because the name belongs to no block your CPU offers. Which way the axis jogs is decided only by which of its two direction inputs is TRUE.

Why is InVelocity FALSE right after a jog starts?

InVelocity goes TRUE only when the axis reaches the commanded velocity, so it stays FALSE through every acceleration ramp: at each jog start and at each reversal, where the axis first brakes and then ramps up again. A supervision that flags a FALSE InVelocity as an error will alarm on every start. Supervise the Error output instead, and use InVelocity as a speed-reached signal for displays or step enabling.

Can both PTO axes jog at the same time on a 1215C?

Yes. Each axis has its own technology object, its own pulse and direction outputs, and its own instance data, so two jog jobs run in parallel without interacting. The one way to break this is calling a single MC_MoveJog instance for both axes: the instance holds one job, the second call overwrites the first every scan, and both axes stutter. Give each axis its own instance and its own pushbuttons.

Does CommandAborted need an MC_Reset before the next jog?

No. CommandAborted means a newer motion command took the axis; the axis stays enabled and the next jog starts normally, with Error and ErrorID FALSE throughout. MC_Reset is for axis faults and changes nothing here. That distinction is also your diagnostic: CommandAborted with Error FALSE points at program logic, while Error TRUE points at the axis state.

Keep reading

  • Troubleshooting

    Why a PTO stepper axis inflates S7-1200 cycle time

    Hardware PTO pulse generation runs outside the cyclic scan, so a 10 kHz axis on a CPU 1212C should not by itself push cycle time from about 13 ms at idle to over 150 ms. The load comes from configuration or software: interrupt-enabled inputs wired from the pulse signals, a too-short motion processing interval, or blocks left in OB1. Run the checks in order before buying a larger CPU.

    Servo and stepper motion

  • Troubleshooting

    Why a stepper motor will not change direction while running

    A stepper that only reverses after a stop and restart has a command-handling fault, not a motor fault: the running direction routine loops forever and never returns, so the program never reads the direction switch again. Move motion into one repeating loop with bounded calls that return each pass, keep excitation through the change, and reverse by decelerating through zero speed, sizing the transition with T = J × α.

    Servo and stepper motion

  • Explainer

    Why a PLC digital output cannot make a stepper pulse train

    An ordinary PLC digital output switched by scan logic cannot produce a steady 2 kHz step pulse train: each pulse is just 500 microseconds wide at that rate, and scan-time jitter becomes pulse-timing error the driver counts as lost or extra steps. Feed the driver's step and direction inputs from a dedicated pulse-output channel, and set shaft speed from pulses per revolution.

    Servo and stepper motion

Stepper control from a PLC without onboard pulse outputs