Renesas Micon Rally Car


Firstly, the Renesas Micon Car is a line following robot car. The Rally part refers to the competitions with these cars for students and enthusiasts around the world to learn about microcontrollers, motor control, programming and mechatronics. Renesas says: "We are very grateful to hear the voice of a number of young leaders of the next generation through participation in Micon Car Rally competitions to learn craftsmanship, enrich emotional development, and experience significant personal growth. As a social enterprise, Renesas Electronics takes seriously the importance and necessity to strive to foster the development of future engineers and will continue to support activities to increase creativity and broaden possibilities for young people through the Micon Car Rally in the future." In 2012, I was proud to be the organizer and technical support for the first Renesas Micom* competition in the USA, with student participants from Southern California universities taking part. The project was a load of work and a wonderful experience for all.

*this car is referred to as Micom and Micon depending on the source

Built a car

Contacted SoCal Schools

Video from the competition at Renesas DevCon 2012

Designed the track, with timing and gate mechanisms

This is a test of almost the entire setup, with timing towers, starting gates, track layout, and car. Everything that appears in the video, I built.

This video shows a developmental step of the car. The higher voltage supplied to the motors and servo really bring the car to life.

Renesas Micom Car Rally Assembly Pt. 1

This car came as a kit with every thing need in the box except the tools.

You'll need:

  • side cutters
  • needle nose pliers
  • phillips head screwdriver
  • wire stripper
  • soldering iron
  • marker
  • ruler or calipers
  • x-acto knife
  • scissors
  • rotary tool with cutting wheel and sanding drum
  • file
  • vise
  • hand drill/drill press with 3,3.5,6 mm drill bits and counter sink bit

This is a general list, you could use more or less tools than this depending on your budget and tool handling ability.

Universal plate L bag contents

The sensor arms articulate to follow the track

First, cut out the arm parts with side cutters. After cutting down one pair of angle pieces, attach them to the uncut pair from the bag of hardware marked "**other parts" use 2 M3 locking nuts and 2 of the black screws from the Universal Plate L set to screw together 2 pairs of arms. These should be loose enough to allow easy movement. This will be crucial later when the car is following the track and there are up or down ramps, undulations in the track material, and seams. Any of those things can cause your sensors to lose contact with the track and make the car go completely off track.

Mark the main plate for cutting, and it will take a good long while cutting and filing. Pay close attention to the directions regarding which edges get filed, and how much because it does vary. The instructions call for using a large drill bit to do the countersinking on the underside of the main chassis. I don't like this because it would be easy to drill all the way through accidentally, and the angle of the tip of a normal drill bit does not match the angle of the flat head screws. It is much better to spend a little on an actual counter sink bit to get better results for this project and any others you'll work on.


As the build goes on, it is important to stay organized

The gearboxes go together in a snap; just make sure to get the motors and shaft oriented correctly. The motors that come with the gearbox set are not used, make sure to use the MCR motors included in the Rally Kit. By this point in the build, if you're not careful parts, screws, and wires will be littering your work area. I recommend getting some system set up to keep track of it all, especially since there are no spare parts in some cases.


Renesas Micom Car Rally Kit Explanation

Ok, with some of the building done, I realize that some of the basic ideas behind the car have not been covered.

The Renesas Micom Car rally kit is a line following robot car. It uses infrared sensors on the front sensor board to track the lines on the track. The track is black with white borders and a center white line with gray lines on either side. There are also left/right lane change, and braking lines that cross the path of the track that trigger other behaviors than pure line following.

The Renesas RX62T microcontroller board that comes with the rally car kit gets inputs from the sensor board, and outputs the steering signal and motor speed signal based on its’ programming. The signal the microcontroller puts out is PWM, but not with enough power to drive the motors and servo. The motor drive board supplies the power to the steering servo and the drive motors.

Teams build cars to compete on the track to set the best time. The competition can be pretty intense, with teams finishing within 1/100 of a second apart after racing around a 200 ft long track that includes curves, dips, bridges, and lane change maneuvers.

Video of the Renesas Micom Rally Kit, built according to the instructions and on a regulation track:

https://youtu.be/jPxJRQU8tN4

The Micom Car Rally kit is a comprehensive kit including everything necessary to build a car. In competitions, teams go beyond what comes with the kit by changing to brushless motors, custom chassis designs and materials, and more advanced code to deal with the track layout.


