Station keeping PWM servo pulse?


 

Paul Nederveen

TVWBB Member
Bryan,

Are you using a station keeping type pulse on the servo PWM? I see the SERVO_HOLD_SECS but if I understand your code it is just to keep the PWM signal active long enough for the servo to settle. I was capturing the PB0 on my o'scope and see no signals between moves. However I might have my trigger set up incorrectly. Want to make sure I understand how that tiny piece is working.

Thank you,
Paul
 
I'm not entirely sure I am following your question, but SERVO_HOLD_SECS now only affects the servo signal when the controller is in OFF mode (long press left button, or set the setpoint to "OFF" or "O" in the webui). When the servo goes to OFF, it waits SERVO_HOLD_SECS as the servo travels to closed position then stops the PWM signal. All other times you should see the regular 50Hz servo signal. There is a minimum amount a servo has to move before it will actually change the signal though, controlled by SERVO_MIN_THRESH and SERVO_MAX_HOLDOFF.
 
I asked a bit of an assumptive question. I will attempt to be more clear this time.

If I hook PB0 (PIN 14) to a scope would I expect to see a PWM signal all of the time or only when the servo is moving?

Thanks!
 
Hmmm...well. Then I guess I need to learn more about setting the trigger on the scope, because I cannot see a constant signal on PB0. But I can easily capture the signal when servo is moving. Makes me wonder....

I went back again and tested on PB0, before the Q5 switch. The PWM signal only appears when the servo is moving, then the line goes quiet. I've tested with single and constant triggering. In manual mode, I toggle some output, the PWM signals appear and then march off the screen. Perfect 50Hz with varying width, exactly as expected. Then PB0 is quiet except for a bit of noise.

When there is no servo movement, there does not appear to be any PWM output. 🧐

Thoughts? I'm investigating not because HM has any issues but I'm trying to replicate PWM behavior on another device and was using the HM as a reference.
 
Last edited:
It was in manual mode 0% with a 4.3.3 HeaterMeter with the Pi hooked up and booted and running for about 5 minutes. I have no idea why you wouldn't be able to see it unless you're running an old version of the HeaterMeter code. What you're seeing used to be the way it worked a few years back?
 
It was in manual mode 0% with a 4.3.3 HeaterMeter with the Pi hooked up and booted and running for about 5 minutes. I have no idea why you wouldn't be able to see it unless you're running an old version of the HeaterMeter code. What you're seeing used to be the way it worked a few years back?

Yes, my HM code is a bit old. Let me update my LM image and have it push a new HM image to the AVR. That is probably the source of the issue. Will update once that is done.
 
Yep, it was old HM firmware. Updated everything and then the signal started coming out as a constant. Was going to post my image but my Hantek is being fussy about writing the screen shots out to USB.

That problem is solved now. The code made it look as if the PWM signal was always running but measuring showed otherwise. Should have thought to bring everything up to date before asking the question. Thanks for the support!
 
Ah-ha! I thought that when I posted at first but didn't think to mention it because that code was so old and you had referenced the newer code so I assumed you were building your own firmware from HEAD. It was a big point of contention back then, where I thought the servo should always turn off after a move and everyone else thought it should stay active. Everybody else won, so I implemented the "Off" mode so I could still have the ability to turn the servo off because I often will leave the HeaterMeter connected to the smoker for days at a time and worry about the servo.
 
Yeah, I threw a red herring in the pond. Bad form on my part to be referencing code snippets that I in fact was not running!

I'm sure the servo debate was lively. From an R/C perspective you absolutely want the servo to resist change in angle (think airfoil surfaces!) and that is exactly what the steady/station keeping pulse does.

Good discussion. Maybe it will help someone in the future searching for this question.

cheers!
 

 

Back
Top