Posts Tagged ‘MANOI’

FNR: MANOI + Zombie = ZOMBOI

Posted by Erin, the RobotGrrl on Friday, October 29th, 2010

Here’s MANOI, celebrating a robotic Hallowe’en!

IMG_0139

Its scarf has little pumpkins on it!

IMG_0141

Here is a ZOMBIE motion that tries to steal brains from you, telepathically:

I finally figured out what has been happening with the LEDs and not having enough power to power the SSC-32! It turns out that the IR sensor must draw a bunch of current, which takes away from the available current to power the LEDs and the SSC-32 at the same time. The solution is pretty straight forward for now: turn off the LEDs when using the IR, or turn off the IR when using the LEDs. :)

Happy Halloween!

Posted in: Projects, Robot.

Hockey MANOI

Posted by Erin, the RobotGrrl on Wednesday, October 27th, 2010

Hockey MANOI from RobotGrrl on Vimeo.

Posted in: MANOI, Projects, Robot.

FNR – Robot Mesh Network: MANOI & IRC

Posted by Erin, the RobotGrrl on Friday, October 1st, 2010

Using Twitter as a means of communication between the outside world and my robots isn’t a very reliable solution. Sometimes the website is down, and they don’t return search results in a timely manner. There were a few other options that I through around, like using gchat or IRC. IRC seems pretty fun, plus I have already done some playing around with it through the factbot idea.

To be honest, MANOI hasn’t been powered up since May. There were a few tune ups that were needed. This included a few hours of debugging in order to determine that the TX and RX wires got swapped that were going to the SSC-32. The SSC-32 was also having some power problems, so I added in a new switch:

IMG_9970

The XBee is going to fit in behind the SSC-32, above the gyro and accelerometer sensor. You can see a part of it here:

IMG_9971

Once this was all set, I started to communicate to MANOI through IRC.

Here’s a video of an explanation and demonstration:

Mesh Robots – MANOI & IRC from RobotGrrl on Vimeo.

The IRC bot runs from a Python script. The initial code that I used was from Cmd-c && Cmd-v (cool blog name!). They use the pyserial and irclib libraries. There are specific commands that will trigger certain events. The commands are actually the function definitions, it is all done through the magic of this line of code:

  1. getModuleCallables()[cmd[0]](self.arduino)

The first command that I started out with was to read the force sensitive resistor on MANOI’s hand (kudos to Krafter for donating the FSR)! This is what the function looks like in Python:

  1. def readFSR(arduino):
  2.         print "MANOI Read FSR"
  3.         arduino.send(‘*’)
  4.         arduino.send(‘FSR’)
  5.         arduino.send(‘*’)
  6.         return arduino.read(4)

This is how it gets parsed into MANOI’s Arduino brain:

  1. if(newByte == ‘*’) {
  2.                
  3.                 byte byteIn = 0;
  4.                
  5.                 // Getting the command details
  6.                 while (byteIn != ‘*’) {
  7.                         byteIn = nextByte();
  8.                         msg[it] = byteIn;
  9.                         it++;
  10.                 }
  11.                
  12.                 // Checking to see if we received the message
  13.                 // and seeing how long it is
  14.                 if(it>0) {
  15.                         receivedMessage = true;
  16.                         messageLength = it-1;
  17.                         //analogWrite(greenR2, 255);
  18.                 }
  19.                                
  20.                 if(receivedMessage == true && messageLength == 3) {
  21.                        
  22.                         validCmd = true;
  23.                         ii = 0;
  24.                        
  25.                         // Check each letter to see if it’s right
  26.                         while(validCmd && ii<messageLength) {
  27.                                 if(msg[ii] != fsrCmd[ii]) {
  28.                                         validCmd = false;
  29.                                 }
  30.                                 ii++;
  31.                         }
  32.                        
  33.                         // If it is right, do the command
  34.                         if(validCmd) {
  35.                                 readFSR(false, true);
  36.                         }
  37.                        
  38.                 }
  39. }

