User:1sfoerster/enes100/fall2013/p3Tribot

=Problem/Finish Description=
 * 1) Solve battery holder problem, assemble robot that is in pieces
 * 2) Number Tribots, test, develop form for describing what needs to be done to each
 * 3) Document all wires into the head
 * 4) Move all prior WowWee, BallBot, Tribot documentation onto this page
 * https://en.wikiversity.org/wiki/Arduino/WowWeeTriBotArduino
 * https://en.wikiversity.org/wiki/BallBot
 * https://en.wikiversity.org/wiki/Tri-BotHack
 * https://en.wikiversity.org/wiki/BallBot/Howard_Community_College/Fall2011/501_BBotz2
 * https://en.wikiversity.org/wiki/Tri-BotHack/MotorTest

=Original Conceive=
 * 1) Develop robot base that can be used in programming classes such as ENES-150
 * 2) Add add sensors to the robot such as remote control from PC, avoid colliding with wall

=Design=

Purchase WowWee Tribot
WowWee Tribots retail at around $300, Amazon discounts a bit and they sell used from $40 on up.

The robot is officially called the "WowWee Tribot Talking Companion." There is a WowWee Mini Tri-bot that retails for around $21 that should not be confused with the bigger brother. Online it is hard to tell them apart. The Mini Tri-bot does not ship with universal or Omni wheels, has just one motor and in general is not worth an arduino.

Wheel Modification
There are three separate motors with encoders to count shadows (see the black wheel under the circuit board).



Remove torso IR Cables
Remove the white wires that go to the head switch on the torso. Don't remove the switch. Remove the white wires from the switch that plug into the existing controller.

Remove the ribbon cable coming up from the motor controller and the power cable coming up from the motor controller through the torso.

Remove head Cables
There are two ribbon cables and one power cable to the head that need to be removed.

Remove Existing Logic Board
Four screws hold on the existing logic board. The arduino almost fits 2 of the screws. One screw has to be forced in at an angle, but both the Uno and Duemilanove both mount at two points. The arduino is larger than the original logic board. Putting the arms back on over the new arduino like they went over the old logic board is not an option.

Modify Motor Controller

 * Cut Ribbon Cable and Head Power Cable
 * Remove IC Solder Pads
 * Solder Ribbon Cable to IC Pad
 * Slice into Battery Power
 * Add Encoder Power from Arduino

The first step is to cut the cables connecting the base to the head. Power is in the base with the wheels, so nothing is lost. The brown/red lines will supply power to the arduino. The ribbon cable will enable the arduino to control the motors.

The black above the red is where the motor controller is housed in the base of the robot. It barely fits into the housing.

Implementing Arduino Board
The first step was to sand off the pads on the current cpu of the motor controller. This was done with a dremel with a cutting disc put on it. This went very fast. Be careful to sand too much off in the future.



The input to the controller was from the head of the robot through the cut off ribbon cable. The output if the controller was to the rest of the board.

The black stuff helps dissipate heat from the controller chip which is underneath the black stuff. The black stuff enables the controller to be made smaller.

The controller is on a separate circuit board than the rest of the motor controller. The sanding job did not threaten the structural integrity of the rest of the circuit board.

Main Outer Component
Goal is to repeat previous success with existing WowWee and mount the arduino.

It was thought that the wheels had to be removed first, but they don't. The hub caps can be popped off if the wheels need to be removed. However the wheels don't even need to be removed.

The second area is to remove the chest. Inside the chest is the head controller. The black handle in the back of the tribot does not come off. The chest plate does not come off. The sides of the chest pull apart in the front and separate. The cables to the arms in the picture are to infrared sensors. There are no motors controlling the arms.

The cables to the arms do not need to be cut. The cables going up into the head need to be cut. Leave as little cable attached to the head controller as possible. Make the cables coming down from the head as long as possible. Be careful cutting the wires. Carefully pull out the speaker wires from the wiring harness.

Main Internal Component
The top of the tribot head can be pushed down to trip a switch. The switch is the white piece of plastic that is either at a 45 degree angle when the head is up, or is vertical when the head is pushed down.

There are two white wires attached to this switch. These could be run to the arduino to add a mechanism to turn off the robot, reset the software, or pause the software instead of pushing the power switch.

