Use the PLC built-in PID for conveyor speed trim

7 min read · Published November 9, 2026

A built-in PID output is the complete drive command on a 0-4095 to 0-120 Hz scale, not a trim to add to a 60 Hz base. Trim-on-base math produces twice the base minus the loop output, which drives the conveyor the wrong way and winds the integral. Configure one loop in the CPU setup, feed it the setpoint and process value as binary words, and let the output own the full range.

A conveyor that runs from an analog speed command does not need a hand-built add-and-subtract trim ladder to follow a PID loop. On a drive command scaled 0-4095 counts to 0-120 Hz, the loop output is the whole command already. The trim approach compares the loop output with a 60 Hz base and adds or subtracts the difference on top of that base. That produces twice the base minus the loop output: an inverted command, a level error that grows, and an integral that winds to a limit. The repair is to delete the trim rungs, configure one loop in the CPU setup, and let three binary words carry setpoint, process value and output.

What the symptoms point to

Each behavior on the line traces to a specific rung in the trim ladder:

  • Speed jumps between two values from scan to scan. Two writers hit the analog output word: the first-scan rung (STR SP0, LD V2021, OUT V2010) and the trim rungs behind C100 and C101. One word with two writers gives the drive a command that changes every scan.
  • The belt speeds up while the loop is calling for slower running, then hunts. The trim word is base minus loop output, added onto base again, so the command mirrors the loop command about the base. The worked example below shows the arithmetic.
  • The trim word turns into a huge positive number whenever the loop output is above the base. The subtraction goes negative there, and BCD word math cannot hold a negative value, so the stored trim wraps.
  • The increase branch works and the decrease branch never fires. The decrease rung is gated by C100, the same coil the increase rung resets, so that branch cannot run as written. The rung comments also name V2121 where the rung reads V2021, so anyone editing by the comments touches the wrong word.
  • The loop output sits at one end and never comes back. The process never responds the way the loop expects, so the integral winds until the output reaches a limit.
  • The sample timers do not help. T14 and T15 with K20 pace the compare rungs; pacing changes how often the wrong arithmetic runs, never what it adds.

Restore production first

Put a known speed on the drive before touching the configuration. Skip the PID and the trim rungs and write the 60 Hz equivalent straight to the analog channel: 4095 × 60 / 120 = 2047.5 counts, so put 2047 or 2048 on the word the drive is wired to. Leave the captured setpoint on record and tell the crew the belt holds constant speed with no level correction until the loop is in.

Configure one loop in the setup

Open PLC - Setup - PID in the programming software and create the loop with a table start address. With the table at V5000, the three words that matter are:

Word Function Format
V5002 setpoint BIN
V5003 process value BIN
V5005 loop output BIN

All three are binary. The rest of the table, gains, mode and output limits, is laid out in chapter 8 of the CPU manual; read the offsets there. If the table starts at another address, the same offsets travel with it: setpoint, process value and output sit at start +2, +3 and +5 words.

The ladder that runs the loop is five rungs:

Condition Rung Job
C10 on, belt running STR C10 / LD V2000 / BIN / OUT V5002 setpoint into the loop
C10 on LD V2010 / BIN / OUT V5003 process value into the loop
C10 on LD V5005 / BCD / OUT V2020 loop output onto the analog channel
C10 off STRN C10 / LD K0 / OUT V2020 zero command when the belt stops

The rungs do the format work: BIN converts each BCD word before the loop sees it and BCD converts the output back for the card. Set the loop to Auto and drive C10 from the conveyor run command. The loop calculates only in Auto; in Manual the output word holds whatever it last held no matter what the error does.

Capture the setpoint in one scan

The operator watches the powder height and presses a button when it is right. C0 comes on for that press and copies the live sensor word into the setpoint word: STR C0 / LD V2010 / OUT V2000. Both words then share one scale with no conversion.

Drive C0 from a one-shot contact. If the button is held, the rung rewrites the setpoint every scan, the setpoint tracks the process value, the error stays near zero and the loop stops correcting. If the operator types a height instead, put the entry in the same scale as the sensor word, one decimal place as a ×10 entry (8.5 mm entered as 85), and read the raw sensor word at 0 mm and at 20 mm first, because where 4 mA sits on the count scale is decided by the input module. Clamp typed entries to the 0-20 mm range before they reach V2000; the same check is laid out in validating high and low HMI setpoints before they reach the PLC. If the raw word wanders while the level is steady, run the erratic analog input checks before touching the gains.

Give every V-memory word one job

