PriNXT – Mindstorms NXT Printer

24 02 2012

All finished! It took a bit longer than expected (I’ve been tinkering around with some final upgrades and fine tuning for the past few days), but now, at last, it’s working! Check out this video I shot of PriNXT (clever name, I know) yesterday when it was drawing the epically awesome WilsonTech1:

Since this is a pretty long post, I’ve split it up into a few sections for you: Hardware/ Design, Image Processing, Programming, and Conclusion. How considerate of me.

Hardware/ Design – Motors

PriNXT has three motors: two control the X and Y motion, and the third lifts the pen.

The first motor, the one in the middle, is very straight forward – it has two long axes coming out of it that connect to two tiny gears that can drive around on a series of gear racks, moving the contraption about the Y axis. The second and third motor are a bit more complex, since they both point inward and have to move their power around a lot.

The left one, which controls motion on the X axis, basically just gears its power to a really long row of worm wheels, which, when spun, slowly move the part that holds the pen from left to right. The third motor similarly transfers its power to the outside, after which it moves a long rod up and down, pulling the pen along with it no matter where it is. For more details, see PriNXT’s very own Hardware Post.

Hardware/ Design – Sensors

The robot has a total of four sensors: two touch, one light, and one color.

The touch sensors serve the simple purpose to calibrate the robot – it blindly drives towards them until it registers that they’re pressed, which tells PriNXT where to start drawing. The color sensor is used as a signal light to show that the robot has finished calibrating.

The light sensor, only added two days ago, is used for moving the pen, which has actually been one of the hardest parts of this project. Because the beam that moves the pen up and down is slightly flexible, it had to be slightly higher or lower depending on how far to the right the pen was. When the pen would move, this would cause conflicts, so now, instead of being static, the pen now continuously moves up and down a bit to compensate for this movement. The light sensor guides it in this, reading its position and telling it to either go higher or lower.

For the design part, I mostly kept this project in my usual red/ white/ shades of gray color scheme, which I’m actually starting to enjoy using more and more.

Image Processing

A big part of PriNXT was to get it to draw complex shapes and pictures like the one in the picture below.

So this is how it works: first, I import the image into Paint.NET, where I make it black and white, and then edit it a bit to get a better looking result. Then, I export it as a .PBM file, which basically turns the whole picture into a bunch of 1′s and 0′s. Then, I import those 1′s and 0′s into NotePad++, where I reformat them to something my program will understand. Finally, I copy the results into a pre-made array in RobotC, fill in the height and width of gthe image, and I’m done!

For a more detailed description on how to do this, and on how to use this method to display detailed images on your NXT, see this post here: How To: Display Images on Your NXT using RobotC (JPEG, PNG, etc.)

Programming

Mostly, the code for PriNXT consists of the following (in order):

  • Calibration functions for the X and Y motors, which basically drive them both backwards until they hit their respective touch sensors, and then reset their encoders
  • A “moveLinear” function, which very niftily calculates the amount of degrees needed to get to the user specified position, and then calculates speeds for both that allow it to go there in a straight line (if one motor has to move a lot more than the other motor, the other motor slows itself down to help it keep up)
  • A “movePen” function, which.. moves the pen up and down
  • A “drawBinaryImage” function, which draws the image according to the 1′s and 0′s I copy into its 2D “imageToDraw” array using two for loops, one inside the other
  • A “controlPen” task, which keeps the pen at the right height even when the “movePen” function is not called
  • The main task, which controls the rest
Here’s a link to the program: PriNXT.c (SF Code Download)

Conclusion

So yeah, I really enjoyed doing this project, even if it was challenging at times. For even moar pictures and other stuff my robot printed, check out my Google Plus profile (heck, you could even circle me)

And yes, it also drew the text in the header. Go ahead, scroll up and take a look at it :)





PriNXT – Hardware & Pictures

11 02 2012

It’s alive. It’s alive! Well not quite, but I’ve finished building PriNXT, my first Mindstorms NXT printer. I think it turned out great, and it also looks pretty cool, following the color scheme I’ve been using for most of my latest builds (red, gray, white).

