Posts Tagged ‘Simulink’

Many of the people that follow my blog know I do a lot of robotics. I build robots, I write software for robots, and I mentor/coach FIRST teams. If you know anything about FIRST Robotics Competition (FRC), you know January and February are busy months. This is the build season. Between my research and mentoring a team, I have almost no free time. I do have a few projects that need to be posted and I will try and get to them as soon as I can. I have some updates on my Glow with the Show ears, APRS on a Beaglebone, NXT Simulink Tutorial, and VEX IQ.

In case you were wondering what this year’s FRC game is, see below!

1386EN

As some of my readers know, I am in Denver at SuperComputing ’13. It has been a crazy week, but traveling also affords me some time to sit back and read. On the flight over I finished reading Getting Started with Simulink by Luca Zamboni. Overall this is a very good introductory book into Simulink, but it does require some mathematical background to truly understand what the author is doing.

Like LabVIEW, Simulink is a graphical dataflow environment and requires very little text code. For many, this approach to programming can be quite easy and improve productivity; however you need to understand how datalfow works. The author begins with a simple cruise control model that leverages a PI controller (more on that later). Like many systems that interact with the physical world, it maps well to dataflow. The author does an excellent job of stepping you through construction and testing of the  model. He even mentions some good shortcuts (like how to reset the zoom, a shortcut that I learned while reading this book).

Like any good tutorial, the Getting Started with Simulink builds on previous examples. Once you complete the first example, you build a model for a car. This exposes the user to simulation, one of the key advantages of Simulink. The book builds quickly and at first it seems like Zamboni is throwing everything but the kitchen sink at you. He really does challenge you, but Zamboni is there to step you through each step of building the model. From creating subsystems for for motors to simulating drag. The model is a very complete representation of a sports car and by the end you feel very accomplished. Best of all, you have actually mastered most of the skills required for Simulink. I would say this book covered 90% or more of the blocks that I commonly use. Another key aspect of the book is that it uses an up-to-date version of MATLAB and Simulink (2013a). While the basic concepts don’t change with time, features are sometimes tweaked or new file types supported. Zamboni does a great job of pointing out many of these minor differences. He really is an expert in the software.

Now about math and that PI controller. Well to be honest, the PI controller was just the first math-heavy aspect of the book. The model for the car does get kind of math heavy, but that is very much the nature if many models. While you don’t actually need to understand the math to follow along and complete the models, but it certainly helps. If you’re an engineer or engineering student, then chances are you know physics and calculus. For my non-engineering readers, don’t feel like this is a deal breaker. The author does explain what is going on, but probably not in the detail that you would like.

One other thing to keep in mind is that this book requires no hardware (no MINDSTORMS, no camera, no motors, nothing). So if you plan on interacting beyond simulation (given simulation is one of the big features of Simulink), you will have a bit more learning to do on your own. Personally, I think you should start in simulation, and once you master that, move to hardware.

Overall I would recommend this book to any reader. I know there are quite a few people out there that are just getting started with MATLAB and Simulink for LEGO MINDSTORMS. This is a great first step in mastering the environment. The book is available on amazon or directly from the publisher. The book also is available in ebook form for your tablet or Kindle.

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!