Posts Tagged ‘Robot’

Buddy 4000 + BLE App (work in progress)

Posted by Erin, the RobotGrrl on Wednesday, June 5th, 2013

We’ve been long awaiting the days when communicating to our robots from an iOS device would involve less jumping through hoops! BLE on the newer iOS devices is pretty sweet.

Here is a video demo of our app interacting with Buddy 4000 using BLE!

We’ve been working on this off and on for a few months. Actually, half of the core functionality was finished a while ago (sending data from the iOS device to the robot). The BLE module we were using wasn’t configured properly to send data from the robot to the iOS device, and we didn’t have a TI CC debugger needed to re-program the BlueGiga chip so yeah… When we heard that @sectorfej had new modules in his InMojo store, we quickly bought one!

Here is the BLE module (wires are 5V, GND, TX, RX):

ble_buddy_wip 004

There’s a great BGLib library for this module that has all sorts of features packed in to it. There wasn’t much documentation about sending data… Here’s how to do it:

  1. ble112.ble_cmd_attributes_write(20, 0, data_len_var, data_var);

The number 20 is the hard part. We couldn’t figure out where to find the info about this number or anything… so we iterated from 0-49 to find it! You might have to do the same for yours as well. Just keep an eye open on Xcode for when data is received on the app side, and then narrow down the numbers until you find the one that works.

We didn’t show this in the video, but we use sending data from the robot to the app for triggering sounds. Specifically owl and fart sounds. (Yes, this might be the most complex fart app to date). It works better with RoboBrrd, as it has sensors that can be used to trigger the sounds.

Anyway, most of the ‘core functionality’ of the app is involved with this (below) and the communication. We can even make it auto connect to a particular device (as you saw in the video), which makes the experience even more seamless.

ble_buddy_wip 003

Here is how auto-connection is done. We save the UUID and name of the device, then check if we see that specific one:

  1. - (void) connectToDefault {
  2.     // ok, let’s try this
  3.    
  4.     if(connected) return; // already connected don’t do anything
  5.    
  6.     NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
  7.     NSString *givenUUID = [userDefaults objectForKey:defaultDeviceUUIDKey];
  8.     NSString *givenName = [userDefaults objectForKey:defaultDeviceNameKey];
  9.     //CBUUID *zeeUUID = [CBUUID UUIDWithString:givenUUID];
  10.     CFUUIDRef zeeUUID = CFUUIDCreateFromString(kCFAllocatorDefault, (CFStringRef)givenUUID);
  11.    
  12.     int i = 0;
  13.     for(CBPeripheral *periph in allPeripherals) {
  14.        
  15.         if(periph.UUID == zeeUUID) {
  16.             NSLog(@"same UUID");
  17.             if([periph.name isEqualToString:givenName]) {
  18.                 NSLog(@"same name – let’s try to connect");
  19.                 self.peripheral = periph;
  20.                 [bleManager retrievePeripherals:[NSArray arrayWithObject:self.peripheral]];
  21.             }
  22.         }
  23.        
  24.         i++;
  25.     }
  26.    
  27. }