It’s got three motors, one color sensor to show what it’s doing, and a touch sensor for calibration. Also, I bundled all three motor cables together for the first time, which actually improved the robot’s performance a lot more than I initially expected it to. Moving on, here are the power paths (how the motors’ power goes to the place it needs to go to) for all three motors, seen from the bottom of the moving printer head:

  • Green: This motor drives the Y axis of the printer using the two  small outer gears as wheels on a track of gear racks
  • Blue: This motor drives the X axis of the printer by, after quite a lot of gears, spinning an extended worm wheel hooked up to a single gear rack. When the axle spins, the gear rack goes from side to side, pulling the pen along with it
  • Orange: This motor makes the pen go up and down. Again, after a lot of gears, it drives a big rod up and down, pulling the pen along with it.

So yeah, there you have it. I’ll start programming it ASAP. Follow me on Google Plus (+Leon Overweel) for progress updates on that, and much more interesting stuff.

More coming soon!





Skype Car – Lots of Numbers

18 01 2012

As planned, today (January the 18th, 2012) was the last day my Skype car was up and running. I’m really happy with how the project turned out, and I’ve had a bunch of great responses. But before we get to that: I was asked to put up some stats, so stats there shall be.

Views per day; graph provided by the goo.gl (see link below)

As of today, the robot has been driven more than 700 times, with an average connection time of about 4 minutes! It’s been used from countries all over the world, including the US, Canada, Australia, Germany, Denmark, Spain, Hong Kong, Ireland, Belgium, South Korea, Bazil, the UK, Malaysia, Puerto Rico, Taiwan, Mexico, France, Switzerland, Iceland, India, and many more. The most popular OS was Windows, followed by Mac, and the most popular browsers were Chrome and Firefox.

If that’s not enough for you, you can hit the goo.gl stats link right here for lotsa more juicy numbers: http://goo.gl/info/7LLaU#all_time

A lot of stuff has been going on around this project, so here’s a timeline with all the highlights:

  • 1/4/2012: Project launch, with a post here, a video on YouTube, and posts on the MindBOARDS and RobotC forums;
  • 1/6/2012: Took the robot offline for the night and better part of the day to solve an issue with the battery’s wire getting tangled and ripping the robot apart – went wireless.
  • 1/7/2012: Featured on the NXT STEP;
  • 1/7/2012: Got asked to become a contributor on the RobotC blog and wrote my first post a few days later;
  • 1/9/2012: Featured on the Make Magazine blog;
  • 1/10/2012: Featured on Engadget! reblogged a load from there;
  • 1/12/2012: Featured on first international website (great article, too);
  • 1/13/2012: Got a YouTube PM from a tech writer for M3, Sweden’s largest gadget magazine, who asked me for HQ photos of my Skype car for their next print issue!

I also had a blast looking at what people thought of my robot, and even messaging with random people who had tried it out – one was a dad, who showing his son what Mindstorms NXT was all about (which was exactly what this project was for), and another one asked me if this was my bachelor project (it’s not), just to name two.

So yeah I hope you all liked it and expect more stuff soon – I’ve got an awesome sensor coming my way.

PS: I’m thinking about entering it into the Google Science Fair. Good idea?





Skype Car – Going Wireless

7 01 2012

Read this first: Interactive Skype-Controlled Mindstorms NXT Car (original post)

Some of you might have noticed that my Skype car has been offline since last night. Why, you wonder? I was trying to solve the issue with the wire tangling around the robot all the time – first, I tried putting it on a high pole, but that just made it worse. Then I remembered an amazing Mindstorms NXT robot I once read about: Pulito, a floor cleaning robot that could look for its own power source using infrared light, and then plug itself in.

Since I do not have any equipment to read infrared light, I had to find another way for the robot to plug in. Here’s what I did:

  • Because the environment my robot was in was way more controllable (a square lined with cardboard boxes), I decided to use the sonar sensor, and make the robot follow the walls.
  • I then made a gap in one part of the wall, so the robot wouldn’t know where the corner was. That causes it to just keep on driving forwards, until it hit the wall on the other side.
  • This is where I got lucky: when I ordered the charger for my new battery, I got the wrong one (the one for the other kind of battery, which was hooked up to my other NXT). Having a spare one, I decided to cut it in half:

  • So when the car hits the wall, it’ll automatically start charging
  • For the programming, I added some code for the ultrasonic sensor and the touch sensors, and wrote some sequences to happen when the robot needs to start charging, and when it’s done.
