Servo control with Raspberry Pi
#1
Servo control with Raspberry Pi
Hello!
I'm trying to control a servo with a Raspberry Pi using a library called piblaster.js which enables PWM on some GPIO pins, but for some reason it doesn't work. I can use piblaster to change the brightness of a LED, but when I connect the pin to the signal wire of the servo it always go to the same position, even though I change the value of the PWM.
Does anyone have any ideas of what I'm doing wrong?
Thanks!
I'm trying to control a servo with a Raspberry Pi using a library called piblaster.js which enables PWM on some GPIO pins, but for some reason it doesn't work. I can use piblaster to change the brightness of a LED, but when I connect the pin to the signal wire of the servo it always go to the same position, even though I change the value of the PWM.
Does anyone have any ideas of what I'm doing wrong?
Thanks!
#2
Maybe I should add a bit more info, I was tired when I posted so I probably left some things out.
I've attached a picture showing how I connected everything. The servo worked when I used a transmitter and a receiver, but when I used the Raspberry Pi it did not. I tried with another type of servo (a Futaba S3003) but it didn't work either. I've seen other people use piblaster to control servos but for some reason it doesn't work.
Here's some short javascript code showing how I used the GPIO pin:
var piblaster = require("pi-blaster.js");
piblaster.setPwm(17, <some value>);
I've attached a picture showing how I connected everything. The servo worked when I used a transmitter and a receiver, but when I used the Raspberry Pi it did not. I tried with another type of servo (a Futaba S3003) but it didn't work either. I've seen other people use piblaster to control servos but for some reason it doesn't work.
Here's some short javascript code showing how I used the GPIO pin:
var piblaster = require("pi-blaster.js");
piblaster.setPwm(17, <some value>);
#3
Tech Regular
iTrader: (24)
In your block diagram you show an ESC between your power source and servo power leads. I'm assuming by ESC you mean Electronic Speed Control. Only thing I can figure is you are using it for a voltage regulator. Try running the servo on a dedicated power source between 5-6 volts.
If that doesn't work try viewing the Output of a receiver on a Osciloscope. Then compare this output with what your getting from the Rasberry PI. The modulation is probably different.
Good luck.
If that doesn't work try viewing the Output of a receiver on a Osciloscope. Then compare this output with what your getting from the Rasberry PI. The modulation is probably different.
Good luck.
#4
Your diagram doesn't show a ground between pi and servo. That's not going to do anything. I'm no expert on this but a quick google image search brings up lots of pics and diagrams and every single one I looked at showed at least signal AND ground to the pi.
#5
Tech Champion
I agree with wingracer. Certainly worth trying.