Author Topic: Detecting break in PWM signal for a servo  (Read 1292 times)

0 Members and 3 Guests are viewing this topic.

Offline mayorTopic starter

  • Regular Contributor
  • *
  • Posts: 246
  • Country: ca
Detecting break in PWM signal for a servo
« on: August 09, 2024, 05:23:46 pm »
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?

« Last Edit: August 09, 2024, 06:25:13 pm by mayor »
 

Online Benta

  • Super Contributor
  • ***
  • Posts: 6166
  • Country: de
Re: Detecting break in PWM signal for a servo
« Reply #1 on: August 09, 2024, 06:22:30 pm »
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".
 

Offline mayorTopic starter

  • Regular Contributor
  • *
  • Posts: 246
  • Country: ca
Re: Detecting break in PWM signal for a servo
« Reply #2 on: August 09, 2024, 06:34:15 pm »
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".

Hi, 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?
 

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 2631
  • Country: us
Re: Detecting break in PWM signal for a servo
« Reply #3 on: August 09, 2024, 08:39:46 pm »
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".

Hi, 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?

Ya.  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.
 
The following users thanked this post: mayor

Offline mayorTopic starter

  • Regular Contributor
  • *
  • Posts: 246
  • Country: ca
Re: Detecting break in PWM signal for a servo
« Reply #4 on: August 09, 2024, 10:11:29 pm »
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?
 

Offline inse

  • Frequent Contributor
  • **
  • Posts: 711
  • Country: de
Re: Detecting break in PWM signal for a servo
« Reply #5 on: August 10, 2024, 05:02:11 am »
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?
 

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 6183
  • Country: es
Re: Detecting break in PWM signal for a servo
« Reply #6 on: August 10, 2024, 09:27:33 am »
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.
« Last Edit: August 10, 2024, 12:54:30 pm by DavidAlfa »
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 
The following users thanked this post: mayor

Offline mayorTopic starter

  • Regular Contributor
  • *
  • Posts: 246
  • Country: ca
Re: Detecting break in PWM signal for a servo
« Reply #7 on: August 10, 2024, 10:15:37 am »
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
                                           |-------------
                                           |                 |
[controller] - PWM -------- [servo 1]          |
                   PWM  ----------- | ------- [servo 2]
                                           |                 |
                                          GND ----------

I will take more measurements from the setup as it"s running.
 

Offline nali

  • Frequent Contributor
  • **
  • Posts: 697
  • Country: gb
Re: Detecting break in PWM signal for a servo
« Reply #8 on: August 10, 2024, 10:38:12 am »
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.

 

Offline mayorTopic starter

  • Regular Contributor
  • *
  • Posts: 246
  • Country: ca
Re: Detecting break in PWM signal for a servo
« Reply #9 on: August 10, 2024, 10:40:46 am »
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.

Yes, 100% sure it's PWM.
 

Online mikerj

  • Super Contributor
  • ***
  • Posts: 3306
  • Country: gb
Re: Detecting break in PWM signal for a servo
« Reply #10 on: August 10, 2024, 12:29:57 pm »
I would think that the servo has a high impedance input for the PWM

That 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.
 
The following users thanked this post: mayor

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 6183
  • Country: es
Re: Detecting break in PWM signal for a servo
« Reply #11 on: August 10, 2024, 01:08:28 pm »
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!)
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 
The following users thanked this post: mayor, ebastler

Offline ebastler

  • Super Contributor
  • ***
  • Posts: 6864
  • Country: de
Re: Detecting break in PWM signal for a servo
« Reply #12 on: August 10, 2024, 05:48:06 pm »
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!)

Good 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.
 
The following users thanked this post: mayor

Offline mayorTopic starter

  • Regular Contributor
  • *
  • Posts: 246
  • Country: ca
Re: Detecting break in PWM signal for a servo
« Reply #13 on: August 10, 2024, 10:36:11 pm »
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!)

Good 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.

That'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.
 

Offline ArdWar

  • Frequent Contributor
  • **
  • Posts: 642
  • Country: sc
Re: Detecting break in PWM signal for a servo
« Reply #14 on: August 11, 2024, 05:00:37 am »
What do you use to measure? How do you do the measurements?

Fwiw, "charging and discharging capacitors" for a PWM signal is 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.
 

Offline mayorTopic starter

  • Regular Contributor
  • *
  • Posts: 246
  • Country: ca
Re: Detecting break in PWM signal for a servo
« Reply #15 on: August 11, 2024, 10:15:21 am »
What do you use to measure? How do you do the measurements?

Fwiw, "charging and discharging capacitors" for a PWM signal is 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.

Apologies, 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.
 

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 6183
  • Country: es
Re: Detecting break in PWM signal for a servo
« Reply #16 on: August 11, 2024, 10:53:09 am »
Apologies, 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.
With the servo unplugged, right? In-circuit measurements won't be reliable.
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 
The following users thanked this post: ebastler

Online voltsandjolts

  • Supporter
  • ****
  • Posts: 2394
  • Country: gb
Re: Detecting break in PWM signal for a servo
« Reply #17 on: August 11, 2024, 11:53:38 am »
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.
 

Offline mayorTopic starter

  • Regular Contributor
  • *
  • Posts: 246
  • Country: ca
Re: Detecting break in PWM signal for a servo
« Reply #18 on: August 12, 2024, 06:58:20 pm »
Thanks all,

It turns out to have been very simple, the servo has a pullup which the controller is looking for.
 

Offline ebastler

  • Super Contributor
  • ***
  • Posts: 6864
  • Country: de
Re: Detecting break in PWM signal for a servo
« Reply #19 on: August 12, 2024, 07:24:54 pm »
It turns out to have been very simple, the servo has a pullup which the controller is looking for.

Thanks 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.
 

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 6183
  • Country: es
Re: Detecting break in PWM signal for a servo
« Reply #20 on: August 12, 2024, 09:39:26 pm »
C'mon, we all know what "looking for" means, just a generic way of saying "it detects somehow".
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline ebastler

  • Super Contributor
  • ***
  • Posts: 6864
  • Country: de
Re: Detecting break in PWM signal for a servo
« Reply #21 on: August 12, 2024, 09:42:17 pm »
C'mon, we all know what "looking for" means, just a generic way of saying "it detects somehow".

My 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.
 

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 6183
  • Country: es
Re: Detecting break in PWM signal for a servo
« Reply #22 on: August 13, 2024, 12:14:36 am »
But if it's detecting the fault, probably has an input wired to the pwm output, making sure the level is actually changing.
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline mayorTopic starter

  • Regular Contributor
  • *
  • Posts: 246
  • Country: ca
Re: Detecting break in PWM signal for a servo
« Reply #23 on: August 13, 2024, 09:28:58 am »
It turns out to have been very simple, the servo has a pullup which the controller is looking for.

Thanks 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.

It might still send the signal, but it actively logs the fault, so it is "looking for" ( :-) ) it...
 

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 6183
  • Country: es
Re: Detecting break in PWM signal for a servo
« Reply #24 on: August 13, 2024, 09:34:00 am »
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...  :popcorn:
« Last Edit: August 13, 2024, 09:38:31 am by DavidAlfa »
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf