I wasn’t able to get the code to compile because of the occurrences of the following line:
Serial.print(buff1*,BYTE);
Changed it to Serial.write(buff1*); and compile errors went away.
I don’t have servos connected. I have tried with and without servo code from the manual.
Power test to individual motors checks out using battery pack.
No worries mate, I am glad you responded! Thank you and the wonderful people at RobotShop for helping me on my journey into robotics. I understand that there will not be coverage on the weekends, no problem. Thanks for getting back to me. I am hoping to document my adventures with the robotshop rover using this forum. Hopefully someone else will be able to use the information I document in their project as well.
I am sorry, I am having a hard time understanding:
•The black wire completely on the left to the V+ on the batteries.
Let me recap what is on the breadboard from left to right:
V+ red (from 4AA battery pack)
Common shared ground from (4AA battery pack that I split into two wires, other ground is in arduino power gnd next to the orange 5v wire)
Orange to 5v pin on arduino
Yellow to tx1 on arduino
green to pin 2 on arduino
Motor wire 1.a
Motor wire 1.b
Motor wire 2.a
Motor wire 2.b
Note: In one of my previous replies to this thread I mentioned that one of my troubleshooting steps to determine why the power to the wheels was not working would be to change the stock V+ (red) wire from the 4AA battery pack. So to solve this issue, I soldered a #22 wire extension into the red wire and as a result you can see that my V+ wire is now black.
It appears that something is awry on my connections to the pololu controller. When I play with the leads to the breadboard I get a range of actions from the microcontroller. Without pressure on the leads right now I am getting nothing with the breadboard setup. This is what was causing me to suspect the solidity of the connections into the breadboard and board.
I have noticed that once switching my wires off the holes in the pololu controller board and onto the breadboard using those small red wires to connect to the pololu controller board: The noticed effect was that the two green led on the pololu board no longer work at all. They used to light up bright and solid, granted it did take some fidgeting with the wires into the pololu board’s holes to make all 2 light up at once. At this point upon a reset of the power and red button on the arduino both wheels would work fine. Sometimes if one of my wires into the pololu were not in right, only one wheel would get power. Or none at all. I would just move around the power and the ground from 4AA pack on the pololu holes or the individual motor wires power and ground until both green led would turn on. Based on this behavior I was began to suspect my connections to the pololu board.
Switch around the hot and ground wires for motors on motor controller board. First tried switching hot and red slots for motor 1. Than for motor 2. Than tried to switch motor1 and motor2 to separate hot and ground sets.
Yes, I have searched around in the forums and using google, haven’t been able to find anything that helps. I think my problem is either related to the code I am trying to use or the setup of my board is incorrect. I need to figure out a way to search your forums with something like -DFRobotShop because there seems to be a lot of articles for that version of the robot compared to the version I have.
I tried plugging the USB wire in the arduino and battery pack wired up like the manual diagram. And without usb wire into the arduino.
I should point out that I have not followed these steps from the manual (in addition to not installing servos, or servo code.)
I am not sure if I am using #22 gauge wires to connect from microcontroller to the breadboards. The wires I am using are from the 140 piece pre-formed jumper wire kit. The black wire you can see in the pictures is the #22 gauge.
I have not yet set up the on/off switch between the Tx pin of the Arduino and the motor controller Rx. (Note if you also wait till later as I did to perform this step, make sure to turn remove power to your pololu controller before doing so. I think this could fry your micro controller. As a safety step I have been removing all leads into my arduino when uploading software. However, not sure about this but if someone could confirm, I think I only need to remove the TX1 connection when doing a software update - Will look into this when I have time and update this unless someone can validate and reply to this post)
int motor_reset = 2; //motor reset pin connected to digital pin 2
void setup()
{
pinMode(motor_reset, OUTPUT); //sets pin as output
//digitalWrite(motor_reset, LOW); //do not activate motor driver
Serial.begin(9600); //communication at 9600 baud
// reset motor controller
digitalWrite(motor_reset, LOW);
delay(50);
digitalWrite(motor_reset, HIGH);
delay(50); // reset delay
}
void loop()
{
motorcontrol(); // subroutine motor control
}
//subroutine motor control
void motorcontrol()
{
//left motor
unsigned char buff1[6];
buff1[0]=0x80; //start byte specific to Pololu motor controller
buff1[1]=0x00; //Device type byte specific to Pololu controller
buff1[2]=0x01; //Motor number and direction byte; motor one =00,01
buff1[3]=0x7F; //Motor speed “0 to 128” (ex 100 is 64 in hex)
for(int i=0;i<4;i++) {
Serial.write(buff1*);
}
//right motor
unsigned char buff2[6];
buff2[0]=0x80; //start byte - do not change
buff2[1]=0x00; //Device type byte
buff2[2]=0x03; //Motor number and direction byte; motor two=02,03
buff2[3]=0x7F; //Motor speed "0 to 128" (ex 100 is 64 in hex)
for(int i=0;i<4;i++)
{
Serial.write(buff2*);
}
I could also use some advice on power:
I am interested in running the robot in two modes
Remotely using the 4AA battery back - how can I power the arduino board and the motor controllers? I was hoping the assembly manual’s diagram cited previously would accomplish this task. So the (DC and servo) motors would run off the 4AA battery pack and the board run off the 9v barrel adapter.
Plugged in. What is a good way to power the rover with a wall adapter? I understand that the arduino can be charged via usb power. How would I supply power to the track through its motor controller and the servos through there servo controller? I understand that I can operate the arduino board with either the usb charger or a 9v wall adapter.
“manual setting (using reset button) was needed to make it worked”
Ok, I think they mean to use the arduino power reset button located near the usb plug. Hold that down and you will see two lights power up on the pololu controller after reset.
**Ok neat, that fixed some of my problems. I just needed to shift down two pins.
I have an arduino USB r3, the manual is for a arduino diecimilla. **
I noticed that at first only 1 motor was working at a time. I switched the hot and red for one of the motors and it seems to work much better now. Both motors are running.
However, I have noticed that the sometimes one motor works and sometimes both work, sometimes only one works. This seems associated to how my wires are physically setting on the breadboard. If I play around with the wires (keeping them in their holes on the pololu micro board) and depending on how the wire leads touch against the ring surface until I finally get a solid connection against the ring. Any tips on how I can make this more consistent? I understand I need to solder when the robot becomes mechanical so the leads don’t fall off the bread board due to motion and vibrations. However, for the purposes of prototyping, the breadboard should work in my current arrangement? (see most recent pictures with breadboard and red links from pololu board into breadboard)
I was thinking about wiring up a #22 extension from the current red (V+) from the battery pack as it is just using the stock flimsy red wire at the moment. I am wondering if I am losing power because of this.
And back to dead pololu controller. Only thing that changed was the additional red bridge wires from pololu controller into breadboard and shifting of wire leads down from matching bridge on breadboard.
I am trying to power the arduino using usb cable into my laptop jack straight (bypass the usb hub). To troubleshoot I have also been switching to a single 9v battery plugged by Rover kit supplied wire into arduino 9v adapter.
I will tinker around with the connections and try to determine where the fault is, will share my results when I get somewhere on this. Will also try some different code for helping troubleshoot as suggested.
Btw, I knew that bread boards had connections in a row of 5. Thanks to the tutorial on this site!
What I didnt know is that with the #22 wires pictured earlier (red and orange small wires going from motor controller into breadboard needed to be on break away headers).
Luckily I figured that out after banging my head against my computer for a few nights.
If your multimeter can measure resistance or continuity, you could test your connections, and move them around a bit to see if they provide a solid continuity.
It definitely sounds like you have loose connections.
You can test the signals that are constant with a multimeter. However the motor signals and the communication signals change very rapidly and they would not show up very well in a multimeter.
If you need to test your motors outputs, you can make the controller turn the motors on at full speed for an indefinite amount of time, this would create a signal that you can measure with your multimeter to be close to the battery voltage.
Anotehr posibility is that the logic voltage is not high enough for teh arduino. Howe are you powering it?
We see that you solved may of your problems. Sorry we could not help you during the weekend and thank you for sharing the solutions.
As for the wiring on the last picture, it could be OK if:
]The back wires pairs are connected to the motors/:m] ]The green wire is connected to a digital pin/:m] ]The yellow wire is connected to pin 1 (TX)/:m] ]The orange wire is connected to 5V/:m] ]The black wire with a longer stripped lead to GND/:m] ]The black wire completely on the left to the V+ on the batteries./:m]
Your reliability issues do not seem to come form that particularly section of wiring (which looks nice and secure.
It is possible that you have a loose connection somewhere or perhaps the problem is in your code.
You might want to try using “Serial.write(buf, len)” instead of your sending loop. or adding some waiting time after sending each byte to make sure it went out properly.
[code]int motor_reset = 2; //motor reset pin connected to digital pin 2
void setup()
{
pinMode(motor_reset, OUTPUT); //sets pin as output
//digitalWrite(motor_reset, LOW); //do not activate motor driver
Serial.begin(9600); //communication at 9600 baud
// reset motor controller
digitalWrite(motor_reset, LOW);
delay(50);
digitalWrite(motor_reset, HIGH);
delay(50); // reset delay
}
void loop()
{
motorcontrol(); // subroutine motor control
}
//subroutine motor control
void motorcontrol()
{
//left motor
unsigned char buff1[6];
//right motor
unsigned char buff2[6];
buff1[0]=0x80; //start byte specific to Pololu motor controller
buff1[1]=0x00; //Device type byte specific to Pololu controller
buff1[2]=0x01; //Motor number and direction byte; motor one =00,01
buff1[3]=0x7F; //Motor speed “0 to 128” (ex 100 is 64 in hex)
buff2[0]=0x80; //start byte - do not change
buff2[1]=0x00; //Device type byte
buff2[2]=0x03; //Motor number and direction byte; motor two=02,03
buff2[3]=0x7F; //Motor speed “0 to 128” (ex 100 is 64 in hex)
I switched up the wiring again to using the breadboard. Now the pololu microcontroller is dead again.
Here is what it looks like:
Any ideas why the robot is dead in this setup. Everything is the same except I am using breadboard to multiplex V- ground and V+ hot on the board on top.
On the board on bottom I modified to use small red connection wires into breadboard from pololu and interface wires out of this breadboard.
Can I test the wires going onto the pololu controller from the breadboard using a multimeter? If so, what should the individual wires read out and what should I test for?