Turning Accuracy
Posted: 07 Jul 2013, 18:48
Hello,
I'd like to create a "My Block" for turning accurately (pivoting in place with one motor going the reverse of the other). I've determined the number of degrees that one must use to make a 360 degree pivot in place. The problem is that I get inconsistent results.
My first attempt was to use a Move block with the slider all the way to one side. The robot will not pivot a consistent amount though (and the wheels are not slipping). Next I added [NXT-G] code to read how far each rotation sensor has rotated during a pivot and display the result on the screen. When doing this, motor B always rotates the prescribed amount (+/- 1 degree), but motor C will rotate more than the prescribed amount, sometimes significantly more (in the opposite direction of course). When the robot is not under load (when I hold it in my hand and run the program) both encoders will typically come up with the correct answer. It was my understanding that the Move block syncs motor B and C such that they will move exactly the same amount - so what is the deal?
The next thing I tried was to use separate motor blocks for motors B and C. When I started them in serial I get the same lousy results. When I start them on parallel sequence beams AND I also put a short delay after the completion of the action such that both motors have the chance to complete their rotations, then I finally get both motors to rotate the prescribed amount. The problem here is that motors B and C are no longer synced, and depending on the actual motor, one can take longer to rotate than the other and consequently, the robot will not be in the same position after the rotation.
So my question is "what is the move block actually doing?" It doesn't seem to sync the motors in this case. Is there a way using NXT-G to make a more accurate turn?
Thanks
-Doug
I'd like to create a "My Block" for turning accurately (pivoting in place with one motor going the reverse of the other). I've determined the number of degrees that one must use to make a 360 degree pivot in place. The problem is that I get inconsistent results.
My first attempt was to use a Move block with the slider all the way to one side. The robot will not pivot a consistent amount though (and the wheels are not slipping). Next I added [NXT-G] code to read how far each rotation sensor has rotated during a pivot and display the result on the screen. When doing this, motor B always rotates the prescribed amount (+/- 1 degree), but motor C will rotate more than the prescribed amount, sometimes significantly more (in the opposite direction of course). When the robot is not under load (when I hold it in my hand and run the program) both encoders will typically come up with the correct answer. It was my understanding that the Move block syncs motor B and C such that they will move exactly the same amount - so what is the deal?
The next thing I tried was to use separate motor blocks for motors B and C. When I started them in serial I get the same lousy results. When I start them on parallel sequence beams AND I also put a short delay after the completion of the action such that both motors have the chance to complete their rotations, then I finally get both motors to rotate the prescribed amount. The problem here is that motors B and C are no longer synced, and depending on the actual motor, one can take longer to rotate than the other and consequently, the robot will not be in the same position after the rotation.
So my question is "what is the move block actually doing?" It doesn't seem to sync the motors in this case. Is there a way using NXT-G to make a more accurate turn?
Thanks
-Doug