Build your own MiniSumo
In this article I would like to introduce WOLF, the winner of "BalticRobotSumo 2009 Klaipeda CUP". It is made by Aleksandr Šeikin, the member of our local robotic club at Klaipeda. I was the supervisor of this project. We made four similar Minisumo robots especially for the "BalticRobotSumo Klaipeda" event, and all of them were top ranked at this event. I think this article might be useful for our robotic community, because it will help you to build better, stronger, faster robots. More, more robots!
1. Motors & Wheels
The most difficult task in robot building is to select proper motors. There is very thin line trying to keep balance between high speed and high power, since Minisumo class does not allow using big fat motors- they simple do not fit. We spent a lot of time looking for good and slim motors on the internet. Finally we found pololu.com with a great selection of nice tiny motors. Which one to buy? What gearbox ratio to choose? We ordered 30:1 Micro Metal Gearmotor HP (item #1093) and Solarbotics RW2 wheels (item #642).
Our choice was based on simple calculations and my personal experience. 30:1 Micro Metal Gearmotors can run at 1000 rpm on the end shaft. With a wheel diameter of 3cm robot will reach 1000rpm*3cm*3.14/60sec = 157cm per second speed (no load). Practically maximum speed will be around 1-1.2 meters per second. Robot will cross Minisumo ring in less than 1 second. It is more than enough for Minisumo.
Motor supply voltage has a great impact on overall Minisumo robot performance. More voltage means more speed/power, but be careful not to burn your motors. Supplying 6V motors with 12Volts (for example from 3-Cell lipo) may destroy low quality motors in seconds, but high quality motors will work fine. Nobody knows how well will perform exact motor- you need to experiment. Don't expect “formula-1” performance from 2-dollar motors, but paying 100 dollars for top-quality Maxon motor looks slightly out of the budget for Minisumo class robot.
Micro Metal Gearmotors don't produce significant electrical noise, but some measures should be taken to prevent power line disturbances. We found that it's enough to solder one ceramic 10nF capacitor between motor terminals, and put at least 470uF electrolytic capacitor on the power line. Ceramic caps suppress high frequency electrical noise from the motor brushes, and electrolytic cap suppress low frequency power peaks/drops from motors and sensors.
2. Tires
Good tires may drastically improve your robot performance, but only with conjunction with other factors, such as proper motors, well-designed chassis and so on. You can buy ready-made tires or make custom ones. Any material with medium grip will do. You may read comprehensive articles on Minisumo mechanical theory, but my experience says: „Take any material with sufficient grip and it will be ok for Minisumo tires“. Don‘t bother yourself with calculations- better make your own Dohyo and test your tires on it.
Micro Metal Gearmotors are not powerful enough to make use of superior grip- they just stall. It‘s even better to use medium-grip tires to let wheels slip on maximum motor load to save weaker motors from burning. Of course, if slip occurs too early, you will not be able to control your robot. Early slip can easily be noticed during first tests on Dohyo. Always clean your robot tires before every test or fight. If cleaning doesn‘t help- consider using another material for the tires.
3. Power source
Battery selection is the easiest task building Minisumo class robot. 500grams weight and 10x10cm dimensions limit the choice to 2cell or 3cell lightweight lipo batteries (or accumulators, to be precise). Since your Minisumo robot will probably never consume more than 1-2Amps, batteries of almost any capacity will do. Although buying 200mAh battery will save some space, it's good idea to buy 800-1200mAh capacity battery, because it will last longer without recharging or recharge time will be significantly shorter on the competition day.
For the WOLF we bought 1000mAh Loong-Max 2cell battery and cheap Emax EC-0856 charger. This battery fits easily into Minisumo class robot, leaving plenty of space for motors and other stuff.
Click to see full-size image
4. Motor drivers
There is always some voltage drop in the motor drivers. It means that less power goes to the motors. Some motor drivers like L293D, based on bipolar technology, can "steal" up to 1.7 Volts from your battery voltage. While advanced drivers, based on FET technology, "steals" only 0.2-0.4 Volts.
Let’s say your motor gets 8V-1.5V=6.5 Volts from L293D driver. With MC33886 driver the same motor will get 8V-0.3V=7.7 Volts. According to Ohms law, rising voltage by ~18% gives you ~40% power boost: 7.7*7.7/6.5*6.5=1.4
FET driver Pros: low voltage drop- more power to the motors; higher Amp ratings.
FET driver Cons: higher price; hard to find.
Bipolar driver Pros: cheap; widely available.
Bipolar driver Cons: large voltage drop- less power to the motors.
First we tried one L293D on WOLF. Micro Metal Gearmotors have winding resistance ~4 Ohm. While powered from 2 Cell lipo and L293D driver, motor gets ~6.7 Volts. Thus maximum current through the motor is 6.7/4=1.7 Amp, which exceeds L293D current limit more than twice. Driver’s thermal shutdown occurred usually after 10-20 seconds of WOLF’s run. We were very disappointed, because we didn’t have any FET drivers on hand. Solution was simple and efficient: we stacked another L293D on top of existing one to double driver’s Amp rating. It helped! Now WOLF could run for a long time without any problem.
Click to see full-size image
5. Control board & sensors
WOLF control board is very similar to our Roomba control boards. The only difference is additional layout for L293D driver. Board consists of Atmega8 microcontroller clocked at 10MHz, LM7805 voltage regulator, L293D driver and solder pads for sensors.
For opponent detection WOLF uses three fast GP2Y0D340K sensors with 5msec single measurement time- two on sides and one on the front. First we wanted to place two sensors in front of the robot, but WOLF lost one eye during first test. Battery was connected in reverse polarity and one sensor said “buy-buy”. After this accident we noticed very strange behaviour of the robot. Its movements were jerky and it was not able even to drive straight for a longer time. Oscilloscope showed huge disturbances on the power line. These disturbances were caused buy GP2Y0D340K sensors. We soldered 100uF electrolytic capacitors straight to each sensor power pins, and problem was solved.
For line detection WOLF uses two TCRT1000 optoreflectors. They are placed ~1mm from the ground. We didn’t protect line sensors from exterior light on purpose. Want to know why? With uncovered sensors WOLF accidentally may see white border line in the middle of the ring. Is this a problem? Not at all. Let’s say WOLF drives straight and enemy approaches from the back. WOLF does not have back sensors, so enemy will probably remain unseen and can perform successful attack when WOLF will be turning around by the edge of Dohyo. With “not so well adjusted” line sensors WOLF may turn around in the middle of the ring and detect enemy anywhere, anytime. This funny feature looks like very intellectual programming algorithm to the spectators, but it’s just a sensor glitch!
Click to see full-size image
6. Software
WOLF’s program is pretty straightforward. Actually it is a standard template for many robots in our robotic club. Template was first developed for Master of Disaster, 3kg Sumo robot, and proved to be very efficient. This is like our BIG SECRET. But we don’t like to keep secrets here at BalticRobotSumo. We are always open and ready to share our ideas with robot builders from other countries. The only exclusion may be the last week before another BalticRobotSumo CUP J
GP2Y0D340K sensors are quite sensitive and sometimes they report “target” on empty ring. “Spin” routine is used to deal with false triggerings. If any sensor gives positive output even for a single measurement, WOLF spins in the corresponding direction and searches for the enemy. Robot spins until front sensor sees object or until spin time is elapsed. Line sensors are checked not only in main loop, but also in “Spin” subroutine. It is done to prevent WOLF falling off the ring while spinning.
Output states of all three GP2Y0D340K sensors are written to one variable. Each sensor has its own dedicated bit in this variable. We analyze the variable, and motors are controlled depending on the evaluation result. Special thanks go to Larry Barello for his nice motor control subroutines.
7. Chassis
Finally, here comes the art! You can get best motors, best sensors and be programming guru, but badly designed robot chassis could ruin all your efforts. Many robot builders underestimate importance of this aspect.
Aleksandras made WOLF’s chassis from the second try. First it was designed like a pyramid with ramps on all four sides, but it was not enough space to put all stuff inside, and even wheels did not fit well. Second design was much more practical and simpler. And it was very efficient! WOLF is a perfect example how Minisumo must be built, and how human skills and quality hardware can complement each other to produce such a nice creature.
Click to see full-size image
I wish your robot to be fast, to be smart, to be the winner!
See you at next BalticRobotSumo competition!
$regfile = "m8def.dat"
$crystal = 10000000
Wait 5
Dim Cycles As Integer
Dim I As Byte , J As Byte , Obj As Byte
Right_motor_dir Alias Portb.0 : Config Pinb.0 = Output
Right_motor_pwm Alias Pwm1a : Config Pinb.1 = Output
Left_motor_dir Alias Portd.7 : Config Pind.7 = Output
Left_motor_pwm Alias Pwm1b : Config Pinb.2 = Output
Front Alias Pind.0 : Config Pind.0 = Input
Front_left Alias Pind.2 : Config Pind.2 = Input
Front_right Alias Pind.1 : Config Pind.1 = Input
Left_line Alias Pinc.3 : Config Pinc.3 = Input
Right_line Alias Pinc.4 : Config Pinc.4 = Input
Const Motor_forward = 0
Const Motor_reverse = 1
Declare Sub Spin
Declare Sub Set_left_motor_pwm(byval Pwm As Integer)
Declare Sub Set_right_motor_pwm(byval Pwm As Integer)
Config Timer1 = Pwm , Pwm = 8 , Compare A Pwm = Clear Down , Compare B Pwm = Clear Down , Prescale = 8
If Front_left = 0 Then 'spin if side sensor sees enemy
Set_left_motor_pwm -250 'in the beginning of the fight
Set_right_motor_pwm 250
Cycles = 30000
Call Spin
Else
Set_left_motor_pwm 250
Set_right_motor_pwm -250
Cycles = 30000
Call Spin
End If
Do
If Left_line = 1 Then 'line detected- go back and turn around
Set_left_motor_pwm -200
Set_right_motor_pwm -200
Waitms 300
Set_left_motor_pwm 250
Set_right_motor_pwm -250
Waitms 100
End If
If Right_line = 1 Then 'line detected- go back and turn around
Set_left_motor_pwm -200
Set_right_motor_pwm -200
Waitms 300
Set_left_motor_pwm -250
Set_right_motor_pwm 250
Waitms 100
End If
If Front_right = 0 Then Obj.0 = 1
If Front = 0 Then Obj.1 = 1
If Front_left = 0 Then Obj.2 = 1
Select Case Obj
Case 0 'nothing detected-go straight
Set_left_motor_pwm 80
Set_right_motor_pwm 80
Case 1 'right sensor sees object-turn right
Set_left_motor_pwm 250
Set_right_motor_pwm -250
Cycles = 30000
Call Spin
Case 2 'front sees object-full speed forward
Set_left_motor_pwm 250
Set_right_motor_pwm 250
Case 4 'left sensor sees object-turn left
Set_left_motor_pwm -250
Set_right_motor_pwm 250
Cycles = 30000
Call Spin
End Select
Obj = 0
Loop
End
Sub Spin
For I = 1 To Cycles
For J = 1 To Cycles
If Left_line = 1 Then 'check line just to make sure
Set_left_motor_pwm -200
Set_right_motor_pwm -200
Waitms 300
Set_left_motor_pwm 250
Set_right_motor_pwm -250
Waitms 100
Goto Exit_spin
End If
If Right_line = 1 Then 'check line just to make sure
Set_left_motor_pwm -200
Set_right_motor_pwm -200
Waitms 300
Set_left_motor_pwm -250
Set_right_motor_pwm 250
Waitms 100
Goto Exit_spin
End If
If Front = 0 Then Goto Exit_spin 'exit sub if enemy detected
Next J
Next I
Exit_spin:
End Sub
Sub Set_left_motor_pwm(byval Pwm As Integer)
If Pwm >= 0 Then
Left_motor_dir = Motor_forward
Tccr1a.com1b0 = 0 'normal PWM
Else
Left_motor_dir = Motor_reverse
Tccr1a.com1b0 = 1
Pwm = -pwm 'inverted PWM
End If
Left_motor_pwm = Pwm
End Sub
Sub Set_right_motor_pwm(byval Pwm As Integer)
If Pwm >= 0 Then
Right_motor_dir = Motor_forward
Tccr1a.com1a0 = 0 'normal PWM
Else
Right_motor_dir = Motor_reverse
Tccr1a.com1a0 = 1
Pwm = -pwm 'inverted PWM
End If
Right_motor_pwm = Pwm
End Sub
Click thumbnail to see full-size pictures
Click thumbnail to see full-size pictures
Click thumbnail to see full-size pictures
Click thumbnail to see full-size pictures
Click thumbnail to see full-size pictures |