I am new to bonescript having just received my beaglebone black. I am trying to drive a servo but I can not seem to figure out what to do. I can use PWM to fade an LED but I can’t get the servo to respond. Does anyone know how to drive a servo with a beaglebone black and bonescript?
What Hardware driver are you using to drive the servo? What is the voltage on the servo?
5V on the red wire from BeagleBone Black. Brown wire to the ground on the BBB. Orange wire to ‘P8_13’
I am using an analogWrite(‘P8_13’,0.5,200);
I have read that servos typicly use 200 Hz but might use as low as 50 Hz which I have tried. I know the analogWrite takes a 0 - 1 value for the second augment but I don’t even know how that will translate to angle for the servo.
OK. So, basically I figure you may have 2-3 more tries before the processor blows up. The processor is 3.3V max and the I/O pins cannot sink enough current to make the servo turn. Having 5V on the pins will damage the processor. You need a driver between the processor and the servo.
I will have to look up what you are referring to about a driver. I am using the 5v from the BBB pin P9_5. Will it work using the P9_3 (3.3V)?
I have used the Arduino a lot and the typical setup is power and ground from the board to the servo and then the signal of the servo connected to a PWM pin. That was what I was expecting with the BBB and it’s PWM. Is there an example online or a tutorial?
No it will not work. that is what I am trying to say. You need a driver that will drive the servo lay and can stand the 5V current. Take a look at the LED drivers on the BeagleBone Black schematic. The right transistor in a similar configuration can control the servo.
Here is information on what the limits of the board expansion headers are. Voltage is 3.3V max.
Do a Google search for motor drivers or servo drivers for various circuits that will work.
Thank you for your assistance.
Google BeagleBone Black servo and find:
Tutorial: Controlling a Servo with a BeagleBone Black
adafruit Adafruit_BBIO does not work with ubuntu precise.
You should expand on that... "what" part does not work with ubuntu
precise? do you even have the correct image? Did you contact the
author to get it fixed?
Not sure that is strictly true. Vdd_5v (p9_5/6) supports up to 1amp current draw when the board is powered via the jack. I have been running servos off that pin with a 5v usb phone backup battery providing 2.1 amps plugged into the bbb jack for months with no issues.
I agree that your solution is far superior in the general case, and good practice for motors (especially cheap and noisy ones), but a small servo can be run just fine off the BBB directly.
Having said that, the external power for motors is definitely the preferred route. One of the things the OP should check is the duty cycle of the servo in addition to the current draw. If it is a larger servo, then definitely put it on its own power loop. Otherwise for a micro or hoppy servo you may just need to ensure that the duty cycle is set correctly. 60 tends to work for most analog servo's.
The limit is based on typical applications and the current rating of the pin and the etch on the PCB. There are no electronics that could prevent you from pulling 100A form a supply if it can provide that much. However, I would expect the etch on the PCB to be fried if you did that with smoke along the way.