Renesas Micom Car Rally Kit Assembly Pt. 2

With just a few hours work the chassis and mechanical parts of this kit are ready to go. Here we'll cover the sensor board and motor board assembly, which are a bit more involved. The instructions actually cover the sensor board earlier in the process, but I chose to concentrate on the chassis build while waiting on a soldering iron as well as believing it to be best to take care of the easy steps first to get a feel for the instruction flow and the ultimate direction of the kit before getting too deep.

The sensor board:

It is the eyes of your machine that allow it to follow the track and sense important information about starting and obstacles during a race. It's very important for the successful operation of the car, so read the manual once ahead of time and follow the instructions on the orientation and order of assembly. The instructions are very well laid out to help you put together the board in the best way and easiest. Pay particular attention to the side of the board that you're installing parts and soldering to, this board uses both sides. Bending the LED's is another place to watch out for, getting the correct legs bent the correct direction is a little test of dexterity.


The Motor Controller Board:

This is the most intensive part of the build, where the most attention must be paid to the order and placement of all the parts, as well as using good soldering technique. I would bet that all the parts are packaged correctly with the kit, but it pays to double check and familiarize yourself with the board before assembling it. Take some time to double check your part and its orientation in each step and the assembly will go smoothly. In some kits it is possible that there will be some part substitutions, but nothing that will affect the operation of the kit.

Here are the Motor Controller Board and the MCU Board mounted on the chassis. Notice the extra spacers and longer screws on the mounting posts for the MCU Board. They are necessary for the USB port to clear the battery power supply connectors. Otherwise you would be stuck dismounting the board every time you flashed and stressing your USB connector on the board.

Renesas Micom Car Rally Kit on the track

Renesas provides a functional C++ program for the Rally Car on their website. This program will get the car around a track somewhat effectively. It is a basic program that can handle an easy track at slow speeds, but the car will not stay on track under some common conditions that will be encountered. It is up to the builder to add code that deals better with 90 degree turns, lane changes, and some situations where the MCU will use a false interpretation of the sensor readings during a maneuver. Renesas helps by going through some examples that will cause the car to fail and hints at what will need to be added to fix it.

Now that the kit is built and running it is time to get it going around the track and modifying it to make it follow the track faster and more reliably. Renesas provides a functional C++ program for the Rally Car on their website. This program will get the car around a track somewhat effectively. It is a basic program that can handle an easy track at slow speeds, but the car will not stay on track under some common conditions that will be encountered. It is up to the builder to add code that deals better with 90 degree turns, lane changes, and some situations where the MCU will use a false interpretation of the sensor readings during a maneuver. Renesas helps by going through some examples that will cause the car to fail and hints at what will need to be added to fix it.

Today I'll go over the 90 degree corners that are a required part of the course for Renesas Rally Cars. They are indicated by a pair of lines perpendicular to the path of the cars. These lines are 20mm wide, separated by 30mm, and located 500-1000mm before the turn. The car senses these and goes into a sub-program that looks for a sharp turn, initiated when all of the sensors detect the line on one side of the sensor bar.

This sub-program also slows the car down while waiting for the anticipated turn, turns the steering servo, applies differential steering to the drive motors, and waits for the sensor inputs that indicate a successful turn before continuing with the normal line following program (case 11).


Here is part of what Renesas gives kit builders to start with:

