RoboticsGeneral

"2×15A DC Motor Driver"Problem,Motors are not working while the leds on motor driver are working...

userHead sırma aykut 2018-03-12 17:35:55 37098 Views11 Replies
I have bought this two "2×15A DC Motor Driver" from DFROBOT. However, I encountered with some problems

Image
Image

https://www.dfrobot.com/product-796.html

I applied the sample code thy gave us and I checked my wiring and battery too and when I click "w-s-a-d-x" on serial monitor, the motor driver's leds are working. However, my motors are not working as visually even move forward, backward etc commands are working as the leds are indicating on the motor driver...

Do you know what might the cause of this ? thank you. I use arduino mega 2560 r3 & UNO and arduino version 1.8.5

I used these for UNO
int E1 = 5; //M1 Speed Control
int E2 = 6; //M2 Speed Control
int M1 = 4; //M1 Direction Control
int M2 = 7; //M1 Direction Control

I used these pins for Mega
int E1 = 45; //M1 Speed Control
int E2 = 46; //M2 Speed Control
int M1 = 44; //M1 Direction Control
int M2 = 3; //M1 Direction Control

This is the sample code thy gave in their website:
Code: Select all
int E1 = 5;     //M1 Speed Control
int E2 = 6;     //M2 Speed Control
int M1 = 4;     //M1 Direction Control
int M2 = 7;     //M1 Direction Control
int counter=0;

void stop(void)                    //Stop
{
  digitalWrite(E1,0); 
  digitalWrite(M1,LOW);    
  digitalWrite(E2,0);   
  digitalWrite(M2,LOW);    
}   
void advance(char a,char b)          //Move forward
{
  analogWrite (E1,a);      //PWM Speed Control
  digitalWrite(M1,HIGH);    
  analogWrite (E2,b);    
  digitalWrite(M2,HIGH);
}  
void back_off (char a,char b)          //Move backward
{
  analogWrite (E1,a);
  digitalWrite(M1,LOW);   
  analogWrite (E2,b);    
  digitalWrite(M2,LOW);
}
void turn_L (char a,char b)             //Turn Left
{
  analogWrite (E1,a);
  digitalWrite(M1,LOW);    
  analogWrite (E2,b);    
  digitalWrite(M2,HIGH);
}
void turn_R (char a,char b)             //Turn Right
{
  analogWrite (E1,a);
  digitalWrite(M1,HIGH);    
  analogWrite (E2,b);    
  digitalWrite(M2,LOW);
}
void current_sense()                  // current sense and diagnosis
{
  int val1=digitalRead(2);            
  int val2=digitalRead(3);
  if(val1==HIGH || val2==HIGH){
    counter++;
    if(counter==3){
      counter=0;
      Serial.println("Warning");
    }  
  } 
}

void setup(void) 
{ 
  int i;
  for(i=4;i<=7;i++)
    pinMode(i, OUTPUT);  
  Serial.begin(19200);      //Set Baud Rate
  Serial.println("Run keyboard control");
  digitalWrite(E1,LOW);   
  digitalWrite(E2,LOW); 
  pinMode(2,INPUT);
  pinMode(3,INPUT);
} 

void loop(void) 
{
  /*
  static unsigned long timePoint = 0;    // current sense and diagnosis,if you want to use this 
   if(millis() - timePoint > 1000){       //function,please show it & don't forget to connect the IS pins to Arduino                                             
   current_sense();
   timePoint = millis();
   }
   */
  if(Serial.available()){
    char val = Serial.read();
    if(val != -1)
    {
      switch(val)
      {
      case 'w'://Move Forward
        advance (255,255);   //move forward in max speed
        break;
      case 's'://Move Backward
        back_off (255,255);   //move back in max speed
        break;
      case 'a'://Turn Left
        turn_L (100,100);        
        break;       
      case 'd'://Turn Right
        turn_R (100,100);
        break;
      case 'z':
        Serial.println("Hello");
        break;
      case 'x':
        stop();
        break;
      }
    }
    else stop();  
  }

}
2024-09-06 07:50:32

This is truly an practical and pleasant information for all. Thanks for sharing this to us and more power <a href="http://truediamond.co.uk/">seo service UK</a>
 

