Ashish and I started as Application Support Engineers at MathWorks on the same day. While I was focusing on Simulink, he quickly transferred into the Image Processing Toolbox team. Consequently, he never really had opportunities to use Simulink.
As part of my job, I am currently developing what we call Model-Based Design Labs. In these internal training labs, we use LEGO® MINDSTORMS® NXT to give participants a Model-Based Design experience. Ashish just signed up for the next set of labs I will teach next month.
Part 1 - Setup
Ashish: Hey Guy, I am really excited about the Model-Based Design Lab!. I just bought a LEGO® MINDSTORMS® NXT kit. Here is a YouTube video of what I did last weekend.
Guy: WHAT!!! You did not use Simulink to program the NXT???
Ashish: I was planning to, eventually. Isn’t there a whole lot of setup steps? Like downloading drivers, compilers, blocks and the associated configuration? I’ll get to it when I have more time to spare.
Guy: It used to be that way. But we have made the process a whole lot simpler with R2012a. Now it's literally a couple of clicks to install it. Once you have MATLAB and Simulink installed, go to the Tools menu and you should see an option to Install/Update Support Package.
Ashish: With just a basic introduction to Simulink I received 4 years back when I started with tech support at MathWorks, it only took me a couple of minutes to install the required software and an hour or so to get my first bot programmed! Here is a video of what it does:
Guy: Nice... and what does your model look like?
Ashish: As you can see below, I used the Color Sensor and configured it as a light sensor. I analyzed the data realized I could program it to follow the edge of the line. The algorithm is simple, white means turn left and black means turn right.
Guy: Not bad for a first try. I’ll show you how to improve that in the Model-Based Design Lab.
Ashish: Considering it's actually running a compiled program on the hardware, this is really impressive. I am excited about the power of Simulink!
Guy: I really think this built-in support for running models on low-cost target hardware is a great tool to learn many engineering concepts.
Now it's your turn!
Do you think it could be useful for you to learn or teach engineering concepts and Model-Based Design?
You guys get paid to play with Lego? Where do I sign up?
I don’t think I’ll get one because I can see my life being consumed by that thing, trying to make it moonwalk on command and fetch me beer from the fridge…
I’m not in education, but this is massive news for just about every controls course there is, well done. I can see people getting carried away and maxing out the processor on that thing, what’s it running?
Is there a new framework for target / board support packages in R012a? Wha are the implications for the older methods?
In terms of what is running on board, it is running NXT OSEK. You are right that there may be resource limitations, but so far people have liked and been able to do a surprising amount on there. We urge people to try it out and share what they do on MATLAB Central. Having the resource limitation also leads to ‘learning moments’ between faculty/students too.
There is not a new framework for 12a target support packages, per se. We are including some built-in support using the technology we have, but there are still significant investments in our production code generation. That will continue.
Hi guys. I have a problem installing Mindstorm package. The problem appears when the GNUARM is installing. It says that the file is corrupt and that is neccesary to get a new copy. I do not know what to do. Please help me.
Hey there!! I found very interesting your code. Very smart.
I am programming a C-ACC system to 3 Lego NXT cars rides in platoon and following a line with this toolbox from Matlab2012 in Simulink.
Im having some problem because I need to plot the graphs of acceleration and speed of the cars, and also adjust the speed and PID parameters in real time remotely by bluetooth communication.
I think the parameters is ok to set making the communication pc to brick. But i also need the communication on the other hand, from brick to pc to take information about speed and acceleration and plot the graphs on PC while the program is running.
Do you know if is that possible? Thanks !!!
Hey! Thank you for posting this, I was having such a hard time going from NXT to Simulink. This program is great, however not being familiar with the Simulink models I do not know how to change variables (i.e. different colors controlling how the robot turns). Where can I find a layout that tells which constants control these commands?
Leave a Reply
Guy Rouleau and Seth Popinchalk are Application Engineers for MathWorks. They write here about Simulink and other MathWorks tools used in Model-Based Design.