The head controller is held on by four screws. The vertical distance between the screws almost matches two mounting holes in the arduino. Two of the screws can be used to mount the arduino on the tribot's back.

The goal is to run the ribbon cable, the 12 volt power cable up to the arduino and the 5 volt power down from the arduino to the motor encoders. There is a cable channel that requires soldering ends that plug into the arduino after the cable has been put into the channel. This way the hips can be replaced so that the motor controller is not exposed.

There is no reason to try and put the arms and chest back on the tribot. The only electronics in the arms and chest are the IR sensors and the speaker.

Next the motor controller needs to be taken out of the black hip support. The hips are held together with at least 7 screws of at least 3 types. The hips came apart very easily, but do not appear to be easily assembled. This is the most important stage. Not enough information was captured here to explain what all the issues are.

At this point the day two soldering was repeated. It looks like the ribbon cable length is just long enough to reach the arduino ... but this hasn't been tested yet.



Put cable in tray, soldered ends on the cables from motor and head, assembled the hips, put arduino on, had problems with cables from the head getting pressed into the pins sticking out the bottom of the arduino. Had to open up the spinal column and re-route cables from head. Took apart the head and torso twice to accomplish this.

Hooked one cable from the switch to the arduino and then hooked the other end of switch to pin 12. Ran the button program. When pin 12 was pulled to 5 volts, button program definately lit up the onboard LED. But turned off at random. Moving hand in the air near the arduino acted like a bad infared receiver with the button program randomly turning the LED off and on.

Then hooked three motors to the arduino and tried to get all three turning at once. Could not. Had strange pulse when initially powering on with the Wow Wee batteries. LED on the arduino would blink and the wheels would not turn. Replaced the batteries and two out of the three wheels would turn when running off batteries. But all three would turn (slowly) when running off USB power. All three would turn rapidly when both USB power to the arduino and batteries of the Tribot were turned on. This suggested a grounding problem.

Ran a cable from the battery ground to the arduino with the red wire already mentioned and all three wheels turned, just running of the batteries. Battery ground was identified by looking for a two wire cable coming up from the motors/batteries at the bottom, thicker than most of the wires and colored red and black.

The red and black were spliced with blue and black cable. The black and blue power cable was run up to the arduino. Now all three motors spin. The initial light blinking start up is still going on.

Hooked a 10K pull down resistor to the switch and the button program works now with the head. In photo can see the 10K resistor, the 5 volt line going to the head switch, the return wire from the head switch going to the 10K resistor which is plugged into ground. There is another white wire going to pin 3 from the top of the resistor that is going to be pulled high by the switch, and then pulled to ground by the resistor.

Established a color standard for the arduino pins to be used in software. The first three are motor on, next three motor enable, third three motor encoder.
 * 12 yellow (ribbon)
 * 11 green (ribbon)
 * 10 blue (ribbon)
 * 9 white (ribbon)
 * 8 gray (ribbon)
 * 7 purple (ribbon)
 * 6 orange (ribbon)
 * 5 red (ribbon)
 * 4 brown (ribbon)
 * 3 white (head switch)

Wrote a /MotorTest/ the spins tight the robot CCW, CW, forward, backward, spins one motor at a time. Backward doesn't work and CCW lurches all over the place. Think that motor direction 1 (pin 9 is not working). Checked connectivity between arduino and motor controller and there were no problems. It is possible that the robot may not have a direction control on the robot right wheel. Only two wheels are needed to do everything. May have to wait until build another to see if all three motor direction controls work.

Used old robot was originally working on, added wheels, head, duplicated the switch functioning. Problem with motor 1 was fixed by correcting bugs in the software. Was changing the direction of the motor after it was turned on. Have to change direction before turning on the motor. Modified the program so that all demo programs are exercised after the head is pressed.

Visual Video Link
youtube video

Added cable so that 5 volts goes to head and the encoders.

Wrote this program to test the encoder: /EncoderTest/. Expecting the pin 13 LED to blink four times for each wheel revolution and then pause for two seconds either off or on. LED starts off, wheel starts to spin and the LED stays on no matter what. Edited the program, and can see changing high to low, but not detecting four or more transitions per revolution. Goes high or low after motor pauses for 2 seconds. Possible Solutions:
 * experiment with code
 * hook up scope
 * add pull down resistors

