Detecting break in PWM signal for a servo - Page 1
Forum section: electronics / projects

author: mayor
author_rank: Regular Contributor
timestamp: August 09, 2024, 05:23:46 pm
content: Hello,here, we are talking about an unknown servo motor, connected simply with power, gnd and PWM. There is an unknown controller that sends a PWM signal to position the servo however it wants.This unknown controller is able to detect when the PWM signal is not connected to the servo. I am wondering what is a likely way that it is able to do so? I would think that the servo has a high impedance input for the PWM, so measuring current wouldn't be the preferred method?

author: Benta
author_rank: Super Contributor
timestamp: August 09, 2024, 06:22:30 pm
content: A retriggerable monostable multivibrator will do it (eg, 74HC123).It will generate a output as long as a pulse trin is incoming. If the pulse train stops, it will time out and indicate "no signal".

author: mayor
author_rank: Regular Contributor
timestamp: August 09, 2024, 06:34:15 pm
content: Quote from: Benta on August 09, 2024, 06:22:30 pmHi, thanks for the response. What isn't clear to me is where that pulse train is coming from? The servo receives the pulses from the controller itself, and it is the controller that triggers the "no signal". There are no additional connections where the controller might be made aware of this other than its own PWM output. Am I missing something?

author: MarkF
author_rank: Super Contributor
timestamp: August 09, 2024, 08:39:46 pm
content: Quote from: mayor on August 09, 2024, 06:34:15 pmYa. I think @Benta has that backwards.I did something similar to what you're ask in order to do block detection on my model railroad.In the controller, I put a diode in series with the GND from the locomotive motor (i.e. servo in your case) and have a comparator on the diode anode connected to the motor return. By adjusting the comparator to 500mV, I can detect when the motor is drawing current. My controller sends both PWM and DC to the motors and this scheme works pretty good for the 15 blocks in the track. The only drawback is that the servo GND is not directly to GND. So, maintenance/repair could be an issue for the serviceman.

author: mayor
author_rank: Regular Contributor
timestamp: August 09, 2024, 10:11:29 pm
content: More details (I see they are needed because I don't think @MarkF's solution would work?):there are actually two servos, sharing the same power and same return, yet the controller is able to detect WHICH of the PWMs might be interrupted.I'm unable to properly measure if there is a pull up or pull down on the servo side, because of capacitance, but could it be as simple as that? Checking if the line is pulled up after sending pulses to adjust the servo?

author: inse
author_rank: Super Contributor
timestamp: August 10, 2024, 05:02:11 am
content: Please help me understand the setup, fwik a servo motor is a controlled loop with feedback of speed/angle/direction.So could the controller diagnose PWM loss by the missing feedback?

author: DavidAlfa
author_rank: Super Contributor
timestamp: August 10, 2024, 09:27:33 am
content: Open the controller and see!Might be bidireccional PWM lines, the servo answers back somehow.Measure the input inpedance, several K load could be detected easily.

author: mayor
author_rank: Regular Contributor
timestamp: August 10, 2024, 10:15:37 am
content: Unfortunately, there is no way I can open the controller as it's somewhere deep in a car. The setup is simple, there is no external feedback.+12|-------------| | - PWM -------- [servo 1] |PWM ----------- | ------- [servo 2]| |GND ----------I will take more measurements from the setup as it"s running.

author: nali
author_rank: Frequent Contributor
timestamp: August 10, 2024, 10:38:12 am
content: Do you know for sure the control is actually PWM, or just assuming it is because they are servos? I would've thought it would more likely be a CANbus connection or similar if it's automotive.

author: mayor
author_rank: Regular Contributor
timestamp: August 10, 2024, 10:40:46 am
content: Quote from: nali on August 10, 2024, 10:38:12 amYes, 100% sure it's PWM.

author: mikerj
author_rank: Super Contributor
timestamp: August 10, 2024, 12:29:57 pm
content: Quote from: mayor on August 09, 2024, 05:23:46 pmThat seems like a pretty big assumption. If a system needs to detect whether a PWM circuit is connected with no additional feedback wires, then monitoring the current on the PWM line would be an obvious solution.

author: DavidAlfa
author_rank: Super Contributor
timestamp: August 10, 2024, 01:08:28 pm
content: Probably the servo has a pullup resistor, the ecu only pulls to ground.Why all this anyways?Stop guessing:- Measure voltages with servo unplugged.- Connect a 100ohm resistor between pwm and GND.- Connect a 100ohm resistor between pwm and 12v.(First make sure the pwm signal works at 12v!)

author: ebastler
author_rank: Super Contributor
timestamp: August 10, 2024, 05:48:06 pm
content: Quote from: DavidAlfa on August 10, 2024, 01:08:28 pmGood points. Just because the OP can't measure any PWM signal after unplugging the servo, that does not necessarily mean that the controller has stopped transmitting. It might just not be a measurable signal anymore if it's just an open collector output.Unplugging the servo and measuring the resistance between its PWM input and GND/+12V respectively seems like another straightforward check to do.