In other news:
  • The instructions on the actual remote control page are much clearer now, too
  • The robot is now back online.

To read more about my Skype car, click here.

Disclaimer: The Skype name, associated trade marks and logos, the Skype “Call Me” button and the “S” logo are trade marks of Skype.





Skype Car – Improvements

4 01 2012

Read this first: Interactive Skype-Controlled Mindstorms NXT Car (original post)

Today was the first day my robot was online, and, as with any project, problems came up:

  • The wire got tangled
  • People didn’t know how to shut the robot off properly (which is probably why other people weren’t able to connect)
  • The ball caster came off

These are some changes I made:

  • I added a long, flexible rod to the back of the car to hold up the wire, so it’s less likely to drive over it too easily. This should also help against the caster issue, because it mostly came off because the wire was pulling it
  • I put some extra protection around the caster, to make it less likely to come off
  • Towards the bottom of the page with the arrows, you can now read about how to shut the robot down, so people won’t do it wrong anymore
  • In case they do, an alarm will now sound if the robot has been driving in the same direction for longer than 60 seconds.

So thanks for the feedback everybody, and I’ll keep on improving this thing further. To see the changes, go to http://www.goo.gl/7LLaU (you might need to refresh your page).

To read more about my Skype car, click here.

Disclaimer: The Skype name, associated trade marks and logos, the Skype “Call Me” button and the “S” logo are trade marks of Skype.





Interactive Skype-Controlled Mindstorms NXT Car

4 01 2012

After a long wait, I’m back baby! To start the year off with a bang, here’s a Mindstorms NXT car that can be controlled using Skype – by anyone, anywhere, any-when (between today, 1/1/2012 and 1/18/2012).

If you want to get going right away, here is the link for driving this car: http://www.goo.gl/7LLaU.

This is going to be a pretty lengthy post, so I’ve broken it up into the following categories: Introduction/ General ExplanationHardware, Program-mingComputer Tweaks, and How YOU Can Drive This Car. Click any of the categories to jump forward to it.


Introduction/ General Explanation

I’ve been creating websites for a while now, and I was trying to think of a way to combine it with Mindstorms NXT, and this project is the result of that. The webpage is fairly simple – it’s got three arrows (one forward, two to the sides) and a start and a stop button. Clicking the start arrow will begin a Skype conversation with my computer, after which the user should share their screen; the NXT standing in front of my computer (called “Jeeves”) can then “see” the webpage the user is viewing.

That’s where the cool part kicks in – when the user clicks any one of the arrows or the stop button, the page will change to a different shade of gray. This shade of gray is then picked up by Jeeves, who turns it into a Bluetooth message for the other NXT (called “Alfred”). The car then drives in the direction the user tells it to, while remaining within a fenced off area where the webcam can see it.

So, the user can drive a LEGO Mindstorms NXT car, from the comfort of his or her home, without having to install any kind of software (provided that they have Skype).

Hardware – the Car

The car was fairly simple to build – it’s got two motors on the sides with the wheels attached directly (no gears), and a big ball caster attached at the back. It looks quite a bit like my line follower, actually, except for the fact that the caster is a lot bigger because the car needs to be able to drive over the power cable and because it’s on a carpet. Also, it’s got front bumpers so you all can’t break anything while driving it, a color sensor that turns on when the robot is in use, or has been in use the past minute, and a rechargeable battery that’s always plugged in. Some pictures:

The first one is a side view, and the second one is an upside down view.

Hardware – the Receiver

The receiver was a bit more tricky to build because it needed to be a specific height so its light sensor could “see” the right area of the user’s screen. The structure itself is fairly simple – the light sensor is on a big pole attached to the NXT, and it’s got a rechargeable battery that’s always plugged in at the bottom. Here’s a picture of it (without the battery; hence the delay):

Programming

For all of the coding in this project, I’ll provide a basic description of how it works, and then a download link in case you’re interested in trying to build this project yourself sometime. The first two pieces of code (for the car and the receiver) were made using RobotC, and the third (for the website) is in HTML. All of the code will be on Sourceforge.

Programming – the Car

There’s a small function for turning the motors’ PID control on or off  at the beginning of the program to get rid of the peeping noise the motors make when the car is not moving.