The rewrite moves jobs between words the trim ladder used, so cross-reference every address before you download. In the trim ladder V2010 was the analog output and V2020 was the HMI's base frequency; in the loop design those meanings swap. The original ladder read its loop output from V3503, a word that only held a loop output if it sat inside the configured table:

Word Job in the loop design Job in the trim ladder
V2000 setpoint, set by the snapshot rung spare
V2010 sensor input, the process value analog output to the drive
V2020 analog output to the drive HMI base frequency in Hz
V2021 spare base converted to 0-4095 counts
V2022 spare trim word
V5002 / V5003 / V5005 setpoint, process value and output in the loop table unused

Confirm exactly one writer per word, and take the analog channel's address from the module's I/O configuration so the output rung writes the channel the drive is wired to. Remove the HMI's base-speed entry and its write to V2020: kept in place, it becomes the second writer on the output word and the speed jumps return.

Check loop direction and Auto mode

  1. With the loop in Auto and C10 on, hold the powder level steady near the setpoint and note V5005.
  2. Step the level by hand, or step the setpoint one increment.
  3. Watch which way V5005 moves.
  4. Compare with the process: the speed change must move the powder level toward the setpoint.

An ultrasonic sensor over the belt reports distance to the surface, so the raw word can fall as the height rises. That flips the sign of what the loop sees, so set the loop action from this step test and not from the sensor label. If the output moved the process away from setpoint, reverse the action setting in the loop's mode word and run the test again.

Observation Cause Next action
V5005 never moves loop in Manual, C10 off, or the SP and PV rungs not writing watch V5002 and V5003 live while stepping the input
Output runs to a limit and stays action reversed, or SP and PV on different scales reverse the action, redo the scaling check
Output moves the right way but oscillates gains too aggressive for the transport delay between belt and sensor cut the gain and the integral action, retest
Drive speed jumps between two values two writers on the analog output word return to the word map

One safety sentence belongs here: before the first run in Auto, clear the area where a sudden speed change matters, because a loop enabled with a wound-up integral can step the drive hard the moment it takes control.

Worked example: trim on a base inverts the command

Take the 0-4095 = 0-120 Hz output scaling with a 60 Hz base. The base in counts is 4095 × 60 / 120 = 2047.5, so the base word holds 2048. Suppose the loop output sits at 1835 counts for a moment, which is 1835 × 120 / 4095 = 53.8 Hz. That number is the complete, correct command. The trim math computes base minus loop output, 2048 − 1835 = 213, then adds the trim back onto the base: 2048 + 213 = 2261 counts, and 2261 × 120 / 4095 = 66.3 Hz. The loop asked for 53.8 Hz and the ladder delivered 66.3 Hz, 12.5 Hz off and pointing the wrong way. The level error grows, the integral keeps winding and the output runs to a limit.

One configured loop has none of this: V5005 reaches the channel unchanged and the drive follows the command. To hold the loop inside a band around the working speed, use the output limit words in the table. A 50-70 Hz band on this scale is 4095 × 50 / 120 = 1706 counts at the low end and 4095 × 70 / 120 = 2389 counts at the high end. Leave the loop the full 0-4095 range unless the process needs that bound; if 60 Hz really is the balanced speed, the output settles near 2048 on its own.

The decision

Recommendation: Delete the trim ladder, including T14, T15, C100, C101, V2021 and V2022, and remove the HMI's write to V2020. Configure one loop in PLC - Setup - PID with the table at V5000, run the five-rung ladder with V2000 as the one-shot captured setpoint and V2010 as the sensor word, and let V5005 own the full 0-4095 command; add the 1706 to 2389 count limits only if the process needs a band around 60 Hz.

Questions

Does the drive need any changes when the trim ladder goes away?

No. The 0-4095 counts live on the PLC analog output card, and the drive still maps its 4-20 mA input span to 0-120 Hz through its own maximum-frequency setting, the same mapping the trim ladder drove. Leave the drive parameters as they are, confirm the run interlock still reaches the drive, and the whole change stays inside the PLC program.

Do the sample timers have any job once the loop is configured?

No. T14 and T15 with K20 paced a compare rung that compared the wrong things. A configured loop runs on the update interval stored with its configuration parameters in the table, and the five rungs that feed it execute every scan. Delete the timers and the compare rungs along with the rest of the trim ladder.

What changes on the operator's screen?

The capture button and the process value display stay as they are. Two details move: the base-speed entry loses its purpose, so take it off the screen along with its write to V2020, and if the screen showed drive speed from the old output word V2010, that address moves to the new analog channel word. Everything else reads as before.

Planning information, not legal or engineering advice. Rules differ by place: check codes and permits with your local authority and your licensed trades.

Keep reading

Build your signAsk for a quote