Serial Link Configuration to the Viper Drive
The Viper servo drive communicates with a PC terminal program such as HyperTerminal using a fixed serial profile: 9600 baud, 8 data bits, 1 stop bit, no parity, and no handshaking (flow control set to None). Any flow-control setting other than None in the terminal program will prevent a reliable session. If communication still fails with the correct profile, test with a second PC to isolate a faulty COM port or cable.
Cable integrity matters. One reported fault involved a custom-built cable: when the encoder was connected to the DB9 connector, the drive's red LED began flashing, indicating a fault condition. If you are not using the drive manufacturer's supplied cable, verify every conductor against the pinout before powering up, and treat unexpected LED activity during connection as a wiring or encoder fault indicator, not a normal state.
Symptom: Zero Position Lost Under Mach3
The confirmed failure pattern: the motor tunes correctly through the Viper drive's own interface and runs without issue, but when driven by Mach3 the axis loses its zero position. The feedback device is an incremental encoder with A and B channels. Critically, the drive's own error monitoring reports zero error when the motor stops, even though the motor physically did not return to the commanded zero position.
This combination — drive-reported error of zero while the physical position is wrong — points away from a tuning or following-error problem inside the drive loop and toward lost or corrupted encoder counts. If the drive never sees the missing counts, it cannot correct them, which is consistent with an incremental (not absolute) feedback system: any dropped edges between the encoder and the drive accumulate silently as permanent position offset until the axis is re-referenced.
Using the M and S Commands to Diagnose Following Error
The drive's serial command set includes the M command, which displays the position error, and the S command, which reports a second status value shown alongside it. During motion the two values diverge (expected while the axis is moving), but at standstill the error reads zero even when the axis is physically off position. Use this as a diagnostic decision:
- Command a known move from Mach3, then monitor with
Mwhile the axis runs. Diverging M and S values during motion are normal following-error behavior. - When motion stops, compare the reported error against the physical axis position (dial indicator or reference mark).
- If
Mreads zero but the axis is off its mark, the counts were lost upstream of the drive's error calculation — suspect the encoder, its wiring, or electrical noise on the A/B channels rather than servo tuning.
Encoder Checks: Type, Health, and Wiring
Determine whether the installed encoder is differential or single-ended — the drive manufacturer specifically asks this when diagnosing this fault, because the interface and noise immunity differ between the two. An incremental A/B encoder that is failing, miswired, or mismatched to the expected input type will drop counts exactly as observed. In the reported case, the encoder itself was suspected and targeted for replacement after the flashing-LED observation on connection.
Before replacing hardware, confirm the encoder type matches the drive's expected input, inspect the A/B wiring terminations at the DB9, and re-test. After any encoder or cable change, re-reference the axis in Mach3 and repeat the M-command check on a known move to verify that reported error and physical position now agree at standstill.
FAQ
What serial settings does the Viper servo drive use?
9600 baud, 8 data bits, 1 stop bit, no parity, with handshaking (flow control) set to None in the terminal program. If the link still fails, try a different PC to rule out the COM port or cable.
Why does the Viper drive report zero error when the motor missed its position?
With an incremental A/B encoder, counts lost between the encoder and the drive are invisible to the drive, so the error reads zero at standstill even though the axis is physically off position. This indicates dropped encoder counts, not a tuning problem.
How do I diagnose lost position on a Viper drive running under Mach3?
Monitor the position error with the drive's M command during a known move, then compare the stopped reading against the physical position. Zero reported error with a physically offset axis means checking the encoder type (differential vs. single-ended), wiring, and encoder health.