Note: This isn't a standard review of the TI-RSLK. Since I never actually purchased the kit, but instead chose to purchase the components individually, there will be slight differences.
My previous experience with programming microcontrollers is with the Arduino, so I was interested in learning another, more complex platform. I would like to thank kas.lewis for introducing me to this kit and encouraging me to apply for the Roadtest for the TI-RSLK. Although I wasn't selected, I was still interested enough to want to work through the curriculum. Since he was chosen to do the Roadtest, he was able to lend me the kit so I could progress through the modules.
The TI-RSLK comes as a Basic or Advanced Kit. The Basic Kit includes the MSP432 LaunchPad, robot chassis, motors, reflectance sensor array and bump switches which allow the robot to follow a line and react when it hits an obstacle. The advanced kit adds on distance sensors, tachometers, and Bluetooth and WiFi boards, enabling the robot to have more precision with its movement, see nearby walls, and connect with a smartphone or the cloud. TI later released the RSLK MAX which simplifies construction by eliminating soldering.
I decided to buy the MSP432P401R LaunchPad board since it's quite cheap and you can do the first nine modules, except Module 5, with the board alone or with a few extra parts like a breadboard, LEDs, resistors, buttons, and a capacitor. For Module 6 you also need the reflectance sensor array. The modules are available for free online without requiring an account. As I progressed through the curriculum, I purchased more parts to the point where I basically have all the parts that you'd get in the kit.
I've divided this review into two sections, one about the curriculum and one about building the robot. Each section traces a path through the first 14 modules.
Curriculum
The curriculum has 20 modules, and the first 14 use the components that you receive in the basic kit. There is an additional module, called Robot Challenges, that brings together everything you learn to solve tasks related to line following and navigating through a maze.
There is a diagram on TI's website that shows the various pathways you can take through the curriculum and which modules to complete, depending on your focus. I decided to just work through them straight without skipping around.
The basic format for each module is that there's an Introduction, Lecture slides, a Lab PDF, Lecture and Lab videos, and then Activity and Quiz questions.
The curriculum on TI's website
You can either use the Lab PDF included with each module or download all the labs in one PDF (slay052a.pdf) which also includes a Preface that gives an overview of the course and all the modules.
Module 1 begins by having you download and install Code Composer Studio (CCS) and the project code you'll be using. This took an hour and a half for me to do on my older PC. Next, you learn how to flash programs to the LaunchPad as well as debug by steppng through them, setting breakpoints and watching variables.
Lab 1.4.8 in Code Composer Studio
You also learn how to use the TExaS display software which is useful for those who don't have a physical oscilloscope or logic analyzer.
In Module 2 we learn about electricity (voltage, current, power) and electrical components, and connect resistors, capacitors and LEDs to the LaunchPad using a breadboard and jumper wires.
Lab 2.4.1 setup
The introduction says that students are expected to already have a basic understanding of resistors, capacitors, and inductors, and I did feel that if you had no prior experience you wouldn't fully understand what was going on. I had to do some googling to get a better understanding of capacitive reactance and how a capacitor's resistance changes as the frequency of the input signal changes.
Every project has several versions of the main() function corresponding to different parts of the lab. To use each one you rename it from e.g., Lab2main() to main() and then build the project.
In Module 3, we learn about the underlying architecture of the MSP432 and begin with some programming in assembly language. I found it helpful to reference the "Cortex-M3/M4F Instruction Set Technical User's Manual" (spmu159a.pdf), which can be found in the \tirslk_maze_1_00_00\datasheets folder, and the "MSP430 Assembly Language Tools User's Guide" (slau131.pdf), which can be found by searching online. I didn't feel the videos and source code comments were enough to understand every line of code, though I don't know that everyone wants to.
The curriculum follows a pattern of introducing you to various ideas that you will need and slowly building towards a goal which will be an element of the robot's system. For example, in Module 4, which introduces programming in C, you already start designing code that will interface with the distance sensors which sense walls and help the robot determine which way it needs to turn in the maze (though in this case you'll only end up using this code if you have the Advanced Kit).
In Module 5 you start assembling the robot by attaching the motor board, battery contacts and LaunchPad, and learn about power and voltage regulation.
Module 6 introduces the reflectance sensor array which will be used as a line sensor on the bottom of the robot. You connect it by running wires to the LaunchPad pins on Ports 5 and 7. Each port has up to 8 pins on it and you configure and interface with these pins by modifying individual bits (8 bits per byte) in the code. It's shorter, though less intutitive, to write the hexadecimal equivalent of the binary number representing the 8 bits, so my friend pointed out that you can use the Programmer mode in the Calculator that comes with Windows to convert between hexadecimal and binary.
To test the line sensor, I used some black electrical tape on a white piece of paper.
I ended up getting varying results depending on how close the sensor was to the paper and what the lighting conditions were. When over a white surface, it took anywhere from 3 to 8 ms to discharge, and between 5 and 26 ms over black. Eventually, I set up a lamp nearby to shine on the paper and reduce the discharge times to 0.4 ms over white and 1 ms over black.
Measuring discharge times using TExaS display.
When monitoring the state of the sensors in CCS, you can use the Continuous Refresh button at the top of the Expressions window to have the debugger constantly update the values.
In Module 7 you start designing the system that will integrate the reflectance array with the motors, allowing the robot to respond to the information it receives from the sensors so it can follow a line on the floor. You design this system without actually using the sensor or motors; you simulate them by using the buttons and LEDs on the LaunchPad. We are introduced to the Finite State Machine which is an abstraction that allows us to describe the states, inputs, and responses of our system and organize them so we can verify that it covers all possibilities and functions correctly.
In Module 8 you simulate a window intruder alarm system using buttons and an LED, which teaches you the knowledge you'll need to interface the bump switches.
In Module 9 you use pulse width modulation (PWM) with LEDs to control brightness in preparation for using it with the motors to control speed. We do this by using timers to cycle on and off. Although according to the code for a 75% duty cycle the LED should cycle on for 7.5 ms and off for 2.5 ms with a period of 10 ms, I actually found it to have the correct duty cycle but a period of 26 ms. I'm assuming this results from processing extra instructions like jumping to and from the SysTick_Wait1us() function. I was able to experiment with lower numbers to achieve the 10 ms period, but only later in Module 13 when we use hardware timers will we actually get the precise amount of time that we set in the code.
Until now, we've only been running one thread, so the robot is only focused on one thing at a time. Module 10 introduces multithreading where we have a main thread running most of the time and we switch periodically to another thread (using an interrupt) to handle background tasks like monitoring the line sensor and bump switches. We combine this with debugging techniques where we save readings into an array and then into flash memory so we can access them later and determine if our robot is functioning correctly. In this module I started to get the feeling that we're on our own a bit in terms of figuring out how to actually do the lab. You have to pull together ideas and code from the videos, lecture slides and lab to determine what code to write and where to write it. This can be educational but also frustrating, depending on how long it takes you to figure out.
Module 11 sidetracks a bit to interface the Nokia 5110 LCD screen with the LaunchPad. It's a bit strange that the screen doesn't actually come with the kit, but I had one so I was able to do this module. The goal is to have real-time debugging information on the screen but we don't actually implement this in this lab or future labs. It is up to you to add it to the robot's systems.
Again, I had to piece together information to write the code for the lab. I looked through the comments in Nokia5110.c and dug around in the registers in the debugger to figure out what registers to use and which bits to modify to get the functions to work. I also had to adjust CONTRAST in Nokia5110.h to get good contrast without flickering.
In Module 12 we learn about motors and motor-drive circuits. We attach the motors and wheels to the chassis and make the necessary electrical connections. We also write code to move the robot forward, backward, left and right. Because running the motors is a constant task requiring us to cycle power on and off, we need a way of offloading this so we can get other things done in the main part of the program. In Module 13, we do this with hardware timers. We initialize the timers by setting the period and duty cycle, and then it just runs automatically in the background. When we want to change how the robot is moving, we just modify the motor settings and then let it run on its own again. As in Module 10, we use a periodic interrupt to monitor the bump switches. I found it useful to look at Chapter 19 of the "MSP432P4xx SimpleLink Microcontrollers Technical Reference Manual" (slau356h.pdf) for details about Timer_A, and Chapter 2.4.3 for information about the NVIC registers. I will say that it took quite a long time to figure this stuff out.
Until now, we've been using periodic interrupts to monitor the bump switches every 10 ms and see if the robot has hit an obstacle. In Module 14, we instead use edge-triggered interrupts so we don't need to monitor them any more; only if a switch is pressed does it trigger an interrupt. Because the bump switches aren't debounced, they can end up triggering again when they unclick causing the robot to jolt a bit as it backs up.
The lab says to use the dump techniques we learned in Module 10 to record strategic information so we can check afterwards if the sensors and actuators operated as intended. To do this, I created distinct hex codes to indicate motor activity (forward, left, stop, etc.) that wouldn't be confused with the data coming from the bump sensors. Although the lab doesn't say to integrate the line sensor, I wrote some code to do so, so now my robot will follow a line, and back up and turn if it hits an obstacle.
Module 21 (under Compete Challenges in the curriculum) talks about integrating the components you've designed to follow a line or navigate a maze. It points you to two projects that provide you with an empty project to use that includes all of the work you've done up to Module 13 or 17 (depending on if you have the Basic or Advanced Kit) called JackiFSM and Jacki respectively. Don't get too excited, as all this really amounts to is a source code file that has all the #include statements for the functions you've developed and a completely empty main() function. Jackimain.c also has a large comment section with instructions on which pins to connect to the encoders, motor board, bump switches, distance sensors, and Nokia LCD, but you may have a slightly different configuration depending on which pins you chose in the labs.
An interesting addition is the two competition starter projects, called Competition and Competition_BLE (includes Bluetooth support), that contain the solutions to the labs in object-code so you can work on the robot challenge without completing the labs.
The first design challenge is to make the robot follow a line. If it hits a wall, it should back up and determine which way to turn based on which bump switches were activated. The second challenge is for the robot to follow a line in search of the "treasure" (a special pattern that will register on the line sensor, or a taller wall that registers with additional bump switches). The third challenge is a free run through a walled maze with only bump sensors and no line sensor. The next challenge is for the robot to navigate a maze with the distance sensors so it avoids walls without hitting them. The next challenge is to race through a maze using the distance sensors, possibly racing multiple robots at the same time. The final challenge is to add lines to the floor of the maze perpendicular to the path traveled so that the robot can use the line sensor to orient itself as it makes turns. The module contains diagrams for different mazes you could design, along with a list of lengths of wood needed to build each maze. It also has information about system design and working in teams.
Construction
We begin building the robot in Module 5. The lab contains a certain amount of instructions for the assembly, but you're going to want to look at other sources for more detail. The \tirslk_maze_1_00_00\datasheets folder contains information about all of the components used. By looking at "Motor Driver User Elements.jpg", you learn that we're going to be using the power pushbutton to turn the robot on and off. (The power slide switch only works properly if you disable the button by cutting the button jumper.)
Also, I downloaded the "Basic Kit Construction Guide" (swrp249.pdf) and referred to it for better instructions. Section 5.3 of the lab gives you steps to follow to configure the Motor Driver and Power Distribution Board and connect it to the chassis and LaunchPad. In steps 1 and 2 it says to cut the VPU-VREG and VCCMD-VREG traces. But in the Basic Kit Construction Guide on page 7 it also says to cut the SLP L-R trace. In fact, the comments at the beginning of Lab12_Motorsmain.c and Lab13_Timersmain.c say:
// Sever nSLPL=nSLPR jumper.
// This separates P3.7 and P3.6 allowing for independent control
so you should cut that trace as well.
Steps 3 to 7 of the lab tell you to solder wires between the 2 boards. In the Construction Guide it has more sensible instructions, guiding you to solder headers onto the boards so that you can use jumper wires to make connections instead of soldering wires directly to the boards. You're also going to want to solder on Ground headers for the bump switches (highlighted in brown), as well as headers for the motors. Although it doesn't say to do this in the lab, it does say it in the Construction Guide, and if you don't do it now you'll have to remove the motor board later to do it.
Page 7 of the Construction Guide
Steps 8 and 9 tell you how to arrange the battery terminals. Again, the Construction Guide has clearer instructions with pictures on page 9.
Page 9 of the Construction Guide
Step 10 says to attach the 4 nylon standoffs. I found that by leaving them a bit loose I was able to slant the standoffs slightly to accommodate the holes on the LaunchPad. Also, I ordered Keystone 1895 standoffs instead of Keystone 2204 to attach the breadboard because they have an outside diameter of 3/16" instead of 1/4" which has better clearance on the LaunchPad.
The robot runs on 6 AA rechargeable batteries, but you will need your own charger as it doesn't come with the kit.
In Module 6, you can optionally attach the line sensor to the chassis. First you need to solder 90 degree headers onto it and bridge the 3.3V bypass. The sensor is positioned on the bottom of the chassis with two standoffs. Due to the location of the holes on the chassis, the line sensor is slightly off-center. Also, there ends up being as much as a 13 mm distance between the sensors and the floor. This is strange, as the lab says that the optimal sensing distance is 3 mm.
In Module 10 we attach the bump switches. This requires some soldering to attach the jumper wires. Remember to put the heat-shrink tubing on before soldering.
Finally, in Module 12 we attach the motors and wheels to the chassis and make the necessary electrical connections. Again, I referred to the Construction Guide for the details. If you're using the Basic Kit, you'll solder wires to the motors and connect them to the motor board. I decided to use encoders in preparation for Module 16 so there are additional steps to follow. I used the Pololu Romi Chassis Users Guide PDF in the datasheets folder for instructions on how to position and connect the encoders. You attach female headers to the outside row of holes on the motor board (highlighted in yellow in the Construction Guide). I found it worked better to have the board vertical when soldering on the headers because when I tried it horizontally, the solder flowed down and filled the header with solder, making it unusable and quite difficult to remove.
Encoder positioning (from the Pololu Romi Chassis Users Guide)
Conclusion
Overall, I found this to be an interesting and challenging course. The videos introduce many different concepts and teach you about electronics, programming the microcontroller, and interfacing electrical components, including some interesting sensors, to build an intelligent robot. You learn how to develop software in Code Composer Studio as well as various debugging techniques. You also learn how to use an oscilloscope and logic analyzer to watch what's happening in a circuit in real time. The course walks you through the steps for building an integrated system one component at a time, and even gets you up and running with timers and interrupts. The labs guide you step-by-step through the tasks you need to accomplish, though you need to put in more of your own effort in later modules. I think some areas could use more elaboration, such as how to set the registers for timers and interrupts. I also think the labs should either include or refer to the instructions from the Construction Guide PDF instead of those provided in the lab. That said, I think the RSLK is a great way to learn about and gain practical experience with microcontrollers and robotics.
Top Comments