Sometimes specific BLE modules have certain service UUIDs and characteristic UUIDs that you can only send data to. We’ve never experienced a problem with ‘spamming’ everything (yet), but we built in this feature just in case. This is when data is being sent from the app to the robot.

  1. CBUUID *uuidService;
  2.     CBUUID *uuidChar;
  3.    
  4.     int ss = [selectedShield intValue];
  5.    
  6.     switch (ss) {
  7.         case 0: {
  8.             // any
  9.             uuidService = [CBUUID UUIDWithString:roboBrrdServiceUUID];
  10.             uuidChar = [CBUUID UUIDWithString:roboBrrdCharacteristicTXUUID];
  11.         }
  12.             break;
  13.         case 1: {
  14.             // kst
  15.             uuidService = [CBUUID UUIDWithString:kstServiceUUID];
  16.             uuidChar = [CBUUID UUIDWithString:kstCharacteristicTXUUID];
  17.         }
  18.             break;
  19.         case 2: {
  20.             // dr kroll
  21.             uuidService = [CBUUID UUIDWithString:drkrollServiceUUID];
  22.             uuidChar = [CBUUID UUIDWithString:drkrollCharacteristicTXUUID];
  23.         }
  24.             break;
  25.         case 3: {
  26.             // redbear
  27.             uuidService = [CBUUID UUIDWithString:redbearServiceUUID];
  28.             uuidChar = [CBUUID UUIDWithString:redbearCharacteristicTXUUID];
  29.         }
  30.             break;
  31.         default:
  32.             break;
  33.     }
  34.    
  35.    
  36.     for(CBService *aService in self.peripheral.services) {
  37.         if([aService.UUID isEqual:uuidService] || ss == 0) {
  38.             for(CBCharacteristic *aCharacteristic in aService.characteristics) {
  39.                 if([aCharacteristic.UUID isEqual:uuidChar] || ss == 0) {
  40.                     [self.peripheral writeValue:sendData forCharacteristic:aCharacteristic type:CBCharacteristicWriteWithResponse];
  41.                 }
  42.             }
  43.         }
  44.     }

This also allows us to do certain actions for different shields. While going through the example code for the RedBear BLE shield, we noticed it needed a ‘reset’ (or something). We haven’t tested this yet, but hopefully it will make the RedBear one work:

  1. if([selectedShield intValue] == 3) { // redbear shield is weird
  2.        
  3.         CBUUID *uuidService = [CBUUID UUIDWithString:redbearServiceUUID];
  4.         CBUUID *uuidChar = [CBUUID UUIDWithString:redbearResetRXUUID];
  5.         unsigned char bytes[] = {0×01};
  6.         NSData *d = [[NSData alloc] initWithBytes:bytes length:1];
  7.        
  8.         for(CBService *aService in self.peripheral.services) {
  9.             if([aService.UUID isEqual:uuidService]) {
  10.                 for(CBCharacteristic *aCharacteristic in aService.characteristics) {
  11.                     if([aCharacteristic.UUID isEqual:uuidChar]) {
  12.                         [self.peripheral writeValue:d forCharacteristic:aCharacteristic type:CBCharacteristicWriteWithResponse];
  13.                     }
  14.                 }
  15.             }
  16.         }
  17.        
  18.     }

The above is called whenever data is received by the app- eg:

  1. peripheral:didUpdateValueForCharacteristic:error:

When it is all working, it’s really fun to interact with the robot in this way!

ble_buddy_wip 002

There are still some wonky things that happen. For example, if you send too much data- or if you send it at the same time. Sometimes we don’t even know what we did and it will just disconnect (though thanks to our code, it re-connects quickly and without interrupting the user). This happens infrequently, so it might be odd cases.

Special thanks to @macisv, who at SecondConf last year taught me lots about BLE and let me experiment with it! And of course @sectorfej for making this great module that we used :)

Now for the hard part: completing and releasing it. It’s kind of weird, even though we are using this quite often… we have kind of come to dislike this interaction (of pressing and holding buttons) because it’s quite boring. So we’re not sure yet if this one will be finished, or if we’ll be trying something else, perhaps with more gestures and such.

ble_buddy_wip 001

More fun coding ahead! :D

Posted in: BLE, iPhone, Programming, Projects, Robot.

Fun Robot Project Complete

Posted by Erin, the RobotGrrl on Sunday, April 21st, 2013

toy3dprobot31

Hooray! The iterations on the ‘Fun Robot Project’ are complete! Since the last post, more work was done on the faceplate/style aspect.

The first idea was to print the style directly onto the piece. However, this made accessing everything inside of the pieces quite difficult. Shown below is the head, with the LEDs and servo in it.

toy3dprobot2

It looks cool from the outside, but it had to be glued together (yikes).

toy3dprobot4

That really didn’t work out. Instead, went with separate pieces for the styles.

toy3dprobot8

In the CAD it was pretty easy to make ‘negative’ extrusions- so they could be printed in a different colour of filament. In order to do this properly, the shapes were scaled down by 0.96. If it was a (what I call) ‘inside-facing-shape’, then it was scaled up by 1.01. This would leave enough space for the kerf, so it could be glued in.

