Posts Tagged ‘library’

RoboBrrd: Three Bad Things

Posted by Erin, the RobotGrrl on Saturday, April 9th, 2011

IMG_1256

I like to think of robotics as the art of trying to accomplish something despite the numerous things that don’t work. Last week, before heading off to GTR, I made an effort to try to get a RoboBrrd video done. It didn’t happen, because there was a crazy number of things that didn’t work.

IMG_1248

I tried to use the TLC5940 chip that also controls RoboBrrd’s eyes to control the servos. It was hard to set up because there had to be many short wires attached to places that already had a lot of wires attached. I used two LiPo’s in series as the battery, for a total of 7.4V. Some of the servos were working, some were acting funny. I added in a 10uF capacitor to see if filtering the voltage would help. One of the servos stopped working… I wondered why, and read the product’s specs (this is probably best done BEFORE you start to do anything with the product). They are only rated for 6V!

IMG_1284

The TLC5940 was sloppy at controlling the servos anyway, so I decided to go with the servo library. At this point, I also needed a voltage regulator to bring down the voltage to 5V. I got the LM317, and prototyped it on a breadboard first. It seemed to work okay, so I soldered it onto the protoboard. Once I plugged in a servo, the voltage would drop down to 2V, and the servo wouldn’t move. After much help with the kind people in irc.freenode.net#fmcg, we deduced that I used the wrong pinout for the plastic package. See, the old guy at the electronics store printed out the first page of the LM317 datasheet and kindly drew on it the pinout. The pinout he gave was wrong.

IMG_1300

Once the LM317 issue was fixed, it was getting extremely hot. This was quickly and easily fixed with a giant heatsink.

The final issue was encountered during the Robot Party on Thursday. There’s some sort of conflict between the TLC5940 library and the servo library. On the higher level, the Tlc.init() function is causing the problem. I haven’t looked into the lower level causes of it yet. Has anyone else had this problem?

The RoboBrrd videos have to start rolling, so I decided to throw in another Arduino to quickly fix the issue. It would be great to find a better solution, though.

You can see the video LIVE on Ask an Engineer tonight! Woohoo!

Or, you can watch it here:


RoboBrrd Introduction from RobotGrrl on Vimeo.


Or on YouTube.

There is still a lot of stuff that I have to do, but we’re at a good place now to start the videos. Here’s a list:
- Add in sensor functionality to RoboBrrd
- Make the base able to move
- Cover the other panels with green felt
- Decorate the base
- Make RoboBrrd #2 so #1 can interact with it (so it won’t be lonely)

When the videos get rolling, that’s when more of the DIY posts will start showing up! :)

There are a bunch of new photos in the RoboBrrd collection for your viewing pleasure!

This is a really exciting robot, and thanks again to Adafruit for sponsoring all of the electronics. Woot woop!



Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License. GO OPEN SOURCE!

Posted in: RoboBrrd (thx Adafruit!).

Arduino SSC32 Library

Posted by Erin, the RobotGrrl on Tuesday, May 4th, 2010

SSC32

When you google “Arduino SSC32″ my tutorial on Nuvvo is the first to show up, I figured I might as well make a library for the Arduino to help the other users out there get started with their SSC32.

There are three main parts to using this library:

  • Initial positions
  • Frames
  • Set the frame

The initial positions are going to be your home position of all of your servos. For a humanoid, this is usually a standing position that is balanced. Setting the initial positions looks like this (in general):

  1. int HOME0 = 1800;
  2. int HOME1 = 1500;
  3. int HOME2 = 1050; // 1000 for normal, 1050 for gyro
  4. int HOME3 = 1300;
  5. int HOME4 = 800;   // 1300 for hockey, 800 for normal
  6. int HOME5 = 1600;
  7. int HOME6 = 1900;
  8. int HOME16 = 1550;
  9. int HOME17 = 1250;
  10. int HOME18 = 1000;
  11. int HOME19 = 1600;
  12. int HOME20 = 1600;
  13. int HOME21 = 1500;
  14. int HOME22 = 1250;
  15. int HOME23 = 1000;
  16. int HOME24 = 1580;
  17. int HOME25 = 1600;

In animation, the still pictures that make up a movie are called frames. Moving a bunch of servos or a robot according to frames would make sense. Here is an example of a home frame:

  1. int homeFrame[17] = {
  2.       HOME0,
  3.       HOME1,
  4.       HOME2,
  5.       HOME3,
  6.       HOME4,
  7.       HOME5,
  8.       HOME6,
  9.       HOME16,
  10.       HOME17,
  11.       HOME18,
  12.       HOME19,
  13.       HOME20,
  14.       HOME21,
  15.       HOME22,
  16.       HOME23,
  17.       HOME24,
  18.       HOME25
  19. };

Initialize the SSC32 library by setting up the object like this:

  1. SSC32 ssc(true);

The true/false parameter does not effect anything. It has to be there because, for some reason, the library doesn’t compile with no parameters. :P

In the setup() function, the servos have to be enabled. For MANOI, the arms are plugged in to ports 0-6, and the legs from 16-24 and the bad knee is on port 31.

  1. for(int i=0; i<7; i++) {
  2.     ssc.servoMode(i, true);
  3.   }
  4.  
  5.   for(int i=16; i<25; i++) {
  6.     ssc.servoMode(i, true);
  7.   }
  8.  
  9.   ssc.servoMode(31, true);

The last step is pretty simple- just set the frame using this function:

  1. setFrame(int theFrame[], int moveTime, int delayTime);

Example:

  1. ssc.setFrame(homeFrame, 1000, 100);

Delay time is the amount of time you want to delay after the movement. Move time is how long the servos take to go from their current position to the positions in the frame.

Things that you must do in order for the library to work (mainly common sense):

  • The frame references the position of the servos in sequential order. Meaning, it’s servo #0, #1, #2, #3 … #31. You can’t mix the order around, it won’t work.
  • If the servo is in the frame, it has to be enabled. :P If it is not enabled, then everything will be confused.
  • Have the SSC32 connected to the Serial port. If you need it to be Serial1, then you can change it in the library’s cpp file (just do a find+replace) ^_^

The SSC32 library uses the Arduiniana Streaming library. Be sure to download and install it into your sketches/libraries/ folder!

Download the SSC32 library here!

There is an example included. :)

Let me know of any bugs that you find, or how anything can be optimized! :D

Posted in: Programming, Projects.