Configuring a Click PLC Low-Torque Stop for Gearbox Tests

Brian Holt13 min read
AutomationDirectHMI ProgrammingTechnical Reference
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

A gearbox life-test stand running lights-out needs to stop on its own when the gearbox fails. On this stand a failed gearbox shows up as output torque collapsing while the motor is still commanded to run. The stand uses a Click C0-02DD1-D and a C-more CM5-7TW HMI. Output torque arrives on AD1, which is registered to DF1 and scaled 4.0-20.0 mA. A magnetic particle brake loads the gearbox from a 0-5 V command in DF3. The sequence is brake delay, run CW, dwell, brake delay, run CCW, dwell, repeat. Each run lasts 4 s with roughly 0.5 s of ramp at each end. The work below adds one low-torque trip. Build and prove each piece in order before starting the next.

Skip the Quick Fixes First

The first ideas usually fail. Here is why.

Quick fix Why it fails
Add a COPY of DF1 inside the run-timer rungs, then compare the copy Compare contacts read DF1 directly. The HMI reading DF1 does not lock it. A copy only adds a value that can go stale if the copy rung stops executing.
Compare DF1 against 6.85 mA and 17.15 mA Those milliamp values are wrong for this sensor (see the next section). With these limits a healthy gearbox either trips every cycle or never trips.
Take 90% of the milliamp setpoint The signal has a 12 mA offset. 0.9 × 6.85 mA = 6.165 mA, which is about -318 in-lb, not 90% of -190 in-lb.
Insert a torque contact in front of each run timer (for example between rungs 8 and 9) Each timer has its own start/stop seal. You would need the check in every timer rung, and one missed rung keeps the sequence running.
Compare whenever Y002 (motor run) is on This includes the ramp-up and ramp-down. Torque is below the limit at every start, so the stand trips every cycle.

What works:

  1. Fix the milliamp math.
  2. Only check torque inside a timer window during the steady-torque part of each run.
  3. Put one permissive on the Start/Stop rung so the whole sequence drops at once.

Check before moving on: Print the program. Mark Rung 1, which is the Start/Stop circuit driving Y001. Confirm on the running stand that Y001 goes to 0 on Stop, on E-Stop, and when counter CT1 is done. Everything below depends on that behavior.

Recalculate the Milliamp Thresholds

The sensor is bipolar:

  • 4.0 mA = -442.5 in-lb (CCW full scale)
  • 12.0 mA = 0
  • 20.0 mA = +442.5 in-lb (CW full scale)

Each direction therefore spans 8 mA for 442.5 in-lb, which is 55.3125 in-lb per mA. The earlier 6.85 mA and 17.15 mA figures come from treating the half-span as 12 mA. (190 / 442.5) × 12 = 5.15 mA of offset from zero, which is wrong. The correct offset is (190 / 442.5) × 8 = 3.435 mA.

Torque_inlb = (mA - 12.0) * 55.3125
mA          = 12.0 + Torque_inlb / 55.3125
Condition Torque (in-lb) Signal (mA)
CCW full scale -442.5 4.00
CCW test setpoint -190 8.57
CCW trip limit (90% of setpoint) -171 8.91
Zero / dwell 0 12.00
CW trip limit (90% of setpoint) +171 15.09
CW test setpoint +190 15.43
CW full scale +442.5 20.00
What 17.15 mA actually means +284.9 17.15

Always take percentages in torque units, then convert to mA. Never take a percentage of the mA value.

Check before moving on: Run a normal loaded cycle and watch DF1 on the HMI during the steady part of each run. Expect about 15.43 mA CW and 8.57 mA CCW.

Stop here if the readings sit near 17.15 mA and 6.85 mA. That means either the brake is loading to about 285 in-lb, or the sensor's calibrated range is not ±442.5 in-lb. Pull the sensor calibration certificate and resolve it before writing any trip logic.

Condition DF1 into Engineering Units

Keep the analog card scaling at 4.0-20.0 mA so DF1 stays in milliamps. The HMI and the data log already use it, and a milliamp value is easy to check against a loop calibrator. Add two MATH blocks that write to spare DF registers. In the example below, TorqueFilt, TorqueInLb, FiltK, ZeroMA, SpanInLb and HalfSpanMA are nicknames you assign to spare registers.

MATH 1 (first-order filter; FiltK between 0 and 1, FiltK = 1.0 disables filtering)
TorqueFilt = TorqueFilt + FiltK * (DF1 - TorqueFilt)

MATH 2 (scale to in-lb; calibration values held in DF registers)
TorqueInLb = (TorqueFilt - ZeroMA) * SpanInLb / HalfSpanMA
  ZeroMA = 12.0   SpanInLb = 442.5   HalfSpanMA = 8.0

Holding zero and span in registers lets you trim calibration from the HMI without editing ladder.

Filter pitfalls:

  • The filter adds lag. The trip window opens 500 ms into the run, so the filtered value must reach its plateau before then.
  • The MATH block runs every scan, so the effective time constant depends on scan time. For a predictable filter, execute MATH 1 on a fixed-interval pulse instead of every scan.

