We downloaded the encoder updates and the sample program for Labview and are having problems. Whatever value we put in for the target encoder value, the motors run for about 10 seconds and then shut off. If we run the sample program that includes the constant speed VI, the motors move forward and backward, not in sych with each other, and never the same pattern, seemingly randomly for 10 seconds. If we eliminate that VI and just specify a target distance for a single motor to travel, the motor runs for 10 seconds in one direction and shuts down (even if we specify the target as 1440, or one revolution).
Can anyone help us understand what is going wrong or offer any suggestions?
The 10 second timeout is in the LV code that’s waiting for the encoders to reach their target position. It’s clear that this is not hapenning, so the NXT shuts the Motors off after 10 seconds.
Some possible reasons:
-
The encoders are not wired/plugged in correctly. Verify this by unplugging them altogether, the same will probably happen. Check the following:
-
Check that the Encoder cable is plugged into the motor controller correctly (Yellow wire to the outside edge)
-
The left and right motors/encoders are swapped.
Simplify this by ONLY driving one wheel (eg A) and verifying that the Wires from Motor 1’s encoder are going back to Encoder Input 1 on the motor controller.
-
Your motor polarity is reversed… Check that the Red wire is hooked to the Motor terminal with the + engraved on the rear of the motor. (Simply setting the “Reverse” input on the motor.VI DOES NOT correct this problem).
Once you have the encoders reading (A and B correctly), use the Reverse input (to flip one motor) to make both motors run forward when you give a positive position to the Specify Position VI.
Note: the “Encoder Example” on the CMU site is incorrect. The Constant Speed VI and the Specify Position VI’s are independant. You can use one or the other. Setting a constant speed prior to the Specify Position will have no effect. You must use the “Power” input on Specify Position to change the speed at which it obtains that position. Just a head’s up.
Phil.