The OSEPP robot is a cool little device but after playing with it for a month or so, I started thinking about enhancing mine.
I was doing some experimenting with sonar ranging and near-infrared phototransistors and I happened to have a couple unemployed of model airplane servos and an LCD display around the shop. Why not integrate the whole lot together into a robotic magnum opus?
Thus begins the saga of Robot V.2
The plan was to upgrade the robot with a servo-driven sensor array containing both sonar and infrared sensors as well as an LCD/keypad shield. The latter would provide a menu system to select between various modes of operation as well as status information.
Making it go straight.
One thing about this robot I'm not impressed with is its inability to travel in a straight line unguided. There's enough play in the mounting holes for the motor brackets on the bottom chassis plate that alignment of the wheels may become an issue. Real automobiles have what's known as "toe-in" to increase straight-line directional stability. The front wheels are angled inwards very slightly. This helps keep the vehicle from wandering all over the road.
Some radio-controlled model cars have a mechanical adjustment to bias the steering and make the vehicle travel in a straight line. Even most cheap R/C toys have this feature. No such adjustment is present on the robot, nor is there an obvious way of adding one so I decided to create some "toe-in" by angling the driving wheels inwards as much as the play in the mounting holes would permit.
I may as well have saved myself the trouble. It doesn't work. As I've noted before, putting the ball caster in the front and the driving wheels behind is a fundamental design error.
A brain transplant.
Adding the servo, additional sensors and display was going to require more memory and I/O ports than the Arduino Uno-compatible board supplied with the OSEPP kit delivers, so a more capable microcontroller was in order.
The top plate of the robot's chassis is drilled to accomodate either an Uno or the more capable Mega 2560 device. Somebody was thinking ahead there.
Making things spin.
A Futaba S148 went into the servo mounting aperature at the front of the chassis. The IR follower was removed to make room for it. The S148 is a fairly basic 180-degree analog servo that can usually be had from a hobby shop that deals in radio control for less than $20 CDN.
The most important properties of the servo is that it rotates in a range of 180 degrees and it fits in the hole in the chassis. A 360-degree servo will not work in an application like this. Those are designed for another purpose altogether.
The market for small model control servos is dominated by two manufacturers: Futaba and Hitec. I recall from my R/C model boating days that their products are not interchangeable. There are signal timing differences between the two that have software implications which are not well understood in the Arduino maker community. More on that later.
If you want to experiment with servos, I recommend buying name-brand ones from hobby shops rather than the undocumented "clone" servos one sees on maker web sites, usually for more money.
Additional power connections.
With the servo mounted, another issue arises. There aren't enough power and ground pins available on the standard OSEPP robot to accomodate all the things I wished to add to it. I fabricated a "power bus" out of an old piece of Veroboard and a couple of bits of dual female header connector strip I had laying around. This provides additional points of connection to both the 5V regulated power from the motor driver board and the (approximately) 7.5V unregulated supply from the robot's batteries.
As it happens, the unregulated 7.5V isn't really needed and will cause damage if something that needs 5V is accidentally connected to it.
This was mounted on a brass standoff culled from a castoff PC and except for the fact it's made out of 1980's vintage phenolic circuit board, looks like it belongs there. The IR receiver for the remote control was moved to the back of the robot to make room for it. I've actually been running it this way for a while anyway as it seems to be more sensitive in that location.
The sensor array itself was constructed with a small breadboard and pieces from a dollar-store metal construction set. These things are great. They're basically a clone of the old Meccano sets many of us had as kids and they only cost a couple of bucks. They're an excellent source of whatever nuts, bolts, shafts and assorted metal bits you might need for a project like this. I buy them whenever I see them.
My original design for the sensor array had the breadboard mounted vertically with the sonar sensor plugged into a 90-degree header connector. I constructed a framework out of Meccano-clone parts and attached this to one of the crossarm pieces that come with a servo.
The whole assembly looked like a 1940's radar scanner and was decidedly top-heavy. It was subsequently redesigned into a rather more elegant configuration, but that's another story.
Obviously, Robot V.2 required rather more wiring than its predecessor. Fortunately, we had on hand a large number of 8" male-to-male interconnect leads for this. Some of the motor wiring had to be extended to accomodate the larger Arduino board. A package of male-to-female leads served the purpose here.
Initially, the wiring was kept the same as per the original kit. That is to say, what connected to Pin 10 on the original Uno board was connected to Pin 10 on the Mega 2560 and so on. It seemed reasonable to expect that a sketch that worked with the Uno would also work with an identically-wired Mega 2560.
That turned out to be a most unrealistic expectation, and getting it running turned out to be quite a bit more complicated than expected.
Bruce Grant's Web Page is licensed under a Creative Commons Attribution 4.0 International License.
Based on a work at http://www.wbga.ca..