Set the trip limits from one operator entry. The operator enters a positive torque setpoint, and the PLC calculates both limits:

CwLimit  = TorqueSP *  0.9     (190 in-lb gives +171)
CcwLimit = TorqueSP * -0.9     (190 in-lb gives -171)

If the two directions ever need different margins, expose both limits on the HMI instead.

Check before moving on: During dwell, TorqueInLb should read near 0 because DF1 sits at 12.0 mA. During loaded runs it should read near +190 and -190. In the data log, confirm the filtered trace reaches its plateau before the 500 ms mark of each run.

Switch T1 and T3 to Milliseconds and Set the Window

With the accumulators in seconds, T1 (CW run) and T3 (CCW run) only count 0 to 4. You cannot compare against 500. Make these changes:

  1. Change the time unit of T1 and T3 to milliseconds.
  2. Change their presets from 4 to 4000.
  3. Define the check window as 500 ms to 3500 ms of each run. This covers the 3 s of full torque between the roughly 0.5 s ramps.
  4. After the first logged runs, pull the window edges inward if torque is still rising at 500 ms or already falling at 3500 ms.

The whole window logic assumes one thing. When a run timer is not timing, its current value is either 0 (reset) or 4000 (done). Both values are outside the window, so the check passes automatically during brake delays (T5, T6), dwells (T2, T4), and the other direction's run.

Check before moving on: Watch the T1 and T3 current values in Data View through a full cycle. Each must count 0 to 4000 during its own run only, and sit at 0 or 4000 at all other times. If either timer holds a value inside 500-3500 during a dwell, fix the timer reset logic before continuing.

Write the Stop Condition, Then Invert It

Write the trip in plain terms first:

STOP = (T1 > 500 AND T1 < 3500 AND TorqueInLb < CwLimit)
    OR (T3 > 500 AND T3 < 3500 AND TorqueInLb > CcwLimit)

In the CCW direction, "greater than -171" means weaker torque, for example -120. That is the failure case.

The Start/Stop rung needs the opposite: a condition that must stay true to keep running. Apply De Morgan's laws. NOT (A AND B AND C) becomes NOT A OR NOT B OR NOT C, and NOT (X OR Y) becomes NOT X AND NOT Y:


The CCW term is the one that gets written wrong. The permissive is TorqueInLb <= CcwLimit, meaning at least as negative as -171. If you write it as greater than -171, you invert the check: every healthy reverse run trips, and a dead gearbox passes.

In ladder, build it as two parallel groups of three compare contacts, with the two groups in series:

CW group (any branch passes)        CCW group (any branch passes)
+--[ T1 <= 500 ]-----------+        +--[ T3 <= 500 ]------------+
+--[ T1 >= 3500 ]----------+--------+--[ T3 >= 3500 ]-----------+----
+--[ TorqueInLb >= CwLimit ]+        +--[ TorqueInLb <= CcwLimit ]+

Alternative with one compare. Y003 (reverse) is on only during the CCW run. Use it to fold both directions into one signed value, then use a single window that is open when either run timer is inside 500-3500 ms:

If Y003 on :  TorqueDir = TorqueInLb * -1.0
If Y003 off:  TorqueDir = TorqueInLb
Trip when window open AND TorqueDir < CwLimit

Both versions work. The two-group version is easier to read online because each compare shows its own state.

Check before moving on: Before connecting the permissive to Y001, drive a spare C bit with it. Temporarily replace TorqueInLb with a test register, force values, and confirm every row of this table:

2000 0 +190 1
2000 0 +100 0
300 0 +40 (ramp) 1
4000 2000 -190 1
4000 2000 -120 0
0 0 0 (dwell) 1

Put the Permissive on Rung 1 and Let Y001 Drop Everything

Y001 (brake cooling solenoid) is already on for the whole sequence. Stop, E-Stop and CT1 done all return it to 0. That makes it the natural sequence-run bit.

after the parallel Start/seal-in branch. In that position, holding the Start button cannot override a trip.

|--+--[ Start ]--+--[/ Stop ]--[/ E-Stop ]--[/ CT1 done ]--[ CW group ]--[ CCW group ]--( Y001 )
|  +--[ Y001  ]--+

Then simplify the timer rungs:

  1. Remove the separate Stop, E-Stop and CT1 done contacts from each timer's start/stop circuit.
  2. Enable every timer from a Y001 contact instead. When Y001 drops, every timer and output in the sequence drops with it.
  3. Reset CT1 from a normally closed Y001 contact. This covers both a normal finish and any early stop.

Two decisions to make before you rely on this:

  • Cooling after a trip. Dropping Y001 also shuts off brake cooling at the moment of a fault. If the brake needs cooling after a stop, make a spare C bit the sequence-run bit. Drive Y001 from that bit plus an off-delay timer sized from the brake data.
  • Losing the failed cycle number. Resetting CT1 on a trip clears the current count. Latch or log the count before the reset if you need to know which cycle failed. The total count is separate.

Aborting mid-motion is acceptable on this stand, because the unit can shut down at any point in the cycle without problems. Confirm the same is true on any other stand before copying this logic.

