Pages

Robot Design Project

Micromouse is an electro-mechanical robot, typically consisting of three main subsystems: The drive system, an array of sensors, and the control system. It is annual contest hold by UC Davis, and the picnic day competition. This robot will navigate through an unknown maze and locate the center in the shortest period of time.

I worked on this project with 3 teammates: Arvin, Chris, and ZhenYu. We used Motorola's 68HC12 microcontroller, Sharp's GP2D120 sensors, stepper motors and motor drivers in our design. A more detailed list of the primary parts that we used is shown below.


Hardware detail list
The MicroMouse has the following components:
Microprocessor: 1 x Motorola 68HC12
Motor Drive 2 x AD3967 microstepping drivers
Motors:2 x Frame size 14 stepper motor (Model Number 3518X-04)
Sensors3 x Sharp GP2D120 IR Proximity Sensor
Wheels2 x Plastic 6cm Diameter with 2 plastic balls
Chassis1 x light weight wood base chassis
Battery8 x 1.5 volt rechargeable battery

   


Microcontroller:
We first chose to use the Motorola 68HC11 microcontroller with the MicroCore 11 microcomputer module board. However, when we started to implement the micromouse with the MicroCore11 module, the memory chip on the module was failed to function. Therefore, we chose to use another similar microcontroller: Motorola 68HC12. We also chose to use the Adapt12 microcomputer module 128KB flash memory to implement our micromouse robot. We chose to use C programming language for software implementation. The 68HC12 is a 16-bit, 8 MHz microcontroller with 8 input/output ports. In our implementation, we used 1 input port for the collect information from sensor, 1 output port to communicate with the stepper motor drivers, and 1 output port for led signals.
Stepper Motor Control:
To control two unipolar stepper motors, we use two AD3967 microstepping drivers. With the motor drivers, 1 output port of the controller is used to control the stepping frequencies and the directions of the two stepper motors. In the implementation of the software, two output capture interrupt routines are used to control the two motors. The timer of the interrupt is configured to be 2MHz. The interrupt routines are implemented to control the speed and direction of the motor. The interrupt routines will also communicate with the routines for error detection and correction.
Motors- size 14 stepper motor 
Specification of the motor
From: Lin Engineering (model number: 3518X-04)
Amp/Phase:                 0.45
Holding Torque:                      7.5 oz-in
Weight                                     0.25 Lbs each
Size:                                        26mm side long

There are two types of motors are mostly used for Micro Mouse competition. One is DC motor, and the other is stepper motor. However, we have chosen to use a stepper motor for several seasons. DC motors require gearing, with a group of only four people, we do not have too much time to deal with extra unnecessary components. Also, DC motors may cause a difficult time working out proper speed control algorithms. Though a DC motor can dramatically increase the speed of our design, but for conservative concerning, we choose to use a stepper motor instead.
One great advantage of stepper motors over DC motor is its precise movement control. With very little incremental steps, it will be easer to control and adjust error accordingly. In the beginning of the winter quarter, we are using two size 17 stepper motor to build our test micro mouse. Even we are able to control its movement through micro controller, it seems occupy too much space of each block of the maze. It has a size of 14cm out of an 18 * 18 cm maze block, which makes it hard to make any turns. Even with a high torque, and easy controllability, we decide to go with the size 14 stepper motor, which has lighter weight, and less torque than the previous motor. So we have chosen to use the 3518X-04 unipolar 14 stepper motor from Lin Engineering.
Sensors - Sharp GP2D120
Sensors are the eye of a robot, and it is the only device that used to perceive its environment. The robot process data received form the sensor and make judgment accordingly. Because our Micro Mouse need to sense the walls of a maze and keep track of the routes to the destination of the maze, a proximity sensor is quite useful in such environment. We are using the Sharp GP2D120 distance sensors to detect the length of the path in front, and two sides. This type of sensor has a detection range of 4 to 30 cm, it also not going to be affected by the level of ambient lighting. The output of this type of sensor is a voltage relative to the distance of the sensor from an objective ahead, so we can determine the distance from the wall simply by converting the voltage to a binary number using the ADC on the microprocessor.
The specification of the sharp GP2D120 is below:
Power                          5V constant usage by using a voltage regulator
Distance range: 4 cm to 30 cm
Size: 44 mm * 13 mm * 13.5 mm