Hooked up [Digilent EE board] running Wave Form software to look at the pulse train coming from the wheel 1 encoder. Looks like a pulse width of .25ms. So the encoder is spinning much faster than the motor .. about 2000 times per revolution of the wheel.

So now the goal is to count three encoders simultaneously. Found this [web site] that looks uses interrupts of the amtel chip on the arduino. Can get encoder to flash numbers on screen, but looks like it is a two wire encoder. The ball bot has one wire encoders. Running /Encoder1/ this software (modified to turn on motors in void setup) can get 0 1 0 1 pattern for motor 2 and 0 -1 0 -1 patter for motor 1. So trying something else. Looking at encoder code on the arduino playground. All the code is comparing two pins before incrementing a counter.

Examining head wiring on tribot

 * Removed Head of partially dismantled tri-bot to work with it separately from the base.
 * Neck piece separated to view underside of head where wires enter. A spring is inside the neck which activates a reset switch when the head is depressed.


 * 2 ribbon cables, and another black/orange wire travel to the tri-bot head and connect to a small circuit board there.
 * Ribbon #1 Brown, Red, Orange, Yellow, Green, Blue
 * Ribbon #2 Brown, red, Orange, Yellow, Green, Blue
 * These are marked on the control board with things light R eye, L eye, R ear, etc. Want to test to see if accurately labeled.
 * Tried to power up the head using a power supply in order to test the different wires.
 * Hooked up to power supply at about 6 volts and the head appeared to receive power.
 * The head lamp on the top was released open, and the ears extended out, but nothing afterwards.
 * Tried applying power to each of the wires of the ribbon cable, with no effect.
 * Tried testing orange/black wires coming off the circuit board with a volt meter, and picked up nothing.
 * Could feel the bottom of the head where wires enter becoming quite warm, and could smell hot plastic.

Testing Tribots
Only one tribot was powering up.
 * Numbered the tribots, 1 through 5.
 * Examined the battery compartments of all 5 tribots.
 * Found significant corrosion in the battery compartments of 3 bots. Corrosion was scraped and cleaned away and the connections tested to be sure it was sufficiently removed. Store tribots without batteries.
 * Tribot #2 previously not working, not powering up well.
 * Screw stripping taking place with over tightening of compartment screws. Do not over tighten tribot screws.

Tribot Status

 * Bot #1 Fails to power up. Wires out of place. Does not power up with wires connected as the others are. Wires appear slightly different from working model.
 * Rewire?
 * Bot #2 Powers up now, Runs through programming reliably.
 * Bot #3 Powers up, Sometimes. Runs through program when it powers up. Jiggling it can help.
 * Loose wire? (Bot that would originally power up.)
 * Bot #4 Body assembled in reversed position, needs power switch. Does not power up.
 * Makerbot fabricated piece may work for switch? Wires unconnected, still does not power with wires connected like the others.
 * Bot #5 Arduino not assembled to bot at this time. Has a stripped screw holding on head casing.
 * Finish assembling

=Implement= The only implementation that has been done to Tri-bots are attachment of arduino board and programming of a test sequence.

Motor Test and Arduino program Code

=Operate=
 * Tribots currently operate via turning them on with the black switch on their bases. They immediately begin to run the programmed sequence and then stop. Depressing their heads will cause them to run the sequence again.
 * Tribots should have their batteries removed each time they are put away, since it is unclear when someone will return to them.
 * Care should be used in tightening the screws used in the tribots, as they are easily damaged with heavy use.

=Next Steps=
 * Check all the wire connections of tri-bots #1, 3, and 4. Finish assembly of #5. Find or create switch for #4, and turn its body back around. Goal of having all the bots power up and run through the sequence programmed to the Arduino board.
 * Maintain bots - store without batteries, do not over tighten screws. Replaced stripped or stripping screws with new.
 * Write an inventory log for extra parts.
 * Attach sensors and work with shadow counter
 * Play around with Arduino board and write a detail instruction on how to move Tri-bot forward, backward, left, right, etc.
 * This bluetooth set-up with an Arduino board looked interesting to explore - here.