21

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.

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.)

2
  • 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. Commented Jan 20, 2012 at 18:27
  • @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.
    – nhinkle
    Commented Jan 20, 2012 at 21:43

4 Answers 4

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 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?

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 )
1
  • 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!
    – nhinkle
    Commented Jan 21, 2012 at 21:20
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.

6

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

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.

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/

1
  • 1
    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.
    – nhinkle
    Commented Jan 29, 2012 at 4:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.