Archive for the ‘LEGO’ Category

On April 6th, I premiered a new bot at the Southern Maine Gearbots District Meet! Lunar Land3r, is a new EV3 take a retro video game. Here is a quick (3 second) timelapse of setting up the bot shot on my new GoPro. The full video will be coming soon. Stay tuned!

Remember that Maker Faire demo I posted about a few weeks ago? Well as promised here is Part 2! This time I dive into the new features I added for the demo. The video format is a bit strange in that it presents a PowerPoint, but that was a requirement for a class. I ended up leveraging this work for my image processing class this semester.

One of the easiest ways to make a demo interactive is to kid a child a maker and say draw. That is exactly what this demo does. As the child draws, the robot or swarm will follow the line. I do some image processing to find the line. The first step is to reduce the search area. This is a huge time saver when it comes to processing and removes many of the issues of shadows or various markers and body parts the camera may see. Then it does a search in this region of interest (ROI) and looks for where the line intersects the ROI.

I tried to keep the new feature as streamlined as possible to avoid the issues of degraded performance. Image processing can be quite processor intensive. Since the code was already doing a lot of processing to get to this point, I wanted to ensure that any further enhancements did not add lag.

There is always room for improvement and one of those areas would be actually projecting the line to calculate the intersection. This would probably help for the cases where the line does not intersect the edge of the ROI, but that is a feature for another time. Check out the video for more details. It came together really well!

9748OT_instant_new

On my return trip from Denver, I enjoyed another book.  Instant LEGO MINDSTORMS EV3 by Gary Garber is a quick read to get you up and going with the latest LEGO MINDSTORMS set. As you have seen in some of my previous posts, I do a lot with EV3 and I love sharing good resources for building robots.

Instant LEGO MINDSTORMS EV3 is a great introduction to the educational version of the EV3. The book is great for teachers who are looking to integrate robotics into their classroom. Topics range from building a simple robot, to creating a proportional line follower.

Garber refers to the various segments of the book as ‘recipes’ and that really is a good name for them. Each section breaks down into steps, along with CAD renderings or screenshots. This makes for a good tutorial as it is easy to follow. Be it good or bad, you don’t need to read most of the book. The images are that good and easy to follow.

ball

I would recommend this book for anyone, but with the focus on the educational kit, it is really best suited for teachers (or students who have access to an educational kit at school). Unlike the LEGO MINDSTORMS NXT, EV3’s educational kit is quite different from the retail kit. The educational kit contains different sensors (ultrasonic instead of IR, no IR remote, and a gyro sensor), software (the educational software directly supports these sensor differences and includes data logging), and finally different parts (most notably the caster ball, pictured right).

One interesting surprise with this book is that I actually know one of the technical reviews. Chris Rogers, a professor at Tufts University and director of the Center for Engineering Education Outreach (CEEO). Chris and I had worked on some NXT projects (mainly involving my RS485 work). We seem to keep crossing paths.

Naturally, with technical reviews like Chris, and the detailed recipes, Instant LEGO MINDSTORMS EV3 is a good book. While it does not go into to all the various ideas or projects that most other MINDSTORMS references include, it does a fine job of getting you up and going quickly. If you are looking for a quick read (under 100 pages!) or are like me and feel the need to read everything related to LEGO MINDSTORMS, you can find this book of amazon.com or from the publisher.

1386EN I have been working a lot with MATLAB and Simulink lately. For both my academic work and fun. If you recall the MATLAB demo I took to the Orlando Mini Maker Faire, you know that Simulink is an important part of that project. Simulink works really well for LEGO MINDSTORMS as its dataflow paradigm maps nicely to robotic interactions. I have actually been working on a tutorial to get people started with LMS and Simulink (hopefully will be posted in December or January).

So why the picture of the book? Well I love having a good reference for my work and I am currently reading this book. I will be writing a review for Getting Started With Simulink by Luca Zamboni next week, but  so far it has been a really good resource. It might be worth checking out if you will be working with Simulink. The book assumes you have never used Simulink and gets you up and running, very quickly. Check back for the full review next week!