In the main task, here’s what happens: the variables are created, the Bluetooth is turned on, and the timer is cleared. In the main while-loop, the last received message is stored, so the robot can later use that information( along with the timer) determine whether it’s been active the last minute and decide to turn the signal light on or off. Then, the robot reads the message last sent to it and plugs it into a switch. Depending on which message it received from the receiver (ah, the irony), it will move the motors. At the end of the while loop, there is a 50 millisecond wait to save battery power.

Click here for the code (first version).

UPDATE: Since the robot is now wireless, the code has changed to support some more sensors for plugging itself in. Read more about these changes here:

http://wp.me/p10flW-l9.

Click here for the code (second version w/ wireless charging capabilities).

Programming – the Receiver

The receiver also starts by initializing its variables and turning on Bluetooth, after which it connects itself with the other NXT – also using Bluetooth. The program then enters its main while loop, in which there is a series of if/ else switches designed to determine what shade of gray the screen is. The if/ else switches then plug this message into the “messageToSend” variable, which is sent out afterwards. The loop ends with a 100 millisecond wait, again to preserve battery.

Click here for the code.

Programming – the Website

There isn’t really much to explain about this one, so I’ll just give you the download link. Please note that the images on the page aren’t included, so you won’t be able to view it correctly in your browser. Screenshot below.

Click here for the code.

Computer Tweaks

There were quite a few tweaks I had to make to my computer, so I decided to list them here in case, again, you want to build this project yourself someday. Keep in mind that I might be missing/ forgetting some things, so if you ever have a problem just leave a comment below.

  • Turned off sleeping mode on both my screen and the computer itself;
  • Skype:  in the general > video settings menu, I changed the first option (“Automatically receive video and screen sharing from…”) to “anyone”;
  • Skype: in the privacy > privacy settings menu, I changed everything to anyone. I also checked all the boxes;
  • Skype: in the calls > call settings menu, I changed “Allow calls from…” to “anyone”, and again checked all the boxes;
  • Skype: in the IM & SMS > IM settings menu, I changed “Allow IMs from…” to “anyone”;

I’m also keeping the Skype window open 24/7, so my background won’t confuse the light sensor.

How YOU Can Drive This Car

Here’s how:

  • Go to http://www.goo.gl/7LLaU
  • Make sure your window is maximized
  • Click the “Start” button
  • Go through the dialog windows you get (there will be more on IE and Firefox than on Google Chrome)
  • Wait for my video to start (this can take up to 20 seconds)
  • Open the “call menu” at the top bar
  • Click “Share Your Screen” – it’s about 3/4th of the way down the menu
  • Click “Share Full Screen”
  • You should now be brought back to the webpage with the arrows. Once you see the car stop, use the arrows to drive it around.
  • To stop, hover your mouse over the little screen where you see the car, and click the red phone button

This project has successfully been tested on the following operating systems:

  • Windows 7

With the following browsers (newest version as of 12/31/2011):

  • Google Chrome (tested best)
  • Firefox
  • Internet Explorer
If you try this project on anything not mentioned above, it’d rock if you could leave a comment stating what you used below so I can add supported  (and not supported) browsers and OS’s. Thanks!

Conclusion

So there you have it: a LEGO Mindstorms NXT car that you can drive using Skype. If you like this project and want to see more, subscribe to my YouTube page and this blog for the latest updates. Once this project ends, I’ll put some statistics on how many people tried this project up down here. Feel free to use anything on this page (the robots, the code, the website, etc.) non-commercially, as long as you give credit where it’s due.

To read more about my Skype car, click here.

Disclaimer: The Skype name, associated trade marks and logos, the Skype “Call Me” button and the “S” logo are trade marks of Skype.





Bionic NXTPod 3.0 – completed

10 06 2011

After more than a momth of designing, building, re-building, programming and debugging, the Bionic NXTPod 3.0 is finally done! Click here to see the final result on its project page!.

The following image cannot be displayed: Bionic NXTPod 3.0

Disclaimer: This site is neither owned nor endorsed by Festo Group. The Bionic Tripod 3.0, on which this project is based, is copyrighted by Festo.





Bionic NXTPod 3.0 – the Gripper

3 06 2011

