jonni
New Member
Posts: 1
|
Post by jonni on Dec 26, 2014 9:51:21 GMT -8
Hi!
I assembled my pi-bot yesterday, and maybe did something weird with the gear box. The bot can't go straight, but turns counterclockwise much of the time. It seems that most turning happens when the bot is moving at slow speed. Reversing seems to turn the bot more than going forward. The MotorTest program will turn the bot 90 degrees in 2 - 3 loops (sometimes a bit more). I have dis- and reassembled the gearbox once, to no effect.
I think it's the gearbox, as switching the engines (and their wiring) didn't change it at all.
Does anyone else have a similar experience, or some suggestion for fixing this?
|
|
jasea
Junior Member
Posts: 53
|
Post by jasea on Dec 27, 2014 3:51:47 GMT -8
Hi jonni, welcome to the forum. A few questions for you. How quickly does the Pi-Bot turn? My Pi-Bot naturally turns slowly to the left, it goes off course by about two feet over a distance of say twelve feet. If your is similar then the problem can be corrected by either speeding up the left wheel or slowing down the right wheel in your program. Without any power on, can you turn the wheels and hence the motors through the gearboxes? If so, does the amount of effort that you put in seem to be the same on both wheels? There should be about five degrees of gearbox backlash on each wheel where very little effort is required to turn the wheel and you should see the gearwheels turn a bit Here is a picture of my gearbox for you to compare. Regards John
|
|
jasea
Junior Member
Posts: 53
|
Post by jasea on Dec 27, 2014 6:00:45 GMT -8
Hi again, I don't know where you are, but I live in middle of France and possible a good few hours ahead of you, and so by the time you read these posts I could be tucked up in bed!. Can you check that the tyres are not running against the chassis, I would think that there should be about 1/8 inch gap between the tyres and the chassis. Assuming that you have not found anything wrong so far you could try swapping the motor connections at the H-bridge motor controller. If the problem is with your gearbox then the Pi-Bot should now turn clockwise instead of counterclockwise. Also you could try changing the speed that the motors run at.
You say that you are running the motor test program, I don't know the level of your programming skills and so I apologise if you think that the following is too simplistic. At line 46 and 47 you will see:
int speed1; int speed2;
These are definitions of the intergers that are set to the Pulse Width Modulation values in lines 52 and 53
speed1 = 150; speed2 = 150;
As the comments above these instruction say, these speed values can be set from 0 to 255, 0 being stop and 255 being flat out. In practice if the values are below 70 then the motors do not have enough power to move the Pi-Bot, and 255 is possible too fast for problem solving, so I would stick to a range of 100 to 200 whilst we sort this problem out.
Try increasing the speed values by 10 at a time and see if that helps, as increasing the power may help overcome any resistance in the drive train.
At line 57 you will see the following instructions.
analogWrite(In4, 0); analogWrite(In3, speed1); analogWrite(In2, 0); analogWrite(In1, speed2); delay(2000);
The four analogWrite instructions tell the motor controller to go forwards on both motors at what ever speed has been set in the two speed variables. The delay(2000) instruction say do nothing for 2 seconds after which the next instruction is carried out, in this case the stop sequence.
Try increasing the the delay value say to 5000, so that the Pi-Bot continues in the forward direction for longer to see if it runs truer when the motors are running for longer.
Let us all know what you find out.
Regards
John
|
|
|
Post by __init__ on Mar 15, 2015 6:48:15 GMT -8
Hi,
I'm having the same problem with my Pi-Bot. I've heard that motors are different most of the time, so that's why they may be uneven. I've tried increasing the speed1 and speed2 variables, and have come to the right ratio, but at the end of each run, it turns a little bit for some reason. :/
Why does this happen?
Also, which speed variable is for the left motor and which is for the right? :/
Thanks.
|
|
|
Post by __init__ on Mar 15, 2015 8:48:48 GMT -8
Hi, I'm having the same problem with my Pi-Bot. I've heard that motors are different most of the time, so that's why they may be uneven. I've tried increasing the speed1 and speed2 variables, and have come to the right ratio, but at the end of each run, it turns a little bit for some reason. :/ Why does this happen? Also, which speed variable is for the left motor and which is for the right? :/ Thanks. Also I've tried lengthening the run, it still turns a little bit only at the very end.
|
|
jasea
Junior Member
Posts: 53
|
Post by jasea on Mar 17, 2015 1:35:25 GMT -8
Hi, You do not say which program you are running, or if you have made any changes to the program apart from changing the speed1 & speed2 variables. With regard to your problem then I can only suggest that you have some extra friction in the drive train of the track which is on the side that the Pi-Bot turns to, as when the program stops the Pi-Bot it is almost instantaneous for both motors and so it should stop straight. Your second question of which variable is used for left and right motors depends upon how the Pi-Bot has been wired up. Just try reducing one of the variables by 10 and see which way the Pi-Bot turns, then you will know that the variable that you changed is for the motor that is on the side to which the turns to.
Regards
John
|
|