toy3dprobot13

The colours make it look snazzy!

toy3dprobot14

This wasn’t done using dual-extrusion, we’re debating whether it would be worthwhile to upgrade or not. Taking these off the build platform has to be done very carefully, otherwise they jump all over.

toy3dprobot3

Now for the electronics! There is enough space inside of the body of the robot for everything. There are two perfboard breakouts: one for the RGB LEDs, and one for the servos and power distribution. The microcontroller is a 3.3V Arduino Pro Mini, and a LiPower board transforms the 3.7V (or whatever it is, can’t remember) to 5V for the servos and LEDs.

toy3dprobot23

toy3dprobot26

Here is how it all fits inside of the robot. The servo cables and battery are nearest to the front wall:

toy3dprobot22

Everything gets patiently wiggled inside. The servo & power perfboard breakout goes near the bottom.

toy3dprobot21

That breakout then gets folded over, and the servos are plugged in.

toy3dprobot19

Finally, after more poking, it looks like this!

toy3dprobot27

Since it has its battery inside, it will be able to be wireless. Maybe there is room inside somewhere for an XBee as well. ;)

Because of the sockets that are on the arms, head, and feet, it has a few degrees of posability. Combining the poses with the servo movements is going to be fun. Check it out!

Robot is greeting you:

toy3dprobot36

Robot is sad:

toy3dprobot33

Robot is happy:

toy3dprobot32

Robot is cool:

toy3dprobot29

This week we’ll be working on programming it, making a video, getting it on the RoboBrrd Store, and documentation.

But of course before all of this happens- we need to find a name for this robot! We originally made it to look similar to the old ‘tin toy’ robots. Hmm…

Anyway, it is nice to reflect on where this robot has emerged from. Check it out, taking a leisurely swim in the pool of fails!

toy3dprobot44

toy3dprobot42

More robots to come… of course!

toy3dprobot40

ROBOT DANCIN DANCIN TO THE MUSIC OF STEPPERS STEPPIN!

toy3dprobot39

Posted in: 3D, Fun, Projects, Robot.

Robot Project Decade of Iterations

Posted by Erin, the RobotGrrl on Tuesday, April 9th, 2013

It has been another set of 10 tests since the last post (attaching pieces together tests #1-10)! This means that this robot has so far taken at least two ‘decades’ of iterations. Let’s take a look at what has happened! Here is the current robot, as a result of all these iterations.

IMG_8140 - Version 2

I document & organize the 3D prints very carefully- here you can see the tests in separate bags. Mainly do this in case it’s needed to go back and look at old iterations, but it is also nice to see a real physical trail of the previous design errors ;)

IMG_8111 - Version 2

Before we start out on each iteration, here is one of the final-ish assemblies that has some pieces from some of the tests.

IMG_8112 - Version 2

Test #9

Here was a test again of the main body assembly. The side pieces (ones with the servo holders) worked out, but the rest of them didn’t really. Also funny: the leg plate was using 5mm sockets for the legs.

IMG_8127 - Version 2

Test #10

The design became a little taller! Sockets on leg plate were improved. Beginning the race of iterations for the body top piece (bottom row, in middle).

IMG_8113 - Version 2

Test #11

This was a pretty good day of testing! Many more new pieces, also the legs were designed. Initially for the legs, it was going to be a thigh, knee, and foot piece. (A few iterations later, this was discarded)

IMG_8114 - Version 2

Also note the quality of this foot print’s first layer. This is one of my favourite pieces from the whole batch :)

IMG_8115 - Version 2

Test #12

Getting the ball joints on the thigh piece was tricky, as they kept popping off. In a later iteration, this was changed to be a socket- with a new two ball piece to join the two sockets. More trouble with the body top piece, also it looks like there are still some nuts in there!

IMG_8116 - Version 2

Test #13

The arm of the robot also started out similar to the leg, where it would have a separate upper arm and lower arm piece. The upper arm piece (top right) didn’t work out too well as the sockets sort of disintegrated with the insertion and removal of the ball piece.

IMG_8117 - Version 2

