-->
Page 1 of 2

Problem with PWM. Extra pulse

PostPosted: Tue Mar 19, 2019 4:38 pm
by Rodriguez
Hello. This is my first post, so hello to everyone.
I'm new to 8862, especially native SDK. I wanted to play a bit with PWM and servos. I wrote some basic code:
Code: Select alluint32 duty = 100000000;
    pwm_init(20000, &duty, 1, io_info);//~50Hz
    pwm_start();

but I noticed that the servo twitches occasionally. I tried different servo and ever multiple servos in parallel - they all twitch, but not at the same time. At first I suspected power supply issue, but ruled that out. I even added ferrite bead on a servo's cable to eliminate any potential hf noise, but to no avail. Than I zoomed in on my scope and noticed a few nanosecond square pulse right before the proper PWM pulse. I can change the duty cycle to whatever I like, but this additional pulse stays there to matter what. I recon it might be the reason the servo twitches. Did any of you notice anything like this before?

Re: Problem with PWM. Extra pulse

PostPosted: Wed Mar 20, 2019 5:50 pm
by Agentsmithers
Rodriguez wrote:Hello. This is my first post, so hello to everyone.
I'm new to 8862, especially native SDK. I wanted to play a bit with PWM and servos. I wrote some basic code:
Code: Select alluint32 duty = 100000000;
    pwm_init(20000, &duty, 1, io_info);//~50Hz
    pwm_start();

but I noticed that the servo twitches occasionally. I tried different servo and ever multiple servos in parallel - they all twitch, but not at the same time. At first I suspected power supply issue, but ruled that out. I even added ferrite bead on a servo's cable to eliminate any potential hf noise, but to no avail. Than I zoomed in on my scope and noticed a few nanosecond square pulse right before the proper PWM pulse. I can change the duty cycle to whatever I like, but this additional pulse stays there to matter what. I recon it might be the reason the servo twitches. Did any of you notice anything like this before?



8266?

I've never noticed it before when i was using PWM. I'll try and do a capture here in a few weeks and keep this on my radar and let you know.

Re: Problem with PWM. Extra pulse

PostPosted: Fri Mar 22, 2019 2:31 am
by Rodriguez
8266 ofc :D I'll try to post some screen dumps later this evening.

Re: Problem with PWM. Extra pulse

PostPosted: Fri Mar 22, 2019 3:53 pm
by Rodriguez
At first glance all looks fine:
DS1Z_QuickPrint1.png

but if you zoom in, you can see the extra pulse
DS1Z_QuickPrint2.png

in more detail:
DS1Z_QuickPrint3.png