Creating a gripper really slowed this project down, since I only had one motor port available for it – each NXT needs two for its linear actuators and the master needs one for the NXT-PF cable for communicating using the LEDs, leaving only one port on the slave. Since the weight of a motor turned out to be too much for the moving part of the structure, I used pneumatics instead. the problem with that is the need for at two things: a switch operator and a pumper – two motors.

The following image cannot be displayed: Gripper's multi functional motor - operates both the switch and pumpThe solution came in the form of a differential, which contributes the input power applied to it to one of two outputs depending on which one has a smaller resistance (check this 1930s tutorial for a much better explanation). So when the motor starts turning, it first moves the least resistant part – the switch. Once the switch is all the way to the opposite side, it blocks that output on the differential and makes the motor move the pump – when the motor is spun forwards, the actuator goes up, and when it goes backwards, it goes down:

The following image cannot be displayed: NXTPod's gripper module - motor and actual grabberThe gripper itself is pretty simple, and opens/ closes when the actuator moves the middle part up, pushing the two “fingers” to opposite sides. Its size allows it to grab either the blue or red ball that come with the NXT 1.0 kit.

The following image cannot be displayed: The actual gripperDisclaimer: This site is neither owned nor endorsed by Festo Group. The Bionic Tripod 3.0, on which this project is based, is copyrighted by Festo.





Bionic NXTpod 3.0 – the actuators

20 05 2011

They’re not as compact as the LEGO Technic or Firgelli ones, but these actuators should do their job just right. They consist of a 16 bricks long axle with a freely moving worm wheel on it, which moves along a series of four racks. When the motor is spun, the gear wheel goes up, pulling or pushing the attached pyramid leg along with it. With all of the stuff built around it, the actuator can move up to 10.5 Technic bricks up and down, in about 10 seconds.

The following image cannot be displayed: One of the NXTpod's four actuatorsThere’ll be four of these controlling the entire NXTpod, and probably another motor in the middle powering the pneumatic hand on top. More coming soon!

Disclaimer: This site is neither owned nor endorsed by Festo Group. The Bionic Tripod 3.0, on which this project is based, is copyrighted by Festo.





Bionic NXTpod 3.0 – Research and Tests

2 05 2011

Festo, founded in 1925, is a German engineering-driven company based in Esslingen am Neckar. Festo sells both pneumatic and electric actuators, and provides solutions from assembly lines to fully automated full automation solutions utilizing Festo and third party components. It also has a kind of R&D department, the Bionic Learning Network, where they’ve created some amazing projects including SmartBird (“bird flight deciphered”), AquaJelly, Robotino XT and much more. [source]

They’ve also created the Bionic Tripod 3.0. This arm-like machine is driven by four linear actuators, which move semi-flexible cables (“steel spring rods”), to which the grabber is attached. The video below is from Festo’s official YouTube page, and explains the tripod much better than I just did:

Now what I’m going to do is make it out of Mindstorms NXT.

The rods

… are probably going to be one of the hardest parts to this build. The ones that Festo used are flexible, strong and don’t stay bent. When I went digging through my Lego Techinic, I only found three, long flexible parts! So I compared them to find the best one.

The following image cannot be displayed: Will they stand up?This first test was to determine which of the three would stand up best, carrying its own weight. The pneumatics cable came out worst, which, unable to stand up, wouldn’t work for this kind of application. The other two were very close. The right one was pretty strong, but it’s also thick and tends to curve a bit too much. The left one, however, stayed pretty straight (the top one was bent before), especially the lower one.

The following image cannot be displayed: Will they bend?This test was to see just how flexible the rods were. Too flexible wouldn’t be strong enough, and very rigid wouldn’t be… flexible enough. This time, both the right and middle ones lost, because they bent far too much to be able to support a lot of weight. The left one won again.

So, I turned out picking the left one. The only problem was that I only have two of them. So, I went to this store on BrickLink, and got twenty more.

The linear actuators

