I am currently in a robotics class at my university and we are using the GoPiGo3 with Raspbian for Robots as our OS, a RaspberryPi3, and we are using the GoPiGo3 Golang packages to write programs for our robot. My current issue is when using the the methods SetMotorPosition and getMotorEncoder, the right motor seems to be either rotating faster than the left one or starts moving before the left one so it slowly veers left as it moves forward until eventually the left one catches up with the right motor and straightens out. Is this an issue with the hardware or is it an issue with the methods?
This is my function that I am using, I am new to Golang so if my coding skills look weak its because they definitely are.
This is my output, I printed out the encoder position of the left and right motor so it reads left position on top and right position directly below it.
In my test I am only having the GoPiGo3 drive six feet and then stop.
Hi @Sousa8657 and welcome to the forum.
it’s possible this is actually a hardware issue. At the back of the motors, you will find a spinning disk (well it’s spinning when the robot moves) and next to the spinning disk are two small sensors. Those sensors have to be within a couple of millimeters from the spinning disk and the top of the sensors should line up with the top surface of the disk.
Is that the case?
Can you send me photos of both motors, showing that disk and its sensors?
I can’t speak for the original poster, but I can speak from experience using Charlie’s build as an example.
When I first assembled my 'bot, the hall-effect sensors were not even close to being in the same position. One was about 3-5mm away from the magnetic disk, the other was over a centimeter away.
I carefully adjusted both to about 1mm away, maybe even less, as I adjusted them to be as close as possible without touching the spinning wheel.
This begs the Musical Question:
What should the spacing be?
It suggests another question:
Can you add a step to the assembly instructions to check the sensor position and adjust as needed?
Thanks and a HUGE SHOUT-OUT to you and everyone else there who makes this 'bot great!
I am not home for the weekend but I had my father take photos of the motors, I hope you’re able to see what you are looking for. If not I will retake the photos on Sunday when I get back. Is there any way that I can push the sensors closer to the disk or should I be cautious with touching them? Based on the photo, the motor on the right is the one giving issues.
Looking at the pictures, the sensor on the right is clearly much further away than the one on the left. You can adjust them of you are careful.
Take the sensors and (carefully!) Bend them so that they are flat with respect to the sensor’s magnetic wheel and as close as possible without touching.
@cleoqc, I’d appreciate your opinion on this. Are my instructions correct, or does the hall sensor need to be positioned differently?
A few things to check:
- Spacers on the axle behind the wheel hubs?
- Is there a little space between the spacer and the motor body (not pushed hard against the motor)?
- When you ramp up each motor to find the minimum power to start turning the wheels, are the minimum values greatly, greatly different?
- When you gently, gently turn each wheel, is the force required to turn each relatively equal?
- As mentioned, ensure the encoder sensors are close but not touching the round magnets.
If you find that the internal gear friction of one of the motors is very high, I suggest that you discuss the issue with email@example.com
Contact firstname.lastname@example.org and request a motor replacement. Add the link to this thread to speed things up.