userHeadPic koy.ona2604
2024-09-06 07:50:10

This is truly an practical and pleasant information for all. Thanks for sharing this to us and more power
seo service UK
 

userHeadPic koy.ona2604
2022-01-14 19:25:31 This is really awesome and informative, best part of this post is your unique concept which is different from other thought. Satta King userHeadPic sattakingone1
2022-01-14 06:50:02 I have a Latte Panda SBC, and im going to buy a 10.1" monitor from Dhttps://nox.tips/ https://xender.vip/
FRobot, but in this monitor i need a touch interface, for this size the touch is not available. can anyone suggest me where i can get the touch panel for this SBC. We can use the SBC by the way of connecting the keyboard and mouse. but in my application, i couldnt use those things, i have to access the monitor through touch. so anyone suggest me regards touch panel.
userHeadPic brysonparkerbp
2021-12-18 01:00:38 Mind blowing post you have shared for us. I specially congratulate you for this kind of post. Satta Matka userHeadPic matkaguessing
2021-12-11 07:34:29 Globesign approaches every design from an authentic consulting and teamwork in creativity perspective--- the process of creating new ideas.

GlobeSign delivers and provides arrangements & answers that go beyond the anticipated by following our proven six facet avenue. Throughout the process, we hear hard to our client's pretensions and objects and concentrate on delivering a result as opposed to a"Website".
userHeadPic jacksonmilla87
2021-10-22 00:36:23 Southern Tide Discount Code is the best way to avail discounts on SOUTHERN TIDE store shopping, there are lots of items on which you can avail the discount, amazing offers so visit the store by clicking the button and Save your Pocket now! userHeadPic emmajohan50812
2020-11-16 23:43:18 You are right saying but If you want to gives a car for rent and also creates photos for cars with discount rates then you use snapfish promo code free shipping. userHeadPic itsangelajoneshere
2018-06-02 01:17:39
sırma aykut wrote:
Mon Mar 12, 2018 9:50 am
I am using "313 RPM HD Premium Planetary Gear Motor":
sırma aykut wrote:
Mon Mar 12, 2018 9:50 am
Voltage (Nominal) 12V
Voltage Range (Recommended) 6V - 12V
Speed (No Load)* 313 rpm
Current (No Load)* 0.52A
Current (Stall)* 20A
Torque (Stall)* 416.6 oz-in (30 kgf-cm)
Gear Ratio 27:1
Gear Material brass primary, nylon secondary, steel tertiary
Gearbox Style Planetary
Motor Type DC
Motor Brush Type Graphite
Output Shaft Diameter 6mm (0.236")
Output Shaft Style D-shaft
Output Shaft Support Dual Ball Bearings
Electrical Connection Male Spade Terminal
Operating Temperature -10°C ~ +60°C
Mounting Screw Size M3 x 0.5mm
Product Weight 330g (11.64oz)
My power supply for the motor driver is 4000mAh 3 Cell & 11.1V 30C Lipo Battery
Both UNO and Mega not working? Could you attach the wiring?
userHeadPic robert.chen
2018-05-17 02:05:11 Had the same issue.Solved fro the guidance of you.Thank you userHeadPic julietmorganvoucher
2018-03-13 01:50:27 I am using "313 RPM HD Premium Planetary Gear Motor":
sırma aykut wrote:
Mon Mar 12, 2018 9:50 am
Voltage (Nominal) 12V
Voltage Range (Recommended) 6V - 12V
Speed (No Load)* 313 rpm
Current (No Load)* 0.52A
Current (Stall)* 20A
Torque (Stall)* 416.6 oz-in (30 kgf-cm)
Gear Ratio 27:1
Gear Material brass primary, nylon secondary, steel tertiary
Gearbox Style Planetary
Motor Type DC
Motor Brush Type Graphite
Output Shaft Diameter 6mm (0.236")
Output Shaft Style D-shaft
Output Shaft Support Dual Ball Bearings
Electrical Connection Male Spade Terminal
Operating Temperature -10°C ~ +60°C
Mounting Screw Size M3 x 0.5mm
Product Weight 330g (11.64oz)
My power supply for the motor driver is 4000mAh 3 Cell & 11.1V 30C Lipo Battery
userHeadPic sırma aykut