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
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 :)














The 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 












Skype Car – Lots of Numbers
18 01 2012As 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.
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:
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?
Comments : Leave a Comment »
Tags: car, comments, engadget, gadget magazine, international, LEGO, Mindstorms, mindstorms nxt, numbers, NXT, review, skype, stats, wireless, youtube
Categories : Robots, Skype Car