I am happy to share Part 1 of the demo I took to the Orlando Mini Maker Faire. This video covers the basics of what The MathWorks provided me. As you can tell by the video, it is somewhat dependent on lighting. But let me describe what the base demo does.

WP_20131005_001

The setup is 3 NXT robots running Simulink code that communicates with my computer. There is a camera positioned about 6 feet above the robots. Each robot has a unique pattern that can be seen by the camera. Using this pattern we can determine the position and heading of each bot.

The demo tries to get the robots to form a triangle. The position of the triangle is determined by the user. The robots will follow the triangle as the user moves it.  Check out the video above to see the tech in action! While the video was shot in my apartment, the picture, right, was from the Orlando Mini Maker Faire.

Now I love sharing cool tech with people, but I also love to put my own twist on it. What if we made the demo interactive and allowed kids to draw lines? One might think a robot or a group of robots might follow that line. One might also thing that adding more lines of different colors might allow different robots to follow different lines. Of course that is all speculation.  Maybe the photo below will be a helpful hint. 😉

Part 2...

WP_20131005_008This past weekend was the Orlando Mini Maker Faire at the Orlando Science Center. I am not sure of the final attendance numbers, but I was busy the entire time. I brought a total of 15 robots to display. Naturally I had the Shuttle and segway bots, but this event featured a new NXT project in partnership with The MathWorks, makers of MATLAB and Simulink. The video will be coming (due to poor lighting at the event, I am having to shoot the video at home) but the project features control of the NXTs from MATLAB. Navigation is done by processing the image from a camera positioned above the bots, as you can see in the first picture. I will go into more detail soon, but The MathWorks provided a good foundation for the demo and I then added a few enhancements. The code running on the NXTs was written in Simulink and the image processing and control as in MATLAB. The bots communicated with the computer via Bluetooth. I was able to demo both the example The MathWorks provide and my enhanced version, but since the lighting was spotty, I was only able to do it once. (It was very sensitive to people walking by and casting shadows from the overhead lights.)

WP_20131005_001I also brought a long a few EV3 bots. I had a couple of ‘kit’ bots that were built with the instructions (EV3RSTORM and a robotic arm), but I also decided to make my own flyer stuffing robot. I will save the details of that bot for another post as well, but it is safe to say it was a hit with every one in attendance. You can see it right on the corner of the table in the picture below.

WP_20131005_003Below are a few more pics from the display. Everyone really seemed to like the interactive display. Other members of my LUG had displays that ranged from a trick or treating street, motorized technic models, and a BrickPi. We really had a nice showing and attracted a ton of attention.

WP_20131005_002WP_20131005_005WP_20131005_007I look forward to the next event, although I might need to scale it back a bit. 15 bots was crazy! Plus, I wasnt able to bring a few of my other projects. Stay tuned for more updates. I have quite a backlog and I hope to be updating them soon!

So the Magloop I posted about earlier was hard to tune. The problem? I cannot turn the dial in small enough increments. After some discussion on the MagLoop email chain, it was suggested I gear it down by about 50. Now Field Day is less than 24 hours from now and I am short on supplies. However, as many of my readers know, I do a lot with LEGO, from Robots to large scale models. I had a few gears on hand and made a 48:1 gearbox.

To get started I attached an axle (along with a gear for stability) to the shaft of the air variable capacitor. I did this simply with 5 minute epoxy. I added some more after it dried so it would be stronger.

WP_20130621_001The next step was to mount the gearbox. I removed the 48 tooth gear. To keep it flexible, I only attached one of the frames (the top one in the picture below) to the air variable capacitor. The rest of the gearbox is held together the same way as any other LEGO Technic model.

WP_20130621_003I took off the bottom part of the gearbox and slipped on the 48 tooth gear. Note that the handle seen in the picture below is attached to a worm gear. The picture below shows the completed gearbox assembly. It does add some overall length to the assembly, but I was able to tune up just fine. There is some slip in the gear-train, but the steps are so small that it doesn’t appear to be an issue.

