Web Controlled Servo from a BeagleBone Black

bbb_servo

[Babak] created an in-depth tutorial on how he got his BeagleBone Black to control a servo from a web browser.

[Babak] configured a pin on his BeagleBone Black (BBB) as a PWM line and connected it to the control line on a micro hobby servo. The BBB is running a Node.js web server that displays a simple web page to control the servo. The browser sends a WebSocket request to a small WebSocket node server also running on the BBB that then writes the appropriate PWM value to the pin connected to the servo.

The code for node WebSocket server and web server can be found on his GitHub page. There is also a small node library to control PWM lines on the BBB. Though the end result is simple, controlling the servo can be done from any browser that can make a network connection to the BeagleBone Black. Check out the video after the jump for a description and demonstration.

[via Adafruit]

Comments

  1. uc says:

    Meh.

    Other than the web 2.0 interface I don’t see anything hack worthy.

  2. r4k says:

    Be warned that even a little 9 gram servo can pull 500 mA under load. Be careful when powering one through the BBB like this.

  3. Derek Anderson says:

    also, servos are PPM controlled, not PWM.

    • tangomilonga says:

      The “RC PWM” used in RC servo control acts very differently than the PWM used in any other system. (In particular, the confusingly similar-sounding direct PWM DC motor speed control works entirely differently). Most RC servos move to exactly the same position when they receive a 1.5 ms pulse every 6 ms (a duty cycle of 25%) as when they receive a 1.5 ms pulse every 25 ms (a duty cycle of 6%) — in both cases, they turn to the center position (neutral position). The low time (and the total period) can vary over a wide range, and vary from one pulse to the next, without any effect on the position of the servo motor. With many RC servos, as long as the “frame rate” (how many times per second the pulse is sent, aka the pulse repetition rate) is in a range of 40 Hz to 200 Hz, the exact value of the frame rate is irrelevant. Most RC receivers send pulses to the RC servo at some constant frame rate, changing only the high time. However, it is possible to command an RC servo to move over its entire range with a function generator set to a constant 10% duty cycle by changing only the frequency (frame rate).

  4. Polaczek says:

    To bad the BBB is sold out everywhere I look and no one has an accurate ship date!! GRrr!!

  5. Jedi says:

    You know what would be hackworthy? http://cointerra.com/engineering-update-asic-bringup-diagnostic-testing/ these people are using BBB. Their promise was: The TerraMiner IV is powered by 4 of CoinTerra’s proprietary GoldStrike I ASICs, a 28nm chip with a minimum performance rating of 500GH/s (0.5TH/s) and power consumption of 0.55W per GH. It operates at a clock frequency of 1.4GHz.

    The actual clock frequency as of shipping is 850mhz per core. They max out at around 1600GHS.
    http://cointerra.com/firmware-downloads/ it would be awesome if somebody more experienced with the BBB could modify the firmware to allow individual core frequency tuning, from like.. 800 to 1400mhz
    maybe a lower low core frequency for the cores that put out more errors or heat

  6. Alex says:

    Wow, can we have another article about a hack like this, except with arduino?

    (this is not a hack)

    • r4k says:

      A “proper hack” would be to use a WiFi router running OpenWRT (these can be had for as little as $10 these days) using the serial port to interface with the microcontroller of your choice to function as a slave to handle I/O.

      There was an article about this on HaD within the past week or two.

  7. Lari says:

    Here is websocketserial server for anyone interested of doing such things with Arduino or any existing serial device. https://code.google.com/p/serwebproxy/

    There are other forks too, i don’t really work with serwebproxy anymore.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 94,025 other followers