Answers.Body: <p>After looking around a bit in the NXT IO palette in LabVIEW, I found a few functions which will sync the motors while driving the robot. The "drive distance" and "steering on" VIs will both sync the motors appropriately to make the robot drive straight.</p>
  
  <p><img src="https://i.sstatic.net/pni99.png" alt="functions palette"></p>
  
  <p>The "motor on" and "motor reverse" blocks, which are the default options if you don't go down into the complete listing, do not sync the motors. As such, in order for the motors to work together, one should use either the "steering on" or "drive distance" VIs.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2012-01-26T21:07:26.520Z
Answers.LastActivityDate: 2012-01-26T21:07:26.520Z
Answers.UserDisplayName: nhinkle
Answers.Body: <p>You can't calibrate the motors, neither mechanically or in software. There is however several methods in the software to account for this.</p>
  
  <p>The standard NXT firmware contains a synchronization mode which attempt to keep the two motors aligned. In NXC you can do this by using the function <a href="http://bricxcc.sourceforge.net/nbc/nxcdoc/nxcapi/group___output_module_functions_ga470e2dac6606677d0582cb14c1d31776.html#ga470e2dac6606677d0582cb14c1d31776">OnFwdSync</a> like this:
  OnFwdSync( OUT_AC, 75, 0 );
  First parameter is the motors to sync, the second is the power and the third defines the difference in speed between the motors (used for the tribot).</p>
  
  <p>This article tells how to do the same in RoboLab: <a href="http://www.legoengineering.com/knowledgemanager/questions/257/How+does+NXT+motor+synchronizing+work+in+ROBOLAB?">How does NXT motor synchronizing work in ROBOLAB?</a></p>
  
  <p>In NXT-G I think synchronization is on per default in the move block, correct me if I'm wrong.</p>
  
  <p>I don't know how to do this in LabView. However I have heard there is some blocks to do this in the "NXT I/O»NXT Native I/O»Output" palette, try looking there.
  <hr>
  You can make your own controller by looking at the rotation value. Calculate the difference and set the speed like this:</p>
  
  <pre><code>Motor A = power + weight * difference
  Motor B = power - weight * difference
  </code></pre>
  
  <p>The weight is how much the difference should affect the motor speed, you will need to experiment a bit to find a good value here. You might also want to take the 100% limit in account. If the power for one motor goes over 100%, do this:</p>
  
  <pre><code>if( Motor A &gt; 100 )
     Motor B = Motor B - ( Motor A - 100 )
  
  if( Motor B &gt; 100 )
     Motor A = Motor A - ( Motor B - 100 )
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2012-01-21T21:20:30.173Z
Answers.Text: I won't be at work again until Tuesday, but when I am, I'll look and see if there are any functions that seem to do this properly in LabVIEW. If not, I may just have to write my own as you suggested. Thanks for the help!
Answers.UserDisplayName: nhinkle
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2012-01-21T20:03:24.450Z
Answers.LastActivityDate: 2012-01-21T20:14:04.260Z
Answers.LastEditDate: 2012-01-21T20:14:04.260Z
Answers.UserDisplayName: Sebastian Wahl
Answers.Body: <p>The difference in speed can't be avoided. Even if the motors themselves were carefully paired, differences of friction on the axles or weight unbalance of the robot would result in speed mismatch. I am not used to LabVIEW, but the NXT firmware has a way to synchronize two motors, this functionnality should be available in LabVIEW.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2012-01-20T10:50:45.213Z
Answers.LastActivityDate: 2012-01-20T10:50:45.213Z
Answers.UserDisplayName: Philo
Answers.Body: <p>Here is a simple method to help you match up your motors as well as possible:
  <a href="http://www.techbrick.com/Lego/TechBrick/TechTips/NXTCalibration/" rel="nofollow">http://www.techbrick.com/Lego/TechBrick/TechTips/NXTCalibration/</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2012-01-29T04:38:32.860Z
Answers.Text: Thanks, I saw that when I was researching this. The class I'm working for has already started using their motors, so to do this they'd all have to disassemble their robots, which it's too late to do. I'm going to suggest it to the instructor for next year's class though.
Answers.UserDisplayName: nhinkle
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2012-01-29T03:14:49.957Z
Answers.LastActivityDate: 2012-01-29T03:14:49.957Z
Answers.UserDisplayName: Clinton Blackmore
Body: <p>The motors included with the NXT are not all created equal - when given the same input power level, they do not always go the same distance or turn at the same rate. </p>
  
  <p>I measured this by creating a small program to turn two motors at the same speed, and measure their rotation. The results showed differences of over 100 degrees within less than a minute of driving.</p>
  
  <p><a href="https://i.sstatic.net/ORolt.png" rel="noreferrer"><img src="https://i.sstatic.net/ORolt.png" alt=""></a></p>
  
  <p>Is there any way to either mechanically calibrate the motors, or easily account in the program for the difference in their powers once it has been determined? Given that the NXT can detect how far each motor has rotated, is there any way to have it automatically adjust the speed of one of the motors when it detects that it's "falling behind"? (Note that I'm using LabVIEW 2011 for programming this, but I would accept an answer that is just a code concept, if it could potentially be implemented in LabVIEW.)</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2012-01-20T18:27:38.733Z