Test #14

More tests, and a failed print (on the right).

IMG_8118 - Version 2

Test #15

This body top piece was extremely difficult to get right. Many of the iterations were for changing the height of the piece to add more or less room to insert the nuts. In the end, the piece was redesigned from scratch.

IMG_8119 - Version 2

Test #16

A new assembly designed- for the head! The head originally did not have the servo in it, but rather an adapter for the socket on the bottom.

This was also the test where the printer stopped working afterwards. The time between test #16 and #17 was actually a few days. Luckily the printer is still working so we could carry on!

IMG_8120 - Version 2

Test #17

Switch to yellow filament from VoxelFab. It’s less expensive, and yellow is pretty snazzy. Here was more changes to the head, and of course body top.

IMG_8121 - Version 2

Test #18

This was a huge day of testing. The body-side pieces were changed to have the side-mounted screw go through the servo mount. This makes it stronger since now the tab is in the middle of the piece. It also works out well, because the servos hide the screws.

The body-top piece was redesigned to get rid of the nut holders. It works a bit better, but the servo holder was in the way of one of the screws.

IMG_8122 - Version 2

Test #19

More tries with body-top, of course. The one on the left in the middle was a weird idea of a design that both didn’t work or look nice. The idea was to have the servo ‘floating’ above the piece, so that it won’t collide with the two arm servos. It didn’t work.

IMG_8123 - Version 2

Test #20

This was one of my favourite tests, because it really made the robot ‘come together’ by solving one of the huge issues. The servo was moved from body-top to the head, and now the top has the socket. It worked so much better!

IMG_8124 - Version 2

Test #21

Socket improvements on body-top.

IMG_8125 - Version 2

Test #22

For some reason, body-top decided to be mean once more. The sockets just wouldn’t work with the ball-servo piece. So it was iterated on a few times, finally finding one that works.

The ball-servo piece began as something that would clasp onto the servo nub using friction. It would sometimes work, but eventually come loose in the end. The winning design was something that can fit a small servo horn onto the piece, and be attached with hot glue.

IMG_8126 - Version 2

More to iterate

There will still be some more tests to do, especially for the panel pieces that attach on to the frame.

IMG_8144 - Version 2

I’m really excited to finish off this robot! It’s a tribute to all of those old tin-robot toys.

IMG_8139 - Version 2

It is surprising how long it has taken to get to this point of the robot, I was working on it for the entire month of March. Kind of discouraging, I guess I have much more to learn.

What you see now is just the beginning- there will be a few different themes for these robots. Back to printing & designing!

Posted in: 3D.

Weird Eye Robot, Arduino Starter Kit

Posted by Erin, the RobotGrrl on Sunday, November 4th, 2012

Here is a new robot creature that I created! It doesn’t have a name yet, so it’s just called ‘weird eyebrow robot’.

IMG_6967

It reacts differently when you ‘pet’ it and ‘poke’ it. Beware when it ruffles its brow! It enjoys singing short jingles. Rumour has it that the light up googely eye can peer into your soul.

Check out the video to see it in action:


Watch on YouTube

Pretty cool right? All of the electronics were from the Arduino Starter Kit. Here were all the electronics used from it:

  • Micro servo
  • Piezo speaker
  • Potentiometer
  • 3 Photocells/LDRs
  • TMP36
  • RGB LED
  • White LED
  • 2 Yellow LEDs
  • 3 Blue LEDs
  • 2 Green LEDs
  • Lots of resistors…

It actually takes up all of the pins on the Arduino, which is great. All of the LEDs can be controlled individually, and the RGB and white ones (which are behind the googely eye) can have PWM.

Here are the extra parts and tools that were needed. If you don’t have any of these you should get them, or find a substitute. Some of these are obvious, but this list will serve useful for any newbies looking at it!

  • Craft sticks, popsicle sticks, coffee stir sticks
  • String
  • Hot glue
  • Orange paint
  • Purple sharpie
  • Wire, shrink wrap, electrical tape
  • Soldering iron, solder
  • Scissors, wire cutters, wire strippers
  • Googely eye