WP_20130621_005Below is a close up of the gearbox. It turned out really well and I can’t wait to be on the air tomorrow with my new, functional, easy-to-use MagLoop! This very well might be the first time LEGO products have ventured into amateur radio. Following Field Day, I am going to expand the system to include an EV3. This would allow for even better accuracy using the encoded motors, attached to the gearbox.

WP_20130621_006

 

 

 

 

I have gotten several emails over the past few months asking about my RS485 blocks and how to increase the speed or why they cannot get enough information out of the brick in time. Through that email chain I developed some good examples and content which I will share here.

For this example lets assume you are using a Dexter Industries’ NXTBee and a USB xBee receiver. Let’s step through the timing for this at 9600 baud. 9600 baud means we can transfer 9.6 bits per millisecond or just over 1 byte.

Time 0 ms: Write data to RS458 Send in NXT.
Time 1 ms: NXT processes data and prepares to send.
Time 2 ms: NXT sending 1 byte of data. (9600 baud)
Time 3 ms: USB xBee receives data and send to computer.
Time 4 ms: Data arrives on computer.

It took 4 ms to send 1 byte of data. That is slow by any account, but the real issue not not in bus speed. In fact, the NXT RS485 bus was only in use for 1 ms of that entire transfer. We also assume 0 send time for the xBee radios (which is a bit of a stretch). This means receiving a reply from the computer will take 4 ms as well. This issue is called latency. We have a minimum of 4 ms latency per RS485 send. Our throughput for this example is 1 byte and our bus speed is 9600 baud.
Now if we send 4 bytes at 57600 or 5.76 bytes per millisecond we get the following:

Time 0 ms: Write data to RS458 Send in NXT.
Time 1 ms: NXT processes data and prepares to send.
Time 2 ms: NXT sending 4 bytes of data. (57600 baud)
Time 3 ms: USB xBee receives data and send to computer.
Time 4 ms: Data arrives on computer.

Note that the time to get the data is still the same, but we were able to move 4 times a much in the same time chunk. This is why speeding up will improve your throughput. Our latency for this example is still 4 ms per transfer, but our throughput is now 4 bytes on a bus speed of 57600 baud. (And yes, we could have done 5 bytes in there, but I am keeping things in powers of 2.)

Now if we look at this in NXT to NXT communication:

Time 0 ms: Write data to RS458 Send in NXT.
Time 1 ms: NXT processes data and prepares to send.
Time 2 ms: NXT sending 4 bytes of data. (57600 baud)
Time 3 ms: NXT receives 4 bytes of data. (57600 baud)
Time 4 ms: NXT application reads data from RS485 Read.

Now we have a much higher throughput to the NXT via the xBee radios. Mind you if we used a wired connection we have a latency of 3 ms as we do not have that extra receive step. This is why a wired connection has lower latency.

I hope this helps you understand some of the magic of communication protocols. All three factors are important in determining network performance and will vary based on application.

Life has been crazy these past few weeks. From Brickworld, to FIRST, to school, there has been little free time. However this weekend brought me to the great state of Maine. Just a few hours east of FIRST HQ in New Hampshire, southern Maine is just beginning to get into robotics. Leading the charge is the Southern Maine Gearbots. Combining FIRST (FLL and FRC), VEX and some custom challenges, this group is working hard to prepare the engineers of tomorrow. Naturally any robotics event is not complete without a visit from some famous robots. Making an appearance was the LEGO MINDSTORMS Space Shuttle and Boston Engineering’s Robotuna. For many this was their first experience with real engineers and robotics.  I was honored to be invited to the event and it really seems to be a great program! Enjoy a few pictures capturing this really great event! Next year will be event better. Hats off to all involved!

I promised pictures from Brickworld Indy and my Trip to Australia, only one problem: not enough space to post them here! I have created 2 public facebook albums.

Brickworld Indy 

Australia