Hello!
I think this is PWM noise...
I am building a robot, i have two tracks which are controlled with two H bridges (or i think so - off the shelf solution), everything is working beautifully, but recently i have added a cheap chinese servomechanism (SG90 Tower Pro) to pivot the camera. The pivot works reasonably well (Raspberry Pi + PWM =
) but when i am sending any command to move and engage track motors, the servo is going crazy.
To power this thing i am using a 2A switching voltage regulator (and 7.2V Li-Ion battery)
My command to move servo looks like that (python):
pwm = GPIO.PWM(18, 200) <-initializing servo on pin 18 with 200Hz PWM modulation
pwm.start(25) <- setting in% value of PWM signal
time.sleep(0.3) <-time for servo to move
pwm.stop() <-switching off the signal and leaving the servo in previously defined position
I am initializing servo for each swing and deactivating it after that in order to prevent the shaking which occurs due to poor Raspberry Pi PWM capabilities
And this works as a charm (well... almost...)
I am powering this servo directly from the Raspberry Pi pins and thourgh that the voltage drops at RPi are making this interference so i have installed 10V 1000uF cap on servo power wires - servo is still crazy...
My solution will be to controll power of the servo with a transistor, or add an arduino...
But for now, any ideas what to or why is this happening?