| Company | University of Bath |
| Course | EE30220: Mechatronic design project I |
| Skills Used | Electronic Prototyping, Software Development, Mechatronic System Design,Team Leadership |
| Software | MATLAB, Eagle Cad |
This was an introductory module to Mechatronic development. A pirate theme was added to the project with the goal to search for hidden treasure, this was represented by scanning an arena for magnets before placing cups on top to mark the spot. The gantry used was provided, all other elements had to be designed and built by the team along with code to control the gantry and detect the magnets. The design chosen used hall effect sensors to detect magnets an electromagnet to lift and place cups. This design was successful and completed the challenge reliably, scoring high marks for speed and precision.
The project had a 3 week deadline for development, therefore a plan was needed. By splitting the team into two, work could be done simultaneously on the electronics and hardware elements. I took a lead on the electronics and planned to complete this in 3 stages:
1) Design the circuit on Eagle CAD
2) Build and Test breadboard prototype of the electronic sub systems
3) Build the circuit onto stripboard
By completing this work early in the project, it would allow development work to be done on the software and allow as much testing to be done as possible.
A system concept was needed however, it was thought that by dropping the cups from a lower height the chances of falling would be reduced, this would require a lead screw and motor. An electromagnet would be sufficient to lift a cup and allow it to be held in the centre, further reducing the possibility of catching an edge and toppling.
Board Layout
The PCB had to be constructed from strip board due to the time and budget constraints. In order to have the most size efficient layout, a design was used that stacked the boards on top of each other. This made it less likely for errors to occur from loose wires when removing the board from the gantry. The end result was 3 boards stacked on top of an Arduino MEGA.
Whilst each team member was responsible for an individual part of the project, it was important that the elements would integrate once completed. I took responsibility for ensuring this would happen by placing constraints on the size of each system and scheduling regular meetings to confirm that the design was progressing in the right direction. This pre-planning saved time in the final week of the project as parts fitted together first time.
The first challenge was to control the gantry and implement a limit to prevent it from crashing into the side. This was done with the help of electronics, with the limit switch cutting power to the gantry motor through a logic gate.
A scan could then be made of the gantry giving some initial test data to write the magnet detection code. This was the biggest software challenge. The solution used was to compare a new measurement to the measurements next to it, a larger reading meant that it was closer to the centre of a magnet, a lower reading showed that it was further away. A number of variables had to be tested to give the most accurate readings with limited false positives and negatives.
Finally the code to move the cups to the location of the magnets was written. In order to avoid knocking cups over with the mechanism, the cup furthest away was always placed first and the closest last.
Mechanically the integration was straightforward due to the work put in at the start of the project to provide constraints. On the software level, it was much more complicated. Two of the biggest issues were:
1) There was significant shaking at the base of the mechanism making scanning unreliable
This was solved by adding a pause to wait for shaking to stop before taking a reading. Testing was done to find the maximum amount of shaking allowable to reduce the time added by this process.
2) The motor on the lead screw was moving up and down by inconsistent distances
Because of this cups were getting crushed rather than placed down. Without time to change for a more accurate stepper motor/servo a software solution was needed. This was achieved by dropping the cup from a slight height with an allowable range of heights being tested first.
Overall the system worked successfully performing quickly, accurately and reliably. Given more time to work on the project a better cup placement algorithm would reduce the time taken to complete the task, however, the system exceeded to the standards required.