247 : case 21: 248 : /* Processing at 1st cross line */ 249 : led_out( 0x3 ); 250 : handle( 0 ); 251 : motor( 0 ,0 ); 252 : pattern = 22; 253 : cnt1 = 0; 254 : break; 255 : 256 : case 22: 257 : /* Read but ignore 2nd line */ 258 : if( cnt1 > 100 ){ 259 : pattern = 23; 260 : cnt1 = 0; 261 : } 262 : break; 263 : 264 : case 23: 265 : /* Trace, crank detection after cross line */ 266 : if( sensor_inp(MASK4_4)==0xf8 ) { 267 : /* Left crank determined -> to left crank clearing processing */ 268 : led_out( 0x1 ); 269 : handle( -38 ); 270 : motor( 10 ,50 ); 271 : pattern = 31; 272 : cnt1 = 0; 273 : break; 274 : } 275 : if( sensor_inp(MASK4_4)==0x1f ) { 276 : /* Right crank determined -> to right crank clearing processing */ 277 : led_out( 0x2 ); 278 : handle( 38 ); 279 : motor( 50 ,10 ); 280 : pattern = 41; 281 : cnt1 = 0; 282 : break; 283 : } 284 : switch( sensor_inp(MASK3_3) ) { 285 : case 0x00: 286 : /* Center -> straight */ 287 : handle( 0 ); 288 : motor( 40 ,40 ); 289 : break; 290 : case 0x04: 291 : case 0x06: 292 : case 0x07: 293 : case 0x03: 294 : /* Left of center -> turn to right */ 295 : handle( 8 ); 296 : motor( 40 ,35 ); 297 : break; 298 : case 0x20: 299 : case 0x60: 300 : case 0xe0: 301 : case 0xc0: 302 : /* Right of center -> turn to left */ 303 : handle( -8 ); 304 : motor( 35 ,40 ); 305 : break; 306 : } 307 : break; 308 : 309 : case 31: 310 : /* Left crank clearing processing ? wait until stable */ 311 : if( cnt1 > 200 ) { 312 : pattern = 32; 313 : cnt1 = 0; 314 : } 315 : break; 316 : 317 : case 32: 318 : /* Left crank clearing processing ? check end of turn */ 319 : if( sensor_inp(MASK3_3) == 0x60 ) { 320 : led_out( 0x0 ); 321 : pattern = 11; 322 : cnt1 = 0; 323 : } 324 : break; 325 : 326 : case 41: 327 : /* Right crank clearing processing ? wait until stable */ 328 : if( cnt1 > 200 ) { 329 : pattern = 42; 330 : cnt1 = 0; 331 : } 332 : break; 333 : 334 : case 42: 335 : /* Right crank clearing processing ? check end of turn */ 336 : if( sensor_inp(MASK3_3) == 0x06 ) { 337 : led_out( 0x0 ); 338 : pattern = 11; 339 : cnt1 = 0; 340 : } 341 : break;


The documentation that goes with the kit details some changes that have to be made to get the car to deal with following the line more effectively. In this section, the time it ignores readings for the 2nd line is decreased, additional sensor states are added to indicate turns, the turn angle (handle) and the motor speed differential is increased between the left and right motors.

Here is the modified code being used as of 7/5/12 that gets the car around faster and more accurately:


case 21: /* Processing at 1st cross line */ led_out(0x3); handle(0); motor(0, 0); pattern = 22; cnt1 = 0; break;case 22: /* Read but ignore 2nd line */ if (cnt1 > 50) { pattern = 23; cnt1 = 0; } break;case 23: /* Trace, crank detection after cross line */ if (sensor_inp(MASK4_0) == 0xf0) { /* Left crank determined -> to left crank clearing processing */ led_out(0x1); handle(-42); motor(-20, 70); pattern = 31; cnt1 = 0; break; } if (sensor_inp(MASK4_4) == 0xf8) { /* Left crank determined -> to left crank clearing processing */ led_out(0x1); handle(-42); motor(-20, 70); pattern = 31; cnt1 = 0; break; } if (sensor_inp(MASK4_4) == 0xfe) { /* Left crank determined -> to left crank clearing processing */ led_out(0x1); handle(-42); motor(-20, 70); pattern = 31; cnt1 = 0; break; } if (sensor_inp(MASK4_4) == 0xfc) { /* Left crank determined -> to left crank clearing processing */ led_out(0x1); handle(-42); motor(-20, 70); pattern = 31; cnt1 = 0; break; } if (sensor_inp(MASK0_4) == 0x0f) { /* Right crank determined -> to right crank clearing processing */ led_out(0x2); handle(42); motor(70, -20); pattern = 41; cnt1 = 0; break; } if (sensor_inp(MASK4_4) == 0x1f) { /* Right crank determined -> to right crank clearing processing */ led_out(0x2); handle(42); motor(70, -20); pattern = 41; cnt1 = 0; break; } if (sensor_inp(MASK4_4) == 0x3f) { /* Right crank determined -> to right crank clearing processing */ led_out(0x2); handle(42); motor(70, -20); pattern = 41; cnt1 = 0; break; } if (sensor_inp(MASK4_4) == 0x7f) { /* Right crank determined -> to right crank clearing processing */ led_out(0x2); handle(42); motor(70, -20); pattern = 41; cnt1 = 0; break; } switch (sensor_inp(MASK3_3)) { case 0x00: /* Center -> straight */ handle(0); motor(35, 35); break; case 0x04: case 0x06: case 0x07: case 0x03: /* Left of center -> turn to right */ handle(8); motor(30, 25); break; case 0x20: case 0x60: case 0xe0: case 0xc0: /* Right of center -> turn to left */ handle(-8); motor(25, 30); break; } break;case 31: /* Left crank clearing processing ? wait until stable */ if (cnt1 > 200) { pattern = 32; cnt1 = 0; } break;case 32: /* Left crank clearing processing ? check end of turn */ if (sensor_inp(MASK3_3) == 0x60) { led_out(0x0); pattern = 11; cnt1 = 0; } break;case 41: /* Right crank clearing processing ? wait until stable */ if (cnt1 > 200) { pattern = 42; cnt1 = 0; } break;case 42: /* Right crank clearing processing ? check end of turn */ if (sensor_inp(MASK3_3) == 0x06) { led_out(0x0); pattern = 11; cnt1 = 0; } break;