I started creating the robot just from the popsicle sticks. I wanted to try out a mechanism that was in my brain for a while, a way to control two eyebrows with one motor.

Up:
681001188

Down:
681001232

There is a lot of electronics in the starter kit, which is just awesome. It’s way more than you need, which is super for experimenting! I’m probably going to be using the LM293D for hacking the Useless Machine in a later project ;)

Before opening…
680926754

Inside!
680931994

So there are some interesting things in there… like a servo, funky coloured thing (aka pinwheel), lots of leds. I painted the eyebrow structure orange and this is how the idea is coming along:

681396013

There’s not that many wires for this robot, but I organized them with some tape so it would be quicker to plug in.

A6ujZZHCYAAdMxt.jpg-large

All of the pins are used! Yipee! Happiness!

A6u9qKGCEAMoRnT.jpg-large

With some testing of the pins and such, we can make the robot look differently!

Happy/Content:
681539473

Angry/Evil:
681539173

With some more programming for its behaviour, it is done! (See the video for it in action if you haven’t already). There were some issues when programming it at first- I was writing and testing it when no LEDs were turned on. Since we’re using a breadboard, turning on the LEDs added some noise that I didn’t account for. So I had to scrap the entire program and just rewrite it. It works great now, though! I really like the way it has turned out.

From the side:
IMG_6938

Eye from the side:
IMG_6957

From the top:
IMG_6975

Looking towards the board:
IMG_6993

Board:
IMG_6982

What’s left over (also notice how the eyebrows were cut out of the cardboard from the kit hehe)
IMG_6940

It’s really great to have it running on your desk while you are typing away working on something. It goes to ‘sleep’ after 15 seconds or so, and its white LED does the Apple breathing pattern. When I was editing some of the photos, and got up from the chair, my shadow must have triggered the robot and it woke up, singing a little, so I interacted with it a bit! It’s almost like a real creature!

IMG_6960

Back to the Arduino Starter Kit now… the book is cool. Makes me wonder if in 10 years, will they be rare like the Heathkit instruction books?

IMG_6948

At the end of the video tutorials that go along with the kit, Massimo always says “Arduino is YOU”. So apparently I am a crazy robot builder with an unorganized desk then:

IMG_6946

Thank you RS Components for the Arduino Starter Kit. It was really nice to use it to build another robot. They have videos of Massimo explaining the projects and such over here. Everyone should check it out and let their imagination run with it! Maybe even build a sibling to ‘Weird Eye Robot’, haha.

Arduino is YOU! Weird eyebrow robot is CREEPIN’! -)
IMG_6945

Also, if you noticed all of the wire, I finally used up the last of my yellow wire, and heat shrink. So right now I don’t have any stranded wire, and I’m running low on the solid core wire. If any of you readers know anyone out there who can donate a spool of wire, and some heat shrink, please let me know! Any help is really appreciated! Thanks!

Posted in: Electrical, Fun, Projects, Robot.

Learning Pet – Thanks for voting!

Posted by Erin, the RobotGrrl on Friday, September 16th, 2011

Thanks everyone who voted for Learning Pet in the Open Hardware Summit Scholarship! It was much appreciated! We didn’t place in the top 3.

Here was a fantastic interview by Ian Cole, thanks so much Ian!



The future of Learning Pet is that there will be time spent on apps4arduino to make some money in order to be able to purchase some laser cut parts, 3d parts, and boards.

Here are some stats of the contest that I collected from the webpage:

- 51.9% had a prototype
- 48.1% showed a demo in their video
- 51.9% had a website
- 3.7% released their hardware files under a license for the open hardware definition
- 22.2% had their hardware files available
- 14.8% had a bom
- 5.6% released their source code under an osi license
- 22.2% had their code available
- 40.7% had documentation
- 22.2% had additional videos
- 59.3% said what they would do with the prize if they won
- 18.5% demoed while at the ohs

You can check out all the documentation for Learning Pet here:
http://robotgrrl.com/learningpet

Thanks again!

Learning Pet will be at the Maker Faire this weekend, so be sure to say hi! (or whatever hi is in robobrrd language)