author: mayor
author_rank: Regular Contributor
timestamp: August 10, 2024, 10:36:11 pm
content: Quote from: ebastler on August 10, 2024, 05:48:06 pmThat's the first thing I checked, but readings are all over the place, probably charging and discharging capacitors.I will take measurements with the system running next, I just need to set it up.

author: ArdWar
author_rank: Frequent Contributor
timestamp: August 11, 2024, 05:00:37 am
content: What do you use to measure? How do you do the measurements?Fwiw, "charging and discharging capacitors" for a PWMsignalis rather nonsensical, especially in context of servo signal. It's more likely you're getting nonsensical measurement due to aliasing, or signal line not pulled/terminated properly.

author: mayor
author_rank: Regular Contributor
timestamp: August 11, 2024, 10:15:21 am
content: Quote from: ArdWar on August 11, 2024, 05:00:37 amApologies, should have mentioned that these measurements were taken with a DMM across the servo from PWM to GND and PWM to +12, with no power to the system. I will be taking measurements with the system while it's running, but I need to first create a small jig to do so.

author: DavidAlfa
author_rank: Super Contributor
timestamp: August 11, 2024, 10:53:09 am
content: Quote from: mayor on August 11, 2024, 10:15:21 amWith the servo unplugged, right? In-circuit measurements won't be reliable.

author: voltsandjolts
author_rank: Unknown
timestamp: August 11, 2024, 11:53:38 am
content: Is the OP looking for continuous detection, or more simply, presence detection on system startup?If at startup only, you could e.g. apply -2VDC to the pwm line and check for current draw through (presumed) protection diode of servo pwm input.

author: mayor
author_rank: Regular Contributor
timestamp: August 12, 2024, 06:58:20 pm
content: Thanks all,It turns out to have been very simple, the servo has a pullup which the controller is looking for.

author: ebastler
author_rank: Super Contributor
timestamp: August 12, 2024, 07:24:54 pm
content: Quote from: mayor on August 12, 2024, 06:58:20 pmThanks for confirming DavidAlfa's hypothesis. It is quite likely that the controller does not "look for" the pullup and stop transmitting when the pullup is missing, but that it just keeps transmitting via an open-collector output. There just won't be a measurable voltage swing without the pullup.

author: DavidAlfa
author_rank: Super Contributor
timestamp: August 12, 2024, 09:39:26 pm
content: C'mon, we all know what "looking for" means, just a generic way of saying "it detects somehow".

author: ebastler
author_rank: Super Contributor
timestamp: August 12, 2024, 09:42:17 pm
content: Quote from: DavidAlfa on August 12, 2024, 09:39:26 pmMy point is that the transmitter is not necessarily detecting the lack of a pullup at all. It might keep happily sending away, and only the experimenter's oscilloscope "sees" a difference in the observed signal when no pullup is present.

author: DavidAlfa
author_rank: Super Contributor
timestamp: August 13, 2024, 12:14:36 am
content: But if it's detecting the fault, probably has an input wired to the pwm output, making sure the level is actually changing.

author: mayor
author_rank: Regular Contributor
timestamp: August 13, 2024, 09:28:58 am
content: Quote from: ebastler on August 12, 2024, 07:24:54 pmIt might still send the signal, but it actively logs the fault, so it is "looking for" ( :-) ) it...

author: DavidAlfa
author_rank: Super Contributor
timestamp: August 13, 2024, 09:34:00 am
content: Are we starting a finicky engineer discussion about "technically speaking..."?Oh well, let's say "The controlling unit probably has a feedback mechanism to monitor the correct execution of the servo driving signal"."It looks for it" is just fine and correct in real life, outside of a conversation with a boss you're trying to impress or applying for a job...

author: ebastler
author_rank: Super Contributor
timestamp: August 13, 2024, 10:48:12 am
content: Quote from: mayor on August 13, 2024, 09:28:58 amAh, alright -- I don't think you had mentioned that before. So the controllerdoesdetect when the servo is unconnected. Case closed!

author: DavidAlfa
author_rank: Super Contributor
timestamp: August 13, 2024, 06:08:45 pm
content: He said that since the 1st post!

author: ebastler
author_rank: Super Contributor
timestamp: August 14, 2024, 07:06:06 am
content: Quote from: DavidAlfa on August 13, 2024, 06:08:45 pmEven if your statement were true and that information were in the 1st post, I would consider it rather impolite that you are laughing your head off at my expense.

author: DavidAlfa
author_rank: Super Contributor
timestamp: August 14, 2024, 07:38:28 am
content: Dude! Why are you taking it seriously?