Check before moving on: During a CW run, force the test torque below 171 inside the window. Y001, Y002 and Y003 must drop within one scan. All timers must reset, and DF3 must stop commanding the brake. Repeat during a CCW run.

Latch the Trip Reason and Catch a Dead Sensor

An unattended stop needs a reason on the screen in the morning.

  1. Show the latched bit on the C-more with the cycle count and the direction.

Now check what happens with a broken loop. An open loop drives the card toward 0 mA. If the scaling extrapolates below 4 mA, TorqueInLb reads about -663 in-lb. The CW check trips as expected. The CCW permissive, however, reads -663 as "strong reverse torque" and passes.

Close that gap with a range check that is active at all times, not only during the run windows. Trip on DF1 below 4.0 mA or above 20.0 mA, each with a small margin. Base the margin on what the analog card actually reports with the loop open.

Check before moving on: During a dwell, unplug the output torque sensor. The stand must stop and show a sensor fault, not a low-torque fault. Record what DF1 reads with the loop open. That value tells you whether the card clamps or extrapolates.

Clean Up the Existing Sequence Before Trusting the Trip

A low-torque trip is only as good as the brake command behind it. Fix these first:

  • Brake voltage overwrite. Rung 4 writes DF10 into DF3. That value is overwritten almost immediately by DF12 on Rung 12 or DF13 on Rung 13. DF10 never reaches the brake controller. Decide which register should command each direction, and delete or repurpose the others.
  • Dwell placement. Put the dwell before each brake-on transition. In the current order, an operator can hold Start and tap Stop during the reverse run. The sequence then jumps straight into the forward steps with no dwell in between.
  • Brake settle time. T5 and T6 give the brake 500 ms to energize before the motor starts. Leave them in place. The torque window is measured from the start of T1 and T3, not from brake-on.

Check before moving on: Try to break the sequence on purpose. Press Stop, then Start, in every step, and hold Start while tapping Stop during both runs. Confirm the sequence never skips a dwell. Confirm DF3 matches the intended value for each direction, measured at the brake controller input.

Consider a Time-Based Drum Rewrite

All the timings on this stand are fixed, so a Click time-based Drum instruction can replace about a dozen timer and output rungs. The whole program shrinks to about half a dozen rungs. The torque permissive stays exactly where it is on the Start/Stop rung.

If you would rather keep timers, cascade them in the extended flasher pattern:

  • Each timer is driven by the previous timer's done bit.
  • Only the last timer's done bit, plus Stop and E-Stop, collapses the chain from the first rung.
  • The per-timer enable bits (for example C3 for T3) go away. "Timer N is timing" becomes previous-done AND NOT this-done.
  • One timer can cover both brake apply and motor start by comparing its accumulator against 500 ms.

Get the trip running on the current program first, then refactor on day shift.

Check before moving on: Overlay the refactored program's logged cycle timing on the old program's log. Brake-on, run and dwell durations must match before the refactor goes lights-out.

Run the End-to-End Verification

  1. Load the program and run one full cycle unloaded. Confirm the trip does not fire during brake delays, ramps or dwells.
  2. Run at the 190 in-lb setpoint for several cycles. In the log, compare the steady-run torque against 171 in-lb in each direction to see your margin.
  3. Reduce the brake command (DF3) in steps during a CW run until torque falls below 171 in-lb inside the window. The stand must stop and latch a low-torque CW fault.
  4. Repeat step 3 during a CCW run. Confirm the fault shows CCW.
  5. Unplug the torque sensor during a dwell. Confirm a sensor fault and a stop.
  6. Confirm the current count, the total count and the fault reason survive until acknowledged, and that the log shows the failing cycle.
  7. Only then enable lights-out running.

FAQ

How do I convert a bipolar 4-20 mA torque signal to in-lb in a Click PLC?

Keep the card scaled 4.0-20.0 mA in DF1. Add a MATH block: in-lb = (DF1 - 12.0) × 442.5 / 8.0, which is 55.3125 in-lb per mA. With that scaling, ±190 in-lb sits at 15.43 mA and 8.57 mA, not 17.15 mA and 6.85 mA.

How do I check an analog value only during part of a timer's run?

Set the timer to milliseconds (preset 4000). Pass the check automatically when the accumulator is ≤ 500 or ≥ 3500. Within that window, require torque ≥ +171 in-lb for T1 and ≤ -171 in-lb for T3.

How do I stop the whole Click sequence from one low-torque condition?

Put the De Morgan-inverted permissive in series on the Start/Stop rung that drives Y001, after the Start/seal-in branch. Enable every timer from Y001, so a trip drops all timers, outputs and the CT1 reset at once.

When should I call AutomationDirect support about the analog input?

Stop and call AutomationDirect support if DF1 does not track a loop calibrator across 4-20 mA. Also call if you cannot determine how the analog card reports an open loop. If the sensor's calibrated range does not match ±442.5 in-lb, go to the torque sensor manufacturer for a calibration certificate before trusting any trip limit.

Back to blog