Comments.Text: how old are your motors? I have found there is a 'burn-in' period where the more you use them the closer two motors resemble each other.
Comments.UserDisplayName: Christian Chapman
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2012-01-20T21:43:13.780Z
Comments.Text: @enthdegree the motors are at least 3 years old. I'm working on a project for a university class that teaches basic programming, and the NXT platform is part of the class. I'm not sure how old the specific motors I'm using are, but they've been using the NXT platform for a while now.
Comments.UserDisplayName: nhinkle
Tags: <nxt><programming><labview>
Title: How to calibrate NXT motors to travel the same distance?
UserDisplayName: nhinkle
ThreadText: # How to calibrate NXT motors to travel the same distance?
  
  (Asked by: username_0 on 2012-01-20)
  
  The motors included with the NXT are not all created equal - when given the same input power level, they do not always go the same distance or turn at the same rate.
  
  I measured this by creating a small program to turn two motors at the same speed, and measure their rotation. The results showed differences of over 100 degrees within less than a minute of driving.
  
  [![](https://i.sstatic.net/ORolt.png)](https://i.sstatic.net/ORolt.png)
  
  Is there any way to either mechanically calibrate the motors, or easily account in the program for the difference in their powers once it has been determined? Given that the NXT can detect how far each motor has rotated, is there any way to have it automatically adjust the speed of one of the motors when it detects that it's "falling behind"? (Note that I'm using LabVIEW 2011 for programming this, but I would accept an answer that is just a code concept, if it could potentially be implemented in LabVIEW.)
  
  **Tags:** nxt, programming, labview
  
  > **Comments:**
  > **username_1**: how old are your motors? I have found there is a 'burn-in' period where the more you use them the closer two motors resemble each other.  
  > **username_0**: @enthdegree the motors are at least 3 years old. I'm working on a project for a university class that teaches basic programming, and the NXT platform is part of the class. I'm not sure how old the specific motors I'm using are, but they've been using the NXT platform for a while now.  
  
  ---
  
  ## 4 answers
  
  ### Answer by username_0 on 2012-01-26. Score: 6 | Accepted answer
  
  After looking around a bit in the NXT IO palette in LabVIEW, I found a few functions which will sync the motors while driving the robot. The "drive distance" and "steering on" VIs will both sync the motors appropriately to make the robot drive straight.
  
  ![functions palette](https://i.sstatic.net/pni99.png)
  
  The "motor on" and "motor reverse" blocks, which are the default options if you don't go down into the complete listing, do not sync the motors. As such, in order for the motors to work together, one should use either the "steering on" or "drive distance" VIs.
  
  
  ---
  
  ### Answer by username_2 on 2012-01-21. Score: 7
  
  You can't calibrate the motors, neither mechanically or in software. There is however several methods in the software to account for this.
  
  The standard NXT firmware contains a synchronization mode which attempt to keep the two motors aligned. In NXC you can do this by using the function [OnFwdSync](http://bricxcc.sourceforge.net/nbc/nxcdoc/nxcapi/group___output_module_functions_ga470e2dac6606677d0582cb14c1d31776.html#ga470e2dac6606677d0582cb14c1d31776) like this:
  OnFwdSync( OUT\_AC, 75, 0 );
  First parameter is the motors to sync, the second is the power and the third defines the difference in speed between the motors (used for the tribot).
  
  This article tells how to do the same in RoboLab: [How does NXT motor synchronizing work in ROBOLAB?](http://www.legoengineering.com/knowledgemanager/questions/257/How+does+NXT+motor+synchronizing+work+in+ROBOLAB?)
  
  In NXT-G I think synchronization is on per default in the move block, correct me if I'm wrong.
  
  I don't know how to do this in LabView. However I have heard there is some blocks to do this in the "NXT I/O»NXT Native I/O»Output" palette, try looking there.
  
  ---
  
  You can make your own controller by looking at the rotation value. Calculate the difference and set the speed like this:
  
  ```
  Motor A = power + weight * difference
  Motor B = power - weight * difference
  
  ```
  
  The weight is how much the difference should affect the motor speed, you will need to experiment a bit to find a good value here. You might also want to take the 100% limit in account. If the power for one motor goes over 100%, do this:
  
  ```
  if( Motor A > 100 )
     Motor B = Motor B - ( Motor A - 100 )
  
  if( Motor B > 100 )
     Motor A = Motor A - ( Motor B - 100 )
  
  ```
  
  > **Comments:**
  > **username_0**: I won't be at work again until Tuesday, but when I am, I'll look and see if there are any functions that seem to do this properly in LabVIEW. If not, I may just have to write my own as you suggested. Thanks for the help!  
  
  ---
  
  ### Answer by username_3 on 2012-01-20. Score: 6
  
  The difference in speed can't be avoided. Even if the motors themselves were carefully paired, differences of friction on the axles or weight unbalance of the robot would result in speed mismatch. I am not used to LabVIEW, but the NXT firmware has a way to synchronize two motors, this functionnality should be available in LabVIEW.
  
  
  ---
  
  ### Answer by username_4 on 2012-01-29. Score: 2
  
  Here is a simple method to help you match up your motors as well as possible:
  <http://www.techbrick.com/Lego/TechBrick/TechTips/NXTCalibration/>
  
  > **Comments:**
  > **username_0**: Thanks, I saw that when I was researching this. The class I'm working for has already started using their motors, so to do this they'd all have to disassemble their robots, which it's too late to do. I'm going to suggest it to the instructor for next year's class though.  
  
  ---
  
  