… might  cause problems as well. Since I don’t have any, and don’t plan on buying any in the near future, I needed to design a linear actuator from scratch :(. I ended up with this design:

The following image cannot be displayed: Linear actuator designBasically, the rods will be attached just above the worm wheel, which, when spun, will either push it up or down along the gear racks to the side. It isn’t very strong yet (the gear racks tend to break), but it works fine. Also, The back part of the motor is free, so the four motors should be able to attach to each other fairly easy. The other ones aren’t done yet, because I’m still waiting for materials.

The next post on this will probably be in a few weeks, when I have the first prototype done.

Disclaimer: This site is neither owned nor endorsed by Festo Group. The Bionic Learning Network, SmartBird, AquaJelly, Robotino and Bionic Tripod 3.0 are all copyrighted by Festo.





Easter Egg Sorter (EES) – Hardware

1 05 2011

EES is almost finished!. It just needs sensors and a few changes to the gearing and connections, so it runs a bit smoother. Therefore, the pictures below might not look exactly like its final version.

The following image cannot be displayed: Front view of EESThe idea behind EES is that easter eggs will be fed to it by the conveyor belt. At the beginning of the belt, a color (and possibly light) sensor will give EES information about the egg, so the arm knows when to grab it, and where to sort it. The egg is picked up by EES’ grabber (not entirely finished yet), which is controlled by a PF motor, after which four NXT motors bring it in the right position, so the grabber can drop the egg. The whole process between grabbing and dropping will theoretically take about 6 seconds, so, optimally, the robot should be able to sort 10 eggs per minute.

The following image cannot be displayed: Zoom on bottom EESIn earlier robot arms, I had the motors very close to the part they were supposed to move (shoulder motor in the base, elbow motor in the lower arm, wrist motor in the upper arm, etc). Since that never worked too well (it got too heavy for the lower motors), this arm is very lightweight, and almost all of the motors are below shoulder. This way, everything should be able to move faster and smoother.

The following image cannot be displayed: Upper gearing and rotation transmission EES The problem was that those joints still needed power, and the solution came in the form of universal joints – 6 in total. The great things about those kind of connections is that they can move the rotations at any angle lower than about 35-40 degrees. That way, the joints were able to bend individually and smoothly. Lego universal joints and gears in general do have one big problem though, especially when a lot are used in line, which is backlash. So, it might be hard to get the robot to move to exact positions.

More info coming soon!





PF Wave Machine Controlled by NXT

2 04 2011

Here’s an example of one of the many uses of NXT – PF cables (click here to see how to make them). It does most of its work mechanically, but its large PF motor is entirely NXT driven. This motor turns a small Lego rod and the wheel attached to it, which in turn holds 16 strings. These strings go through a specific hole in a circle (reversed Lego tracks), and through yet another, longer rod, after which they’re connected to the individual marbles.

It runs on motor port B, using the test program seen in the guide above.





PID Linefollower 2.1 – final version

5 03 2011

PLEASE NOTE: this is an older version of the PID line follower, but the entire project, in its latest version, is available on the PID line follower project page.

It’s finished, at last! It’s got a project page all for itself (over here), and a new video. It hasn’t changed that much, but the PID values have been changed (see video), and the motors’ PIDs are now turned off all the time, since they only got the robot to drift off the line after turns).

More info:





PID Linefollower 2.0 video

5 03 2011

PLEASE NOTE: this is an older version of the PID line follower, but the entire project, in its latest version, is available on the PID line follower project page.

Here’s the video, at last. It shows the new pausing function, which is activated whenever the magnet is removed from in front of the HiTechnic magnetic field sensor located on the back. This happens when the “tail” is lifted or the robot is tilted backwards.





PID Linefollower 2.0

1 03 2011

PLEASE NOTE: this is an older version of the PID line follower, but the entire project, in its latest version, is available on the PID line follower project page.

The robot changed quite a lot since the last release. It’s now got a tail-like attachment with a magnet on it sticking out its back. Mounted just behind that are two HiTechnic sensors: one magnetic field reader and one IR link.

1. new back view, with the touch sensors replaced with the HiTechnic ones

2. Robot tilted backwards (magnet is far away from sensor)3. new side side view

4. Zoom on the magnet and magnetic field sensor

Once the program is started and the robot has read the black and white values, it sets the magnetic field sensor’s bias to zero. Since this happens with the magnet in front of the sensor, the robot can notice any big changes in its position. So, when the tail is lifted, or the robot is tilted backwards (which lifts the tail), it senses the difference in the magnetic field and pauses the entire program. This includes the motors, the line following PID stuff, and the motor’s PID. Video will be available in the follow-up post

More info:








Follow

Get every new post delivered to your Inbox.

Join 34 other followers