Dagu Rover 5 chassis robot demo

Yep, the type you put in smoke alarms. They're no good?

Also, I seem to remember reading somewhere that you can't disconnect the power supply to the Arduino board whilst the power supply to the motor board is still connected. Will this damage my Arduino board?

Those smoke-alarm batteries certainly won't driver the motors. They might power the Arduino for a while.

I don't see any harm in turning the Arduino power off even if the motor board is on.

Yeah, I was just going to use (for now) a 9V smoke alarm battery to power the board and 6 AA batteries for the motor.
So I was thinking to engage the Arduino board to cycle through the program I write I'd just slap a swith between the Arduino power supply and the Arduino board. So I would have a flip switch or something similar. Do you think this would suffice?

Yes, that is what I have. Not even a switch, I just plug the battery in.

Thanks Nick, I think that covers all of my concerns for this project (for now!). You've been a massive help!
Doubtless I will have more questions arising in the future though. Cheers

Hi Nick,
I just wanted to run some things past you and get your opinion.
So for the power supply of our rover (the motor shield and the arduino uno board) I'm using a 12 V 1300 mAh Sla battery which is run through a voltage regulator and so the output is a steady 9 V. This is then wired into both the Arduino and into the motor shield.

We are only running the two motor dagu 5 rover and hence we have two channels on the 4 channel motor shield unoccupied. We need to run a third dc motor to raise an lower a bridge but the stall current for the dc motor we have is 6.18 A (this is the motor http://www.mabuchi-motor.co.jp/cgi-bin/catalog/e_catalog.cgi?CAT_ID=fk_260sa). The manual for the shield says that a dc motor with stall current greater than 4.5 A should not be used, else we could damage the shield. My question is can we use this motor with the shield ensuring that we read the current pin for that channel and turning the dc motor off when the current exceeds, say 4 A?
Or can we somehow just hook it up through the arduino chip, bypassing the shield? Or do we need to get a motor with a lower stall current?

Thanks for your help.

Hey nick, i bought the same motor drive shield but im running a 4WD robot, im receiving a command throught a TCP server to move the robot in any direction, i wrote this code and want your opinion (Mind my low programing skills), this code is a test code.

#define motorpin0 2 // Direction ch1 front right motor
#define motorpin1 3 // Direction ch2 front left motor
#define motorpin2 4 // Direction ch3 back right motor
#define motorpin3 7 // Direction ch4 back left motor
#define speedpin0 5 //Speed Ch1
#define speedpin1 6 //Speed Ch2
#define speedpin2 9 //Speed Ch3
#define speedpin3 10 //Speed Ch4
int count=0;

void setup() {
//the motor control wires are outputs
pinMode (motorpin0, OUTPUT);
pinMode(motorpin1, OUTPUT);
pinMode(motorpin2, OUTPUT);
pinMode(motorpin3, OUTPUT);
//PWM Pins are outputs
pinMode(speedpin0, OUTPUT);
pinMode(speedpin1, OUTPUT);
pinMode(speedpin2, OUTPUT);
pinMode(speedpin3, OUTPUT);

}

void loop() {
  
    analogWrite(speedpin0,255);
    analogWrite(speedpin1,255);
    analogWrite(speedpin2,255);
    analogWrite(speedpin3,255);
    
  switch (count)
  {
    case 0: //forward
    digitalWrite(motorpin0,1);
    digitalWrite(motorpin1,1);
    digitalWrite(motorpin2,1);
    digitalWrite(motorpin3,1);
    delay(10000);
    count++;
    break;
    
     case 1: //Turn right
    
    analogWrite(speedpin0,50);
    analogWrite(speedpin2,50);
    
    digitalWrite(motorpin0,1);
    digitalWrite(motorpin1,1);
    digitalWrite(motorpin2,1);
    digitalWrite(motorpin3,1);
    delay(1200);
    count++;
    break;
    
    case 2: //backward
    
    digitalWrite(motorpin0,0);
    digitalWrite(motorpin1,0);
    digitalWrite(motorpin2,0);
    digitalWrite(motorpin3,0);
    delay (5000);
    count++;
    break;
    
   
    case 3: //Turn left
    
    analogWrite(speedpin1,50);
    analogWrite(speedpin3,50);
    
    digitalWrite(motorpin0,1);
    digitalWrite(motorpin1,1);
    digitalWrite(motorpin2,1);
    digitalWrite(motorpin3,1);
    delay(1200);
    count++;
    break;
}
}

Ill replace the count with the incoming command to move the vehicle as requested, im not using any encoders, also to rotate the vehicle i used the PWM, by reducing the cycle from 255 to 50 on right motoros to move it right, vice versa for the left.

hi everybody im a newbie can any one help me with a sketch to control this with a Futaba 7cap transmitter ..
what i want it to do is move with the x and y axis of the right stick on the controller ...
any and all help will be great... thanks

ollie_d:
We are only running the two motor dagu 5 rover and hence we have two channels on the 4 channel motor shield unoccupied. We need to run a third dc motor to raise an lower a bridge but the stall current for the dc motor we have is 6.18 A (this is the motor http://www.mabuchi-motor.co.jp/cgi-bin/catalog/e_catalog.cgi?CAT_ID=fk_260sa). The manual for the shield says that a dc motor with stall current greater than 4.5 A should not be used, else we could damage the shield. My question is can we use this motor with the shield ensuring that we read the current pin for that channel and turning the dc motor off when the current exceeds, say 4 A?
Or can we somehow just hook it up through the arduino chip, bypassing the shield? Or do we need to get a motor with a lower stall current?

I know this was addressed to nick, but I also have the Dagu 4 motor controller and rover (4 motor version). As long as you code it correctly and wire it to check the current on that specific motor/channel, you can absolutely have it stop when it reaches a specific amperage.
You could probably even put in a 4amp fuse on the motor if you weren't sure of your code. A failsafe to protect your hardware. But it is pretty straight forward and easily done with the the 4 motor controller, so that might be overkill. Just write it to operate that specific motor while the current is less than 4amps (while loop) .
I do something similar with the wheels. Stop the motors and display a message on the screen.

Greetings.
I've been working on modelling and control of this platform for a while now and I have a question to ask if it is possible. The encder pulses seem to be quite long or slow to be able to get a good PID control from them. Has anyone tride this? have you been successful? can you share with me the method you used for speed measurment? I'll be more than thankful for any answer.
Cheers.

moemzn:
Hey nick, i bought the same motor drive shield but im running a 4WD robot, im receiving a command throught a TCP server to move the robot in any direction, i wrote this code and want your opinion (Mind my low programing skills), this code is a test code.

#define motorpin0 2 // Direction ch1 front right motor

#define motorpin1 3 // Direction ch2 front left motor
#define motorpin2 4 // Direction ch3 back right motor
#define motorpin3 7 // Direction ch4 back left motor
#define speedpin0 5 //Speed Ch1
#define speedpin1 6 //Speed Ch2
#define speedpin2 9 //Speed Ch3
#define speedpin3 10 //Speed Ch4
int count=0;

void setup() {
//the motor control wires are outputs
pinMode (motorpin0, OUTPUT);
pinMode(motorpin1, OUTPUT);
pinMode(motorpin2, OUTPUT);
pinMode(motorpin3, OUTPUT);
//PWM Pins are outputs
pinMode(speedpin0, OUTPUT);
pinMode(speedpin1, OUTPUT);
pinMode(speedpin2, OUTPUT);
pinMode(speedpin3, OUTPUT);

}

void loop() {
 
    analogWrite(speedpin0,255);
    analogWrite(speedpin1,255);
    analogWrite(speedpin2,255);
    analogWrite(speedpin3,255);
   
  switch (count)
  {
    case 0: //forward
    digitalWrite(motorpin0,1);
    digitalWrite(motorpin1,1);
    digitalWrite(motorpin2,1);
    digitalWrite(motorpin3,1);
    delay(10000);
    count++;
    break;
   
     case 1: //Turn right
   
    analogWrite(speedpin0,50);
    analogWrite(speedpin2,50);
   
    digitalWrite(motorpin0,1);
    digitalWrite(motorpin1,1);
    digitalWrite(motorpin2,1);
    digitalWrite(motorpin3,1);
    delay(1200);
    count++;
    break;
   
    case 2: //backward
   
    digitalWrite(motorpin0,0);
    digitalWrite(motorpin1,0);
    digitalWrite(motorpin2,0);
    digitalWrite(motorpin3,0);
    delay (5000);
    count++;
    break;
   
   
    case 3: //Turn left
   
    analogWrite(speedpin1,50);
    analogWrite(speedpin3,50);
   
    digitalWrite(motorpin0,1);
    digitalWrite(motorpin1,1);
    digitalWrite(motorpin2,1);
    digitalWrite(motorpin3,1);
    delay(1200);
    count++;
    break;
}
}



Ill replace the count with the incoming command to move the vehicle as requested, im not using any encoders, also to rotate the vehicle i used the PWM, by reducing the cycle from 255 to 50 on right motoros to move it right, vice versa for the left.

I Like your idea of how to handle the direction of the rover, I am doing the same , but I need to find out how I can use my joystick ( diy remote) as a double use I want to control the speed of my rover by the amount you push on the joystick, so when you press it forward 1mm it gives you very slow speed , but full and it gives you high speed but at the same time it needs to take direction into account.

and other question I have is how would I handle it when n joystick is held between 12 o clock and 9 oclock . what code would run ?

Getting one of these for christmas, with a rangefinder and an IR sensor. Along with the pan and tilt sensor mount it should be a nice little rover. I intend on getting some xbees and writing a .NET app to control it from my laptop.

vitoovalle:
Greetings.
I've been working on modelling and control of this platform for a while now and I have a question to ask if it is possible. The encder pulses seem to be quite long or slow to be able to get a good PID control from them. Has anyone tride this? have you been successful? can you share with me the method you used for speed measurment? I'll be more than thankful for any answer.
Cheers.

I've finally hooked up the encoders on my Rover 5 and wrote some code for them: Rover 5: encoder speed control - Bajdi electronics Just trying to make all 4 motors rotate at the same speed. It works but maybe a PID control would be better?

Hello,
I recently wired up my Arduino/Rover5 system and written a short tutorial:

I implemented PID controller for the position of the robot both using the encoders and an ultrasonic sensor and
it works pretty ok.
I did not try to implement velocity control, but my feeling is that the encoders are sufficiently accurate for that.
Keep me updated!

Thanks Marco for sharing!

Thanks for posting. The lid was a good idea, I didn't think of that. :slight_smile:

[quote author=Nick Gammon link=topic=82618.msg1516826#msg1516826 date=1387742692]
Thanks for posting. The lid was a good idea, I didn't think of that. :slight_smile:
[/quote]That sure does tidy things up a little. There's an awful lot of stuff and not much room at all.

I am using the same motor driver as your are, but I am a bit confused on what pins I should use on the driver. I am using a pololu motor and the link is listed below. I am assuming that I need to use the pins on the right side of the board, or am I worng?

Dagu is now selling a new kit that fits on top of the Rover 5 chassis: the service droid. I got an early version and just started playing with it. At the moment it's remote controlled by another Arduino through nRF24L01 modules. But I will add a raspberry pi and camera and try to do some autonomous stuff.