Posted in: Android ADK, Projects, Robot.

R.I.P. Workshop – Final Day

Posted by Erin, the RobotGrrl on Friday, July 15th, 2011

Today was the final day of building everything before all of our supplies and junk goes away. I can’t believe it is almost the end, and the robot has become very built over the past few days, but it still is not exactly how I want it.

I started off by doing some wiring! Found some yellow LEDs for the eyes, and Niklas is lending me his IR sensor!

Here is how the robot face looks with the LEDs and sensor on it. Its antennas are ends of serial cables!

The LEDs are mounted through the back of the face plate:

Sometime before making the arms, I sent a tweet out for name suggestions. @Kiteaton had a wonderful suggestion- “SCRUMBLEFLIT”, and it just sounds so perfect for this robot. It sounds like “what on earth is going on!” in robot language.

Here are the arms mounted on the stepper motors thanks to much hot glue!

The hand is made out of copper wire, with lots of solder, and the keys say “ROBOT”!

Inside of this can there are screws, to try to make noise. I chose Orange C plus for this because it is tasty and sounds like the programming language, C++.

Took some time to visit the place where I will be showing off SCRUMBLEFLIT, the town hall! It is a pretty decent town hall!

Afterwards I went back and worked with the LEDs for a bit. They are interesting because they cast light along the edge of the circle in the doorknob.

I created a blink that seems believable. I do it by quickly (but not too quickly) fading the LEDs to a low light, to signify the eyelid closing, then it jumps back to bright light, to signify the eye open. Blinking on robots is tricky, because if you don’t do it properly, it looks like as if it is glitching out.

After this, I was working on the arms again. Everything was going fine, the arms were moving, then everything stopped. The power supply wasn’t on anymore. As Niklas later taught me, what might have happened is an exposed wire might have touched the outside casing of the supply, making it go into shutdown mode. Apparently power supplies are really dangerous and can explode a lot. Hopefully it doesn’t make SCRUMBLEFLIT explode!

Anyway, I sort of got it working again a little while later, but the problem now is that it takes ages for the stepper motors to “warm up”. What happens is that everything is plugged in and working, but the steppers aren’t moving. However, if I take the power out of the steppers and plug it back in, you can hear and see it react to the voltage, but it doesn’t keep moving. This has happened before in the previous days, still unsure about what is causing it though. It usually goes away by itself, but when it doesn’t, it is really annoying.

We will see what happens tomorrow. I have to wake up early and move my robot from one place to another since it is in the studio right now, so hopefully it isn’t raining then! Tomorrow will have a lot of explaining about what the robot COULD have done and what it SHOULD do. I enjoy talking about robotics nevertheless though. :)

Everyone’s projects are absolutely stunning! We created so much in a short amount of time, with unplanned materials. Creativity has some amazing super powers!

Here is a video of the robot’s eyes blinking!

Posted in: R.I.P. Banff.

Adafruit + RobotGrrl Team Up

Posted by Erin, the RobotGrrl on Wednesday, March 2nd, 2011

Adafruit Industries and RobotGrrl are teaming together to unleash a super build-a-long robot video series!

The idea is to have a video each week about robotics. The best way to learn about robotics is to dive in head first, so we will be making a sociable bird robot out of popsicle sticks, coffee sticks, hot glue, and electronics from Adafruit.

The videos will serve as a great way to become introduced to the various aspects that are involved with the construction of robots. The exciting part about this is that the robot is not a “traditional” metal and wheels robot. Not all robots have to be made out of metal, and they don’t always have to have wheels. They have to be able to sense and react to their environment.

We’ll be delving into this more in the videos, but here are some teaser photos of prototypes of the bird robot… ;)

Overview

IMG_0737

IMG_0761

All of the files and software that will be used in the making of the robot will be open source too.

There is one teeny tiny problem though… this robot doesn’t have a name! WHAT SHOULD WE CALL IT!?!? Leave a comment here (or anywhere I will notice it) with a cool name suggestion. If yours is the coolest, it will be chosen!

Thanks very much to Adafruit Industries for funding parts for the robot and the the opportunity!



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!).