This topic has 7 replies, 2 voices, and was last updated 8 years, 10 months ago by SuperDroid.

  • Author
    Posts
  • #2914
     Dan
    Participant

    Hello-

    I recently purchased a few quadrature encoder buffers from your website. I am connecting them to the ig52 motors that I also got from you guys. I believe that I have it hooked up correctly, but the data I getting from the encoder doesn’t make sense.

    I am using an arduino mega for my mcu. My setup is as follows.

    Front Right (FR) motor encoder is connected to Encoder buffer. Front Left (FL) motor encoder is not hooked up yet.
    The encoder buffer is hooked to the 5v and gnd from the mcu.
    Since I am using a arduino mega, the MISO, MOSI and SCK are hooked to pins 50, 51 and 52 respectively.

    I used the code from your website to initialize the encoder (and set it to quadrature mode). I also use the code I got from your website to read the SPI data.

      // Read encoder
      digitalWrite(encoder,LOW);              // Begin SPI conversation
      SPI.transfer(0x60);                     // Request count
      count_1 = SPI.transfer(0x00);           // Read highest order byte
      count_2 = SPI.transfer(0x00);           
      count_3 = SPI.transfer(0x00);           
      count_4 = SPI.transfer(0x00);           // Read lowest order byte
      digitalWrite(encoder,HIGH);             // Terminate SPI conversation 
      
      // Combine (4) 8-bit parts into (1) 32-bit value
      count_value = (count_1 << 8) + count_2;
      count_value = (count_value << 8) + count_3;
      count_value = (count_value << 8) + count_4;
    

    When I read the data from the buffer, I get a count_value of -1. count_1, count_2, count_3, count_4 all return values of 255.

    I get this same value when I connect to both chips on the buffer. Again, only one of these chips actually has an encoder hooked up to it.

    Any thoughts on what I am doing wrong? Thanks in advance, Dan

    #2916
     SuperDroid
    Keymaster

    Are the pull up solder jumpers being used? You need pull resistors for hall effect encoders. If using optical encoders, you do not need them.

    From the item description: “There are a series of solder jumpers next to the encoder headers. These solder jumpers provide 1k pull-ups to the LFLAG, A channel, and B channel inputs. For use with our hall-effect motors the solder pads need to be connected. The output of the encoder is grounded as it senses the rotating magnet. These 1k pull-ups are required to pull the signal high so that the encoder pulses return to 5V after the magnet passes the sensor.”

    #2917
     Dan
    Participant

    I am using the board how it came from superdroidrobots. I tested with a multimeter and thought that the solder jumpers came pre-soldered. Is this correct? Also, I have the motor encoders hooked up with the following pull up board.

    http://www.superdroidrobots.com/shop/item.aspx/ig32-ig42-and-ig52-gear-motor-encoder-pull-up-board/1512/

    I do not have the I (index) pin on the encoder buffer hooked to anything, but what I have read from the documentation, setting the MDR0 to 0x03 makes the index pin unused. Is this correct?

    Thanks
    Dan

    #2919
     SuperDroid
    Keymaster

    The solder jumpers have to be configured to suit your encoders. You don’t need to using the index pin. The jumpers need to be checked and should be bridged of using hall effect encoders. They should be removed for optical encoders.

    #2920
     Dan
    Participant

    Do the jumper need to be bridged even when using the encoder pull up board? This would put 2k of resistance between the a & b sensors and the encoder buffer chip.

    #2921
     SuperDroid
    Keymaster

    if you are using the pull up board, you should open the jumpers. You do not need the pull up boards with the buffer board, but if you already have them wired in, you can just open the jumpers. You don’t want both on, it will pull it up too hard and never go low…

    #2948
     Dan
    Participant

    Thank you for your help. I have the Arduino mega reading the SPI signal from the encoder buffers. For some reason, I was having a problem with my USB host shield that was breaking the SPI signal. When I switched the USB host shield to a different one, I started getting a valid connection.

    I am having a different problem now. One of the LS7366R chips does seem to run in 4x quadrature mode. I set the MDR0 to 0x03 and then read that register just to make sure. The motor on this pin always returns an encoder reading that is half of the other motors even though the motors are running at the same speed. Again, I am using the IG52 motors with hall effect sensors. I checked the pull up resistors on the board and I get an impedance reading across the 5v pin to the A, B and LFLAG pins of around 880-940 ohms on both chips. The issue does not seem to be with the pullup resistors, but with the LS7366R chip. I also tried swapping the SS pins to see if it was the motor, but whatever motor is connected to that chip gets a 2x reading.

    Any thoughts? Thanks
    Dan

    #2950
     SuperDroid
    Keymaster

    Hi. Send it back with a copy of the order and a note. Put your RMA[order number]-1 on the package. We will take a look at it and repair or replace it if the board has a manufacturing issue. If the board was damaged by a short, power surge, static, etc. it will not be covered by warranty.

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.

Login Register

©2024 SDRobots.com | All rights reserved.

Log in with your credentials

or    

Forgot your details?

Create Account