Rescue Line 2018 – Part 2

Intro

In this part, we will be breaking down our journey towards RoboCup Canada, our club’s first international appearance at RoboCup in 7 years together with our junior team Thicc Wires, who are representing Team Singapore in the Soccer Lightweight category as well.

Team Hwa Chong @ RoboCup Canada ft. Ken Chow (RI robotics coach)

What went wrong in SG Open...

After taking a few days off to rest up and catch up with our long neglected homework, we met back up together to do an AAR as an entire club to reflect on our performance and how our robot can be improved to compete at an international level.

It was quite clear from the start that our robot needs to be rebuilt from scratch from the start. It was too bulky which made it slow. The line tracking program had too many inconsistencies and bugs to fully clean it up. In short, LEGO simply limits how much we can improve our current design and program.

We decided to construct a brand new robot with a LEGO body and motors, but controlled by an Arduino Mega (a type of microcontroller) instead. We also planned to replace all the sensors with Arduino ultrasonic sensors and even solder our own light sensor array. The reason for switching over to Arduino was that it allows for more sensors to be connected, the IDE makes life much easier for programmers and the code runs alot faster and more smoothly. This opens up more possibilities and strategies for us which we desperately need to level up our game.

Mechanical Design

In short, we decided to keep our design roughly the same. The robot would have a low CG and is fitted with tracks to help it navigate speed bumps easily while having enough traction to go up the ramp. While waiting for the electrical systems to be finalised, we also to construct a smaller robot in order to start programming using the new Arduino processor.

Some pics of our robot during its early design phase

Cost Breakdown

Shown below is the cost breakdown of our robot. The final figure is a rough estimate and we did not account for the miscellaneous cost of the LEGO body.

Lifting & sorting mechanism

We reused the same design for the lifting mechanism.

However, we learnt that there is a rule change for the international tournament. The robot would now have to now prioritise the rescue of all the live victims first in order to receive full credit during the scoring. In short, the robot has to differentiate between the silver (live victims) and the black balls (dead victims). This rendered our previous strategy of dumping all the balls in 1 go after every round of sweeping ineffective. 

In order to tackle this issue, we came up with a simple sorting mechanism where we would make use of the electrically conductive silver balls. We wired 2 small copper rods and wrapped it with aluminum foil. When the electrically conductive ball passes through the sorting mechanism and comes into contact with the rods, it closes the circuit and returns 1 in the program, and returns 0 if else. This directs the servo motor to sweep the ball to its corresponding compartment successfully. 

We also added 2 servo motors at the back of the compartments to act as ‘floodgates’ to control which balls to dump into the evacuation zone first, allowing us to deposit the silver balls first to maximise our points.

Watch the short video below to see how it works. 

Our sorting mechanism stripped apart
Separate 'floodgates' that hold the balls in place until its their turn to be deposited

Side Sweeper

Given that we planned for the robot to travel along the edges of the evacuation room, we decided to add a sweeper at the side in order the sweep the balls in the middle of the room to the edges such that they are more likely to be collected by the robot. 

This is done by stringing multiple cable ties together and attaching it to a servo motor fitted to the side of the robot. The servo will then repeatedly sweep the relatively light balls towards the edges of the room. 

Electrical Design

After making the switch from LEGO EV3 to an Arduino microcontroller, we now need to design the electrical circuits and create our own circuit board from scratch.

General Circuitry

Given the lack of time and the steep learning curve of designing a PCB (Printed Circuit Board), we decided to solder our own circuit board on perfboards so that we can test our programs as quickly as possible. Essentially, all our circuitry is DIY.

Light Array

For line tracking, we decided to emulate the LEGO Mindstorms light array and replicate our own version. This was done by soldering 5 LEDs and LDRs in parallel in order to obtain light value readings.

To detect the green squares, we decided to switch to LEGO Hi-technic colour sensors rather than using the normal colour sensors. In order to facilitate communication with the Arduino Mega, we used the i2c protocol.

Programming

All of our programming was done using the Arduino IDE. A general layout of the robot is the Arduino Mega 2560 acting as the master controller. It is in charge of processing data from the light sensors, ultrasonic sensors and the compass to control motor movement. We also have a slave Arduino Nano which controls our sorting mechanism for the last room which runs independently on the side and would trigger the dumping mechanism upon receive the signal from the master controller.

Line Tracing

Once again, we adopted a somewhat primitive method for our line tracing program. The robot performs a small left/right turn when the middle left/right LDR detects a value lower than the threshold, which meant that it was on the black line. 

When both LDRs on left/right detect a value below the threshold, it means that the robot is no longer on a straight line and performs a sharp turn. It will go forward slightly then spins left/right until it catches the line (1-point turn) or a 2-point turn in an enclosed area. 

We decided not to use adopt the PID method as it would take far too much effort to calibrate. We were all new to the Arduino system and we simply did not have time to figure out the corresponding ratio to power the LEGO motors to achieve the ‘on-the-go’ calibration motion required to execute the perfect PID movement.

Obstacle Detection

When an obstacle is detected, the robot uses another ultrasonic sensor on the side to ensure that it clears the obstacle. 

We also fitted more ultrasonic sensors facing upwards so as to detect when the robot is navigating under a bridge. Due to the robot’s bulky size, the ultrasonic sensors would then ensure that the robot performs tighter turns to avoid getting stuck with the pillars supporting the bridge. 

3 ultrasonic sensors to have a much wider range of detection
Ultrasonic sensor facing upwards
1 ultrasonic on either side

Evacuation Room

