As part of the Begin Robotics MOOC that I am currently following, a two wheeled mobile robot is used for many of the examples (see Studying : Begin Robotics : Week 1 ). For the MOCC a simulation of the two wheeled robot is used but having seen a video (http://https://www.futurelearn.com/courses/begin-robotics/0/steps/2875 ) of the actual ERIC I decided it looked like it would be fun (and relatively simple) to build my own.
I would need to redesign the whole structure because the real ERIC uses a PIC microprocessor as the controller, it just clips together, and uses DC motors, whereas I wanted to use an Arduino, a simpler 3D print - in order to save design and print time, and continuous rotation servo motors. I also decided to use a 4 x AA battery pack rather than the 3 x AA used by ERIC as I know the continuous rotation servo motors don't work too well on only 4.5V. Plus, the greater weight of 4 x AA batteries should make it easier for the main body of MyERIC to remain horizontal.
For the body 3D print I decided to go for a simple rectangular plate, with a lip on one side to locate the battery pack, and two sets of two pillars on the other side to locate the two continuous rotation servo motors. Due to the extreme excitement of creating MyERIC I put the lip and the pillars on the same side of the rectangular body. Never mind, it works just as well. As the aim is for the physical construction to be perfectly (?) balanced when not being driven I spent some time working out the placement of the two motors. This is complicated by the offset output axle that the continuous rotation servo motor have and still wanting to achieve a balanced mechanism. The result is that on one edge the motor is located slightly towards one end of the rectangular platform and the other motor is located slightly towards the other end of the platform. The idea being that the two axles would be in exactly the middle of the rectangular platform and the two off centre motor body masses would cancel each other out. I almost managed this but somehow the two axles are approximately 5 mm out of alignment. One side is correct but the other isn't and this will probably mean that the mobile robot will move in a slight curve rather than a straight line. Hopefully this can be corrected n software. I can always print another platform later once MyERIC seems to work OK.
The wheels need to be quite big. I started with a 70 mm diameter wheel but quickly realised that this would just not be large enough and increased this to 85 mm. This provides 42.5 mm of space below the motor axles for the battery pack, which is 70 mm long. As half the battery pack is 35 mm which is less than the 42.5 mm available I thought this would be enough. Regretfully I forgot that the battery back would be below the motor axle position and so effectively needed more space or the battery pack might draw along the floor. As I had printed all the parts before I realised this I decided to assemble what I had and see what happened. I think it will be necessary to produce larger diameter wheels although my 3D printer cannot print much above 95 mm diameter so that might have to do. To fix the wheels to the servo I put a hole in the centre the same size as the centre hub of the supplied servo motor legs. All I needed to do then was to drill two 1 mm holes at the ends of the servo motor leg and insert self-tapping screw to hold the two pieces together. There is a problem in that the inside face of the wheel does rest against the face of the blue plastic housing holding the motor so that if the small self-tapping screw used to hold the wheel in place is screwed too tightly there is too much friction and it doesn't rotate. I can fix that by making the wheel slightly thinner if needed. Interestingly, using TinkerCAD to create the wheels might be causing a problem, or might be fixing a problem. Rather than a smooth out edge, TinkerCAD creates a linear piece-wise straight line approximation, so the out rim is a sequence of small flats. This might cause a bumpy ride, or, it might increase horizontal stability as the flats will provide some resistance to small turning torques. This might mean that it is likely that the body will be more horizontal than with a smooth curved wheel. At the moment I cannot tell as it moves too quickly.
To hold the servo motor I have used two rectangular pillars separated by the width of the motor. The idea being that if these were exactly the right distance apart the motors could be forced into the gap and held by friction. If that didn't work I could drill some holes through the pillars and use 2.5 mm bolts to hold the motors in place. I didn't quite get the friction fit I wanted so I used Bluetac to hold the motors temporarily in place to check that it works. If this version of MyERIC seems to work I will drill the holes later and bolt the motors in.
All that was needed then was to assemble everything together and add the Arduino. By pure coincidence the space between the two rows of pillars holding the motors is exactly the same width as the protoboard I used to hold the Arduino Nano. Great. So I used some more Bluetac to hold everything in place. I'll work out some proper fixings later, once I know what additional sensors and/or electronics might be used.
The first test program is just a double for loop which increments the PWM pulse supplied to the motors from 0 degrees to 180 degrees and then back again, as shown below:
for (leftspeed = start; leftspeed <= end; leftspeed++)
rightwheel.write(180 - leftspeed);
} /* for */
for (leftspeed = end; leftspeed >= start; leftspeed--)
rightwheel.write(180 - leftspeed);
} /* for */
} /* while */
This isn't the best solution as continuous rotation servo motors operate at full speed at the extremes and only slow to zero at 90 degrees, before changing direction, so when first turned on the motors operate at full speed and the whole thing shoots off into the distance. I did think the large wheels might overload the servo motors and need too much torque to get turning so the motors would stall. No such problem. They just zoom off.
The video below shows the operation of the completed vehicle and it seems to be OK. I do start by holding MyERIC so that the initial full speed doesn't send it shooting off all over the desk. Then I wait for the motors to stop and put down the vehicle. It works much better than I anticipated. As the wheels are thin and made of slippy plastic I did think I might just get wheel spin. There might be some wheel spin but it doesn't seem to hold back the mobile robot.
I think the next thing is to fix both the motors on securely using bolts, make the rest of the structure stable and then look at how to control the mobile robot and what sensors to add.