BTW, this is how we are reading in the Serial data. It’s a pretty fail-safe way of doing it, especially as it is wrapped in the infinite loop. It makes sure that you don’t miss any data!

  1. byte nextByte() {
  2.        
  3.     while(1) {
  4.                 if(Serial.available() > 0) {
  5.                         byte b =  Serial.read();
  6.                         return b;
  7.                 }              
  8.     }
  9.  
  10. }

It’s pretty cool to see it working! For triggering dance moves, it is a basic command called danceCmd. The user then feeds in some argument that lets the Arduino know which one you want. For these examples, I used the argument BAJNGL. It stands for “Both Arm Jingle”, but saying it phonetically is pretty funny too *bajingle*!

Python:

  1. def danceCmd(arduino, args):
  2.         print "Dance Command"
  3.         arduino.send(‘%’)
  4.         arduino.send(args[0]) #bajngl
  5.         arduino.send(‘%’)
  6.         #r = arduino.read((7*19) + 3)
  7.         #print r
  8.         arduino.flush()
  9.         arduino.flushInput()
  10.         return arduino.read(4)

Arduino:

  1. // Pre programmed moves command
  2.         } else if(newByte == ‘%’) {
  3.                
  4.                 byte byteIn = 0;
  5.                
  6.                 // Getting the command details
  7.                 while (byteIn != ‘%’) {
  8.                         byteIn = nextByte();
  9.                         msg[it] = byteIn;
  10.                         it++;
  11.                 }
  12.                
  13.                 // Checking to see if we received the message
  14.                 // and seeing how long it is
  15.                 if(it>0) {
  16.                         receivedMessage = true;
  17.                         messageLength = it-1;
  18.                 }
  19.                
  20.                 if(receivedMessage == true && messageLength == 6) {
  21.                        
  22.                         validCmd = true;
  23.                         ii = 0;
  24.                        
  25.                         // Check each letter to see if it’s right
  26.                         while(validCmd && ii<messageLength) {
  27.                                 if(msg[ii] != bothArmJngl[ii]) {
  28.                                         validCmd = false;
  29.                                 }
  30.                                 ii++;
  31.                         }
  32.                        
  33.                         // If it is right, do the command
  34.                         if(validCmd) {
  35.                                 Serial << "okay";
  36.                                 bothArmJingle(1);
  37.                                 Serial.flush();
  38.                                 Serial2.flush();
  39.                         }
  40.                                                
  41.                 }
  42.                
  43.         }

But here is where the problem starts! Even though the commands that are sent to move the servos on the SSC-32 are attached to Serial2, they still go into the Serial output buffer. This means that when the Python script wants to read four bytes to see if the Arduino responded to the command, it gets the first four bytes of the motion command that are being sent to the SSC-32. It’s confusing because… why would Serial2 be going into just Serial? It’s really weird.

When I try to clear the buffer through Python, it messes up the way the function is handled. In Arduino, you can’t flush the output buffer, only the input buffer. However, I think that you used to be able to flush the output buffer, as I found an excerpt of a book that said that flush had two boolean values fed into it, for input and output. I think it will turn out to be a simple timing process thing for flushing the buffers from Python.

Once I figure that out, I can add on the XBee to MANOI and test it through wireless communication! I also have a ChronoDot that I can add on to MANOI as well, so that it knows what time it is. I kind of destroyed the circuitry for the RoboGlyphs when I tried to use a TLC594 with RGB LEDs. The TLC594 controls the PWM of the LEDs by connecting them to ground. It’s basically reverse of what you normally do. Common cathode RGB LEDs can’t work with this, only common anode. :P Once I save up enough moneys to buy an Arduino UNO Mega, then MANOI will receive that, and the RoboGlyphs will receive MANOI’s older Arduino MEGA. The RoboGlyph’s Sanguino can be used for BubbleBoy. That leaves two normal Arduino boards and one Boarduino left to be used for TECHNOROBOT and for the Transmitter and Receiver. The Yoda Rampage Robot already has an on-board Arduino on it. :)