The robot will run along the wall such that the wall is always on its right side. It aligns itself to the wall at the corner to ensure that the turns are consistent throughout.

We also fitted the touch sensor at 45 degrees to the the wall to detect the triangular evacuation zone, similar to the strategy we used during the SG Open.

Angled touch sensor

The Arduino Nano slave sort the balls collected based on electrical conductivity with servo motors to control flow and direct the balls to the correct compartment as previously explained above. The alive victims (conductive balls) will always be deposited first whenever the evacuation zone is detected. 

In order to maximise the number of points, we also designed our circuit such that the Arduino Nano is kept running even when we call for a restart. The separately run Arduino Nano keeps a timer such that when the 8 minutes is almost up, it transmits a signal to the Arduino Mega (master controller), which directs the robot to rush to deposit both compartments. (consisting of alive and dead victims)

Upon learning that there may be obstacles present in the room as well, we also incorporated the use of our front-facing ultrasonic sensors to detect and maneuver around it such that the wall is on the right side of the robot  after going around the obstacle. 

Camera

We originally had plans to incorporate an OpenMV M7 Camera into our robot. We planned to mount the camera in front to help the robot to quickly identify where the balls are in the room (via circles detection) so that it could path towards them immediately, which saves alot of time and increases the efficiency of the robot in collecting the balls where we might have to sweep multiple times in order to collect all of them.

Unfortunately, we eventually decided to scrap this component all together. We could not establish the communication of the OpenMV with the Arduino (via serial) after several days and our team was already severely behind schedule. Instead, we ditched the camera for a much simpler solution of attaching a long cable tie to a side servo motor, which would help increase the effectiveness of our sweeping strategy in catching the stray balls in the middle of the room.

Actual Runs

During the live game, many things did not work well.  After 10 runs, we finished at 29th place out of 38 teams, averaging ~120 points per run. 

1 main reason was that the line tracing program was not calibrated well, causing the robot to veer off course multiple times, especially at tight corners or when it encountered speed bumps when going up/down the ramp. 

The playfields were also designed to be more difficult, with a giant combined playfield that featured an extremely long and steep slope on the final day that was meant for 2 teams to run on it simultaneously. Our robot was too bulky and did not have enough power to overcome the steepness. 

Our compass also failed which resulted in us being unable to detect the change in pitch when traveling up/down a ramp and thus, the robot is unable to adjust the speed to overcome the slope/slow down to prevent it from toppling over. While we are still unsure of why it failed, we suspect that it could be due to the change in the Earth’s magnetic field from travelling North from SG to Canada as multiple teams have shared they have encountered similar failures in their compasses as well.

After the 3rd/4th run, we hastily constructed a backup LEGO robot meant solely for line tracing as the rest of us raced to debug our main robot. Our backup ended up working much better than the main robot and scored an average of nearly 200 points per run. 

Inspite of this, we really hoped that we could showcase our evacuation room strategy properly as we felt that it is our team’s greatest strength as not many teams appeared to have a solid strategy to sort the balls so as to maximise their points. Watch one of our more successful runs below with our main robot! 

Superteam Challenge

For the superteam challenge, we were randomly paired up with a team from the United States with young teenagers that were around 12-13 years old. 

The challenge for this year was adapted from RCJ soccer. The 2 robots are placed in a modified soccer playfield and they have to work together to collect all the balls scattered around the field and ‘score’ goals with them.

Reflections

Deng Jun: I’m extremely grateful for the opportunity to be able to participate in RoboCup Montreal. It was a fruitful experience for me as I got the opportunity to be exposed to a different side of robotics which is a rare for most people in Singapore. However, I feel that I could have contributed more towards the technical aspects of the robot given that I was mainly in-charge of integrating a camera into our robot, which we eventually scrapped in favour of a simpler, less complicated method.

Hochi: This entire Robocup journey was enjoyable and I learned a lot from it. I was mainly responsible for the circuitry and partially for the programming, and although I felt that there could be alot to improve on, I think that this was a good first try for me.

Huy: Robocup has been a deeply rewarding experience for me, and has opened my eyes to the majesty and wonder of the robotics world. It has shown me that I am capable of doing anything and everything that I set my mind to, and that I should never be afraid to dream big.

Ian: My participation in Robocup has given me incredibly valuable, once-in-a-lifetime experience to bond with my fellow CCA mates, and build closer ties with our friends from overseas. I have also been able to improve myself, both in terms of my knowledge and skill set. Robocup has been a truly unforgettable experience that will stick with me for a lifetime.

Team Singapore 2018 group photo

Concluding remarks

While finishing 29th out of 38 teams was definitely not what we hoped for, looking back, we felt that we performed to the best of our abilities in that short period of time. All of us certainly did not expect to even reach the international competition in our club’s first attempt at Rescue Line. All of us had to learn Arduino from scratch to construct a working robot within 2 months, all while juggling our rigourous academic schedules in JC. Inspite of all the challenges, we managed to put together a robot that we knew could compete with the best. 

Unfortunately, time was not on our side and we did not manage to fine-tune our line tracking program in time for the competition. Our inexperience also costed us greatly, as we managed to ‘blow up’ multiple large LEGO motors during construction and we wasted several days trying to salvage them and figure out what went wrong (till today we are still unsure of the exact reason, but we suspect that we might have over-volted the motor which damaged the motor encoder)

We hope that our first foray into Rescue Line would serve as a valuable source of experience for all and inspire future batches to take up the challenge to raise local standards in rescue to the next level in the future.

Team Chicken McNuggets signing off.

Final design iteration

Leave a Comment

Your email address will not be published. Required fields are marked *