Answers.Body: <p>Veering off a little bit is normal.  Can it be reduced?  Yes.  There are several possibilities to consider, one of which is the programming.  Put a pin in the hub of each wheel to serve as a marker, spin the wheels so the in the same position.  Write a program to go straight for 20 revolutions.  Hold the robot in the air, run the program, and examine the location of the pins.  The should match.  Differences can be programming issues, but more likely the position sensors in the motors.  Try switching swapping one motor and retrying the test.</p>
  
  <p>More likely, putting the robot on the ground and running the program will show the pins match, but the robot veered.  Again, several possible causes, one likely cause is the friction on one side of the robot is greater.  Changing to a caster will reduce the friction and might help.  Another possibility is that the motors are a bit wobbly and allow the axles to bend so they do not match.  This can often be helped by adding a skirt on the outside of the robot to support the axles from the outside.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-22T20:50:12.143Z
Answers.LastActivityDate: 2019-11-22T20:50:12.143Z
Answers.UserDisplayName: dfrevert
Body: <p>I've started to build a robot, but when it drives it veers off to the left even though I'm just telling it to go straight. I think I need to do something to the motors but I don't know what or how. I'm programming an NXT block.</p>
  
  <p><a href="https://i.sstatic.net/Kfkf2.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Kfkf2.jpg" alt="Overhead shot"></a>
  <a href="https://i.sstatic.net/dm3Hk.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/dm3Hk.jpg" alt="Side shot"></a></p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-03-27T12:27:52.507Z
Comments.Text: Hi Donna! Could you please tell (or even show) us more about your robot and its program? The best would be if you attached a photo of the robot and a screenshot of the program, but even a textual description would allow us to help you better.
Comments.UserDisplayName: zovits
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-03-27T13:24:40.083Z
Comments.Text: Hi Zovits!
  
  Here's the program:
  task main()
  {
  TextOut(0,LCD_LINE1, "HELLO GENIE");
  Wait(SEC_3);
  OnFwd(OUT_AB, 30);
  Wait(SEC_3);
  }
  
  But I don't know how to put the pictures in.
Comments.UserDisplayName: Donna Walters
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-03-27T14:05:09.817Z
Comments.Text: This page in the Help section describes how can one embed images: https://bricks.stackexchange.com/help/formatting
  The program seems to be correct, and if assume that (1) the two drive motors are connected to the A and B ports and (2) use the same gearing to drive (3) wheels with the same diameters (4) with no mechanical blockages or friction then the robot should indeed go straight. Can you please verify these four assumptions?
Comments.UserDisplayName: zovits
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-03-27T14:44:37.803Z
Comments.Text: Add picture to original post, as far as I know your assumptions are correct. However I did wondered if one of the motors could be running slightly slower then the other as in a text book I have says that you might have to sink them so they run identity?
Comments.UserDisplayName: Donna Walters
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-03-28T13:06:21.330Z
Comments.Text: If that is the case you could try using the `OnFwdSync` command to eliminate another possible source of the error.
Comments.UserDisplayName: zovits
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-11-04T06:14:46.527Z
Comments.Text: Seems like your motors rotate at slightly different speeds. That is very normal, as no two motors are exactly alike.
Comments.UserDisplayName: technicguy1
Tags: <nxt><programming><motor>
Title: Rearing off to the left without telling it to
UserDisplayName: Donna Walters
ThreadText: # Rearing off to the left without telling it to
  
  (Asked by: username_0 on 2019-03-27)
  
  I've started to build a robot, but when it drives it veers off to the left even though I'm just telling it to go straight. I think I need to do something to the motors but I don't know what or how. I'm programming an NXT block.
  
  [![Overhead shot](https://i.sstatic.net/Kfkf2.jpg)](https://i.sstatic.net/Kfkf2.jpg)
  [![Side shot](https://i.sstatic.net/dm3Hk.jpg)](https://i.sstatic.net/dm3Hk.jpg)
  
  **Tags:** nxt, programming, motor
  > **Comments:**
  > **username_1**: Hi Donna! Could you please tell (or even show) us more about your robot and its program? The best would be if you attached a photo of the robot and a screenshot of the program, but even a textual description would allow us to help you better.  
  > **username_0**: Hi Zovits!  Here's the program: task main() { TextOut(0,LCD_LINE1, "HELLO GENIE"); Wait(SEC_3); OnFwd(OUT_AB, 30); Wait(SEC_3); }  But I don't know how to put the pictures in.  
  > **username_1**: This page in the Help section describes how can one embed images: https://bricks.stackexchange.com/help/formatting The program seems to be correct, and if assume that (1) the two drive motors are connected to the A and B ports and (2) use the same gearing to drive (3) wheels with the same diameters (4) with no mechanical blockages or friction then the robot should indeed go straight. Can you please verify these four assumptions?  
  > **username_0**: Add picture to original post, as far as I know your assumptions are correct. However I did wondered if one of the motors could be running slightly slower then the other as in a text book I have says that you might have to sink them so they run identity?  
  > **username_1**: If that is the case you could try using the `OnFwdSync` command to eliminate another possible source of the error.  
  > **username_2**: Seems like your motors rotate at slightly different speeds. That is very normal, as no two motors are exactly alike.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_3 on 2019-11-22. Score: 1
  
  Veering off a little bit is normal. Can it be reduced? Yes. There are several possibilities to consider, one of which is the programming. Put a pin in the hub of each wheel to serve as a marker, spin the wheels so the in the same position. Write a program to go straight for 20 revolutions. Hold the robot in the air, run the program, and examine the location of the pins. The should match. Differences can be programming issues, but more likely the position sensors in the motors. Try switching swapping one motor and retrying the test.
  
  More likely, putting the robot on the ground and running the program will show the pins match, but the robot veered. Again, several possible causes, one likely cause is the friction on one side of the robot is greater. Changing to a caster will reduce the friction and might help. Another possibility is that the motors are a bit wobbly and allow the axles to bend so they do not match. This can often be helped by adding a skirt on the outside of the robot to support the axles from the outside.
  
  
  ---
  
  