Loading...
Pages: 1 ... 3 4 [5]   Go Down
Author Topic: Dagu Rover 5 chassis robot demo  (Read 14933 times)
0 Members and 1 Guest are viewing this topic.
Melbourne
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Melbourne
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
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.
Logged

Pages: 1 ... 3 4 [5]   Go Up
Print
 
Jump to: