You can chat about native SDK questions and issues here.

User avatar
By Rodriguez
#81216 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?
User avatar
By Agentsmithers
#81226
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.
User avatar
By Rodriguez
#81289 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
You do not have the required permissions to view the files attached to this post.