In our design project, sensors had two main purposes, one is to detect the presence of walls both on the sides and front, the other is to provide the distance from left and right wall, and adjust the mouse accordingly. The front sensor has the objective to detect the front wall and prevent collision. If a front wall is detected, the robot will stop and compute the direction turn in the algorithm to reach the center destination.
In order to test to see if the sensors are of the proper sensitivity, we connect the sensor to a constant power supply with 5 volt voltage, and read its output voltage using multimeter. By placing a white sheet of paper some distance away, and modify the distance between them, we can check to see the output voltage value, and match it with the figure 3 above. Also, we have test the value after we sent the analog voltage to the ADC, and use the number value in our programming sections.
Chassis:
We use wood for our micromouse chassis design. We purchase a long piece of wood and cut it in two 10x12 cm pieces. Four 8cm screws and a few nuts are going to be the main support of the frame. With the motor in between the two piece of wood, all major components, including the MCU, Motor Drivers, and the battery go to the top of the frame. Three sensors are attached at the front of the chassis on the top of the bottom wood piece.
Battery:
Technical Specification:
Ni-Cd Battery Pack
Voltage Range: 6V-10.6V
Normal Voltage: 9.6V
Nominal Capacity: 2500mA.h @9.6 V
Weight: 25Grams
When the battery is fully charged, the overall voltage goes up to 10.6V, and it settles at 9.6V and stays for a fairly long period of time. According to our tests, a fully charged battery pack can last for about 30 mins while we do a lot of loading and testing on the mace. The most important thing is that the voltage does not drop dramatically even after a long time of use. We conclude that this battery is more then sufficient for a full run of solving the mace.
Motion Control algorithm
In our implementation, we used 1 input port for the collect information from sensor, 1 output port to communicate with the stepper motor drivers, and 1 output port for led signals.

Ports
PinsComment
Port T
(output)
Pin 7 and 6Control step frequency of the motors
Pin 1 and 0Control the directions of the two motors
PORT AD
(input)
Pin 0,1,2For three sensors
PORT HPin 0,1,2LEDs used for feedback
Input and Output Ports

Program and Data Space:
As we estimated for our software implementation, the program may need about at least KB code space and 4KB data space. With the Adapt12 module with 128 KB flash memory module,32KB of program space is allocated  at address 0x8000 to 0xFFFF(hex value), and 16KB of data space is allocated at 0x4000 to 0x7FFF.
Start Address or pointer value
(value in hex)
Program memory0x8000
Data memory0x4000
Stack Pointer0x0C00


Sensor communication:
We decide to use three sensors on our robot. The sensors are connected to the microcontroller’s input port(PORT AD), which is connected to an analog to digital converter. The analog to digital converter is interrupt driven, which it will generate a interrupt to controller when three conversion of the three sensor channels are completed. Software routines are implemented to calibrate and deglitch sensors, so we can collect accurate information from the sensors. In the calibrating routine, the digital value acquired from the sensors will be normalized to calculate the distances from the wall. To detect walls more accurately, we will acquire information from the sensors for 16 times. The 16 acquired values will be first deglitched, so any out ranged read will be replaced by the average value of the pervious and next read from the sensor. Finally the average value of the 16 detections will be used as the final value.

Error Detection and Correction:
To detect and correct error when the robot is traveling in the maze, software routines will continuously detect the walls and adjust the speed of the motors. As the robot is moving forward, if the sensor detected that the robot is not heading straight or moving too close to a wall, appropriate adjustment will be made to the speed of the motors to adjust the heading direction of the robot.

High level Maze solving algorithm
In this project, we are using floodfill algorithm as our main method to solve the maze. We have two 2D integer arrays to represent the walls of the maze, horizonWalls[][], and verticalWalls[][]. Since we do not need to contain the outer wall of the maze, the dimensions of the two arrays are actually horizonWalls[15][16], and verticalWalls[16][15]. Then we have another 2D integer array to keep track of the floodfill value.
After our mouse moved one cell in the maze, we detect the sensors for walls, and then update the map by updating horizonWalls[][], and verticalWalls[][]. After the updateMap() has finished, we initialize the floodfill array to 255 for each cell. And then we floodfill the map start from the destination cell, which is cell[8][7], until the floodfill value of the current cell is less than 255. By saying floodfill the map, we set the destination cell value to 1, and then loop through the map to check whether a cell’s neighbor has been reached, which means one of the checking cell’s neighbors has a value less than 255. If a cell’s neighbor has been reached, we give the cell a value which is the increment of the neighbor’s value. Until the current cell has a value that is less than 255, we look for the lowest value among the neighbors, and then that is the next cell our mouse should go. Also, if there are more than two neighbor cells that have the same value, our mouse first choose to go forward if the front cell has the value. By this method, the mouse will eventually reach the destination cell.
Finally, our program is able to change the current cell and the destination cell, and we have implemented it so that the mouse will find a way out to the origin after it reaches the destination.


Expenses:
Micro Controller & flash memory: $ 120
Motor Drive: $ 38
Battery: $ 19
Wheels and tires: $ 7*2
Chasis: $ 1
Sensors: $33
Solder tool & board: $ 10
Motor: $ 35
Accessory & backup: $50
Total: $ 320



The Maze ...























The Powers ...




The Wheels ...



The Tools ...


Other Parts ...





The Evolution ...

















The Real Run ...




No comments:

Post a Comment