Here’s the link to the Arduino code:

Click to download MANOI_awareness v01 pde

Here’s the link to the Python code:

Click to download Arduino IRC v01 py

Thanks to comm.cslabs’s IRC channel for being to withstand the numerous tests on MANOI and IRC bot. Glad I haven’t crashed it yet!

Here’s a photo of some pretty leaves at sunset being hidden by some technology (a telephone and power pole).

IMG_9975


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

Posted in: MANOI, Programming, Projects, Robot.

Friday Night Robotics – Gyro in MANOI’s Back

Posted by Erin, the RobotGrrl on Friday, June 11th, 2010

Friday, June 11th, I originally wanted to work on BubbleBoy and the swashplate, but it seems as though the axels that I bought ages ago were too big. They could only fit in the big servos, but BubbleBoy uses micro servos.

IMG_7516

MANOI’s gyro and accelerometer were in need of being more securely mounted, and the area in MANOI’s back is a great place to mount them. You can hardly see them, but the gyro is mounted on the right wall, and the accelerometer is mounted on the back wall. There’s a piece of foam in there to protect them, and keep them more secure.

IMG_7520

The Serial Servo Controller (SSC-32) is what is mounted on top of these, and it was previously only attached to MANOI by velcro. Now there’s some wire tied through its waist and through the SSC-32 to hold it in place!

IMG_7527

That was about it for that Friday. The readings from the accelerometer and gyro are definitely less jumpy, and MANOI’s center of gravity is moving around less now. :D

Posted in: MANOI, Projects, Robot.

Grabbing MANOI’s Accelerometer and Gyro Data

Posted by Erin, the RobotGrrl on Wednesday, June 9th, 2010

Screen shot 2010-06-09 at 10.18.36 PM

Last FNR I embedded MANOI’s Accelerometer and Gyro into its back. Usually what people do first when they add these motion sensors is make their robot self balancing. :) For now, I’m going to see if I can do something a little cooler.

The idea stems from a Fast-Fourier Transform result for sound- where you can see the various volumes and such. (Check out my Processing Fancy FFT). What I’m aiming to create is a FFT for motion. Basically, if you move MANOI around, the algorithm will be able to detect a pattern and do stuff afterwards. Essentially what this is leading up to is an interesting dancing robot. =)

I’m starting off with a Processing program that will visualize and log the data (see above screenshot). I envision a split-view display with two cubes. One will be showing the live sensor input, the other will be showing the results of the pattern algorithm to the live data.

No idea yet how the algorithm will turn out. I’m probably going to start at a very basic level, and perhaps add complexities on later. It will be interesting to see how this will turn out!

Soon to be blogged…

  • The FNR that I mentioned, but didn’t blog about
  • RampageRobot!!!
  • RoboGlyphs

Posted in: Programming, Projects.

MANOI’s Antennas and Tidying Up

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

One of the annoying things about MANOI is that there are many things that can break very often. The antennas broke very often, mainly at the plug part, where the wires plug into the Arduino, and thankfully not the difficult part, the leads to the LEDs. The wires connecting the LEDs to the Arduino were way too long and throwing off the center of gravity for the balance. Also, the leads for the LEDs were uncovered. This is not aesthetically pleasing, and it is unsafe.

First step was to remove the wires currently attached to the LED (these were red white green black wires), cut the new wires (red orange yellow brown) to a shorter length. Solder on the new wires, and use green shrink wrap. The green is important, since this colour matches MANOI’s colour scheme ;)

IMG_6460

When all four are done:

IMG_6470

The terminals were where a lot of breaks occurred, so these had to be improved. The previous way this was handled was that I soldered the wires to pins on a 3 pin male header, then placed hot glue around the solder joints. This time, I used shrink wrap instead of the glue.

IMG_6471

It makes sure that it is nice and sturdy. People can actually touch it now, and it won’t break! :P

IMG_6467

