I’ve connected the Tamiya DC motors to the Baby O, together with an XBee. Powered by a 2S Lipo.
Another Arduino uses a thumb joystick and send the data over via XBee.
The Baby O seems to “hang” whenever there’s sudden acceleration. A reset seems to do the trick.
After a couple of tries, the M2 output is dead. Using the Motor example, only M1 is responding.
No visible damage on the board.
Using a spare Baby O with the same code, the motors are running, but the “hanging” still occurs occasionally.
Q1) Should I ramp-up the motor by code? How should I write it without noticeable lag in performance?
Q2) Possible to savage/repair the M2 of the Baby O?
Ramping the motor speed might help. You can slowly increment the motor speed using a loop until the desired speed is reached. If you post your code, I would be happy to take a look at it and give pointers.
If M2 output is not working, it is likely that the motor driver IC is damaged and will need to be replaced. Replacing the driver will require tools for surface mount rework. The motor driver used on the Baby Orangutan is Toshiba’s TB6612FNG dual motor driver.
Here’s my code:
void motor(int x, int y)
// x & y are inputs from the joystick, range from 0x00 to 0xFF, with neutral @ 0x80
// MAX_SPEED is set @ 150
throttle = ((0x80 - (float)y) / 0x80 * MAX_SPEED);
steering = ((0x80 - (float)x) / 0x80 * MAX_SPEED);
motors.setSpeeds(throttle + steering, throttle - steering);
For the ramping code, what will be an appropriate value for the increment/decrement?
Will it be better if the ramping code is inserted in the arduino+joystick instead of the baby-O+motor side?
This is the thumb joystick I’m using: http://www.seeedstudio.com/depot/Grove-Thumb-Joystick-p-935.html?cPath=85_51
I am not sure which would be better, but it makes more sense to me to add the ramping code to the part that sets the motor speed. How you would ramp the speed of the motor would be dependent on your setup, but you might try starting by incrementing the speed by units of 10 and adjusting the delay to make it go smoother.