When a servo driver's PWM frequency is off by a factor of two, check which clock feeds the timer and how many counts make one cycle before replacing the oscillator. A 50 MHz reference is not the motor-side carrier frequency.
On a small labeling machine's feed-axis servo controller, suppose a board revision changes the measured pulse-width modulation (PWM) test signal from the intended 20 kHz to about 10 kHz. Check the clock tree and timer mode first. A twofold difference does not resemble the tens-of-ppm offset of a normally operating clock component. This discussion is limited to clock verification on the digital control board, not energized power-stage measurements or motion testing.
Purchasing specifies 50 MHz; engineering has to follow it to the timer
One example candidate is SCTF's SX2M50.000B10F20TNN, a 50 MHz, 3.3 V CMOS surface-mount oscillator in a four-pad 2520 package. Its public part-specific selection entry lists −40 to +85 °C. This is a selection example, not evidence that a particular labeler uses it or that it can directly replace a passive 50 MHz crystal. Use the actual sample code and confirmed supply specification. The temperature options for a whole series are not commitments for this specific code.
Distinguish the external reference frequency, actual timer clock frequency and PWM repetition rate. The external clock can pass through the controller's phase-locked loop (PLL), bus divider and timer divider. A bus register's value is not necessarily the number of clocks the timer receives per second. Some controllers apply additional timer-clock multiplication under certain divider settings. A diagram linking oscillator, controller, clock configuration and counting mode is more useful than circling “50M” on the schematic.
Sampling triggers are a separate issue. Current sampling may use counter zero, the top count or a compare event. It does not necessarily occur once per PWM cycle. Whether a compare value creates events in both directions depends on peripheral settings. If a debug pin toggles on every interrupt, two toggles form a full square-wave cycle, so the observed frequency is half the event rate. Identify whether the reading is PWM repetition, sample trigger rate or debug-pin frequency before comparing them.
Worked example: why can counting to 2,500 take twice as long?
Suppose a digital-only test board uses a 50 MHz external oscillator, and the timer is confirmed to count at 50 MHz with no extra prescaler. Calculate from the number of actual steps in an output cycle, not a raw register value. At 20 kHz, the period is 50 µs and takes 50,000,000 ÷ 20,000 = 2,500 steps.
With one-way counting, 2,500 steps total gives 20 kHz. If a port changes to up/down counting with 2,500 steps in each direction, the full cycle takes 5,000 steps. Then 50,000,000 ÷ 5,000 = 10,000 Hz, or a 100 µs period. No oscillator fault is needed to explain the ratio. Check whether the actual timer repeats endpoints and whether the register takes the count or count minus one. Do not copy the example's step counts directly into registers.
With configuration unchanged and a hypothetical +30 ppm reference offset propagated through fixed integer ratios, nominal 20 kHz would be about 20,000.6 Hz. This is a scale comparison, not the candidate's guarantee across conditions or a system sample-jitter limit. Measure average frequency, edge variation and sample phase separately. A correct long-window average does not show that samples land at the intended position within each cycle.
Check three points on a logic bench without driving the motor
Start with software. Read the active clock source to distinguish the external reference from the internal fallback, then verify live PLL, bus division, timer prescaler and counting mode. Configuration-screen targets are not enough; bootloader upgrades or state changes can change effective settings. Save firmware revision and live status during reproduction. If baseline firmware restores operation on the same hardware, investigate what changed in the software clock chain.
Then measure at supported buffered reference and digital PWM test points. Follow the reference, carrier and sample marker. If only a debug pin is available, identify whether it outputs pulses or toggles on events. Use a suitable timebase and probing method and retain the averaging window. For sample placement, capture PWM and its marker in the same acquisition. Two separately triggered screenshots are harder to compare.
Finally, repeat cold power-up, reset and state transitions within the project's permitted digital-bench supply and temperature ranges. If the external reference remains valid while the divided signal changes intermittently, retain clock-source and configuration status around the failure as well as the waveform. A digital timing result does not replace whole-machine commissioning or safety acceptance.
Joint engineering and purchasing checklist
| Check | Engineering evidence | Purchasing record |
|---|---|---|
| External frequency and levels | Input mode, power domain, load and nominal reference | Full code, package, supply and output format |
| Temperature range | Temperature and margin at the worst board location | Exact-part commitment, not the best series option |
| Division and counting | Live source, effective count steps and measured period | Tie samples to board and firmware revisions |
| Sampling phase | Synchronized PWM edges and sample markers | Track same-lot and changed samples separately |
| Substitution release | Verify levels, frequency and recovery for the project | Reel label, lot, approved scope and change record |
For a lead-time substitution, avoid changing the oscillator, porting firmware and rerouting the board in the first comparison if possible. Use common software, clock settings and observations on original and candidate boards to isolate the candidate's contribution. If both hardware and software must change, add cross-checks rather than treating one working prototype as proof of both. State whether mixed lots are allowed; a sample result does not qualify another suffix.
In pilot production, label this reference as the controller or timer timebase, separately from the communications reference. Even parts at the same frequency can have different input levels, validity timing and temperature requirements. If a labeling machine shows start/stop position drift after digital timing passes, have the system team check host commands, encoder feedback and mechanical transmission. Do not make oscillator replacement the default.
Frequently asked questions
Does measuring 20 kHz qualify the selection? No. Verify that the intended reference produced it, not a fallback that happens to yield the same division. Check edges and sample-event phase over multiple cycles. Prefer diagnostic source readback without changing system operation. One room-temperature run does not qualify the full board envelope.
Will a tighter ppm oscillator prevent frequency from halving? No. If the timer counts too many steps, a better oscillator just makes the wrong 10 kHz more accurate. Find the integer-ratio cause in configuration and waveforms. Assess accuracy, output quality and interface compatibility separately if there is evidence of offset, edge issues or unintended source switching.