The ground bus was also very messy the first time around. This was now fixed, and cannot be seen since it will be within MANOI’s head unit.

IMG_6547

After positioning and hot gluing, it looks great!

IMG_6548

The new antennas really go with the colour theme :)

IMG_6553

Here you can see that the wires are much tidier.

IMG_6559

IMG_6560

IMG_6568

And voila! MANOI looks much happier now.

IMG_6601

As for the rest of tidying up… I made a quick battery caddy out of a watch tin to keep my batteries organized into charged or needs to be charged!

IMG_6718

On MANOI’s other hand with the hockey stick is this adapter that sort of extends the hand from the servo a bit. I figured I might as well add it to the other hand as well. I also fixed the bows with the jingle bells and reattached them to MANOI’s wrists- that’s what the velcro is for in the below picture :)

IMG_6721

Fixed MANOI’s hockey stick plug in adapter wires:

IMG_6723

The next improvement was to the power switch that powers the servos. The switch keeps on breaking, so I wanted to redo it. Since I was redoing it, I figured I might as well use one of the switches that lights up! Since there’s three prongs, and one of them is a Ground, I wanted to be overly careful and make sure I test it first…

IMG_6723

IMG_6726

IMG_6729

The switch works, lights up, and doesn’t blow up! :D It’s rated for 12V, and the battery is 11.1V. Hopefully there is enough wiggle room there. I’m pretty pleased with the way it looks and works in comparison to the broken switch.

IMG_6740

That’s about all that has been accomplished this far. There’s still a lot more to do! On my workdesk now I have two ultrasonic sensors, a gyro and accelerometer, and many photoresistors (LDR). I want to somehow hook up the LDRs to MANOI and make a program where I can shine a light at them, and MANOI would move accordingly. Taking it a step further, I’d attach the light to a Wii Nunchuck where MANOI could number crunch and analyze the accelerations from the nunchuck to do something — maybe make a prediction about where the light will be going. It would sort of be like a game of Simon, only the “Simon” would be MANOI, and would be actively trying to outsmart you. :P

Posted in: MANOI, Projects, Robot.

MANOI-in-a-box

Posted by Erin, the RobotGrrl on Wednesday, March 24th, 2010

MANOI Team 229

Team 229 is heading to a FIRST competition this week- and since I don’t have three tests on one day I can actually go to this one! WOOHOO!

The location of this competition is one of the most awesome ones… APPARENTLY iRobot scouts people there. Meaning, they’re hunting for smart brains to hire during the summer. :XD: Even though I don’t roll with military style robots (they aren’t supposed to be sociable), that’s pretty cool, to be honest.

I figured that it would be awesome to carry MANOI around and just having it wave its arms, with a Team 229 flag (see picture above). :D I think some High Schoolers may enjoy that.

Transporting MANOI for the past few years has been a hassle… so we finally found a good box with styrofoam stuff in it! The styrofoam is actually really nicely engineered, because it comes cut into rectangles, which means that you can easily customize it. This is how MANOI fits in its new box:

MANOI Team 229

There is room for MANOI’s basic needs in there- the batteries and charger, ping pong balls, USB cables… etc.

MANOI Team 229

The outside needs more stickers, but I have the classic FRAGILE one, and a “Made with LabVIEW” sticker — even though it’s not even relatively made with LV. Hahahaha! I’m thinking of printing out a picture of an Arduino and taping it on there. :)

MANOI Team 229

The other day, a member of CUARC with a dremel cut a hole in this metal box for me… :D Can you guess what is on the inside?

MANOI Team 229

IT’S A MINTYBOOST! YAY!

MANOI Team 229

This will provide MANOI’s microcontroller with the power that it needs while cheering on Team 229 :D

I haven’t programmed the motions yet for MANOI, but I can do that in the hotel tonight. I’m thinking that the legs will be stationary, and just have the arms move around. Also thinking of using the Wii nunchuck to control which sensors are being read or something. I will indeed post the code when I make it! =)

Posted in: Art, MANOI, Projects, Robot.