The completed car powered on

The completed car powered on

The sensor board assembly

Testing the car in a static position (up on supports)

Testing the car in a static position (up on supports)

One of the final tests of a car, track, and scoring system before the convention.

Renesas Micom Car Rally Kit RX62T with LM350 add on set

The stock power supply

After working on the car for a couple of weeks, it was time to address the stock kits’ power supply limitations. The stock kit uses 4 AA batteries to power the MCU board and 4 AA batteries to power the motor drive board. This works well in stock form because the separate power supply scheme prevents brown-outs in the MCU due to the power demands of the motor drive board, and it supplies a proper 5 V to the MCU and servo. For getting started, this amount of power is fine, allowing the builder to concentrate on better code and ironing out any bugs. Once development has gone a little further though, speed and responsiveness become more important. The primary limitation of this set up is that you have only 5 V going to the motors and servo where more voltage and power is advantageous.

The LM350 add-on set mentioned in the assembly instructions of the kit details the parts necessary, so ordering them from Digi-key was easy and cheap.

List of parts:

240 ohm resistor

0.1 microfarad capacitor (2)

5 k-ohm trimmer

LM2940-5 regulator

LM350 regulator

New parts, new snags

Adding the set bought in a new round of trouble shooting. The ribbon cable connecting the motor board and the MCU becomes the power source for the MCU after this change, so make sure the connections are all correct. The added power and speed also highlighted an issue with the control of the right side motor circuit. When the pin is low on the motor control circuit the motor runs forward, and when it is high the motor runs in reverse. With a bad connection to this pin, the motor will run forward all the time no matter what your code says, making for interesting but disappointing behaviors that make the car handle poorly. This effect worsens when more power is applied.


Benefits of the LM350 add on set

After getting the issues sorted out, the effect on the car after adding the set was incredible. The straight line speed and acceleration is a giant step forward for the car. The extra volt to the servo makes the car steer faster and more accurately. The newfound power to the motors gives more authority to the differential steering. In fact, the code needs to be adjusted to compensate for the increased speed entering corners and "cranks", otherwise the car shoots off the track. One feature I have not covered is that the motor speed is adjustable with a set of dip switches on the MCU board. After a little development with the stock power supply it’s easy to start turning the speed up to 100%. With the LM350 set though, the dip switches need to be set to reduce power again, until the code is adjusted to work with the increased speed. In my case, the speed had to be reduced to 65% even after doing some adjustments to the code.

I am looking forward to making this car even faster with modifications like a faster servo, Lipo battery, and writing new code to take advantage of the new parts!

Below is my line following car from 2008 BSU classes. This one used the Basic Stamp board and IR sensors. It was mounted to a standard R/C touring car and could make it around a full size racetrack! Years later this would come in handy for the Renesas MCU Rally Car.

The sensors and Stamp board mounted to the chassis.

The incredible paint job from Ben John

Flyers, the DEVCON 2012 visitors guide and the track I designed and had made by a local sign company.