Problem with getCurrentPosition from MeEncoderMotor class


#1

Hello,

I use a MeEncoder motor module, and have a big problem, sometime the getCurrentPosition method returns 0.
How I can do a reliable work with this bug !?
I searched on this forum, and found 2 years old message with same problem exposed !!!
2 year later, there is no improvement !? That’s incredible !

I looked how the underlying hardware to see how it works, and I seen the communication between the Auriga board and the MeEncoder motor module is based on I2C. Any chance there is an hardware problem with I2C bus ?


#2

Hi nlc,

Do you use the me encoder motor driver with Auriga board.
Actually, the Auriga board has onboard encoder driver, you may use it directly with the encoder motor. You can find the example arduino programs in makeblock library.


If you want to use the me encoder motor driver, you may upgrade firmware for it refer to this document Me encoder motor driver.zip (1.0 MB) and use the example program Me_EncoderDriver_New.


#3

Hi tec_support, thank you for your answer. Yes I use Auriga board, I must finish a project started by another person, and I used the hardware as is, but if the Auriga board already have 2 integrated on board motor encoder, I will use it, that’s really better, for sure !


#4

I tried the example Me_On_Board_encoder/Me_Auriga_encoder_pid_pos, but it doesn’t work, motor doesn’t move when I send the 0 to 6 ascii command through serial port.

  • My command are well received, I added a debug printf to confirm
  • The Encoder pulses are well received, I added a debug printf in the ISR fonctions, it works when I turn the motor by hand
  • But motor doesn’t move

But something happen on the board, with positive move, 2 reds leds are ON, and with negative move, the 2 leds are blue. And I see dimming, thus the PWM seem’s OK.

Also, the 12V supply is well connected and activated with the push button.

Any idea what can happen ?
Regards


#5

Sorry, I found the problem, measured the output voltage on the M1 output of the Auriga board, and it was OK. But no voltage on the other side, on the motor. It was a broken wire between them. No luck it broken exactly during my transition from MeEncoderMotor to MeOnBoardEncoder !!!

Regards


#6