Sorry, this shoutbox does not exist.

Author Topic: Help I need information on wiring positions  (Read 2226 times)

moses58

  • Jr. Member
  • **
  • Posts: 6
  • Karma: +0/-0
  • Gender: Male
Help I need information on wiring positions
« on: January 19, 2011, 10:53:40 am »
Hi I purchased this DFRobot kit but I can find no intructions on where to plug
the motor encoder wires into the microcontrolor. Can anyone help?

DFRobot - HCR-Mobile robot platform ■Romeo Controller board (Arduino compatible)

DFRobot DC Motor Specifications

■Working voltage: 12V
■No load speed:8100RPM
■RPM :120RPM
■Diameter:30mm
■Length:42mm
■Nominal output power:17W
■No load current: 75mA
■Load current:1400mA
■Gearbox ratio:66:1
■Encoders:Optical
■Encoder Phase:AB
■Encoder Resolution:12CPR



Lauren

  • Administrator
  • Hero Member
  • *****
  • Posts: 216
  • Karma: +7/-0
    • Follow us on Twitter for coupons and product updates!
Re: Help I need information on wiring positions
« Reply #1 on: January 19, 2011, 12:10:21 pm »
Hi.
 :)

Connect the encoder according to the picture.

The sample code:

Code: [Select]
const byte encoder0pinA = 2;//A pin -> the interrupt pin 0
const byte encoder0pinB = 4;//B pin -> the digital pin 4
byte encoder0PinALast;
int duration;//the number of the pulses
boolean Direction;//the rotation direction


void setup()

  Serial.begin(57600);//Initialize the serial port
  EncoderInit();//Initialize the module
}

void loop()
{
  Serial.print("Pulse:");
  Serial.println(duration);
  duration = 0;
  delay(500);
}

void EncoderInit()
{
  Direction = true;//default -> Forward 
  pinMode(encoder0pinB,INPUT); 
  attachInterrupt(0, wheelSpeed, CHANGE);
}

void wheelSpeed()
{
  int Lstate = digitalRead(encoder0pinA);
  if((encoder0PinALast == LOW) && Lstate==HIGH)
  {
    int val = digitalRead(encoder0pinB);
    if(val == LOW && Direction)
    {
      Direction = false; //Reverse
    }
    else if(val == HIGH && !Direction)
    {
      Direction = true;  //Forward
    }
  }
  encoder0PinALast = Lstate;

  if(!Direction)  duration++;
  else  duration--;
}
« Last Edit: January 23, 2011, 11:12:58 pm by Lauren »
Follow us on TWITTER for announcements of specials and product updates! Along with interesting open source robotics news!

moses58

  • Jr. Member
  • **
  • Posts: 6
  • Karma: +0/-0
  • Gender: Male
Re: Help I need information on wiring positions
« Reply #2 on: January 20, 2011, 04:04:06 am »
Thank you for the photo and code.  I am visually impaired so the photo is a little to far away for my friend to clearly see the wire colors.  We will try to make do. Thanks

moses58

  • Jr. Member
  • **
  • Posts: 6
  • Karma: +0/-0
  • Gender: Male
Re: Help I need information on wiring positions
« Reply #3 on: January 23, 2011, 10:20:10 am »
Well it is just my luck the encorder wires are different. I have brown, grey, white and black. I can find no help on how to connect these wires to the board. All attempts to find a answer on the internet have failed. Is there anyone who has made this HCR-Mobile robot platform with sensors and microcontroller robot platform?

•Two 17w DC motors with 64:1 Gearbox 120 rpm
•Two (2 Phases) encoders with 12 PPR
•Romeo Controller board (Arduino compatible)

Thanks

Can someone send a better picture or explination?
wvogt4@juno.com

Lauren

  • Administrator
  • Hero Member
  • *****
  • Posts: 216
  • Karma: +7/-0
    • Follow us on Twitter for coupons and product updates!
Re: Help I need information on wiring positions
« Reply #4 on: January 23, 2011, 11:11:00 pm »
 :P

Connect the A pin of the encoder to the digital pin 2 of the Romeo.
Connect the B pin marked 4 to the digital pin 4 of the Romeo.

And also you can click the image to enlarge.

 ;)
Follow us on TWITTER for announcements of specials and product updates! Along with interesting open source robotics news!

Lauren

  • Administrator
  • Hero Member
  • *****
  • Posts: 216
  • Karma: +7/-0
    • Follow us on Twitter for coupons and product updates!
Re: Help I need information on wiring positions
« Reply #5 on: January 24, 2011, 06:32:02 pm »
 ;)
Follow us on TWITTER for announcements of specials and product updates! Along with interesting open source robotics news!

moses58

  • Jr. Member
  • **
  • Posts: 6
  • Karma: +0/-0
  • Gender: Male
Re: Help I need information on wiring positions
« Reply #6 on: January 26, 2011, 10:47:16 am »
Thankyou you have been a big help we got it going. Could you tell me where you got the last picture? I would like to find my answers without bothering people if possible. Diagrams like this would make all the difference.

Lauren

  • Administrator
  • Hero Member
  • *****
  • Posts: 216
  • Karma: +7/-0
    • Follow us on Twitter for coupons and product updates!
Re: Help I need information on wiring positions
« Reply #7 on: January 27, 2011, 11:32:59 am »
I draw the diagram. And I believe it will be helpful to u.

 ;D
Follow us on TWITTER for announcements of specials and product updates! Along with interesting open source robotics news!

 

SimplePortal 2.3.4 RC1 © 2008-2011, SimplePortal