FIRST Tech Challenge Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

How can we make two encoders work for 4 drive motors? (Archived)

Update: This discussion applies to Issues from the 2010 FTC season and is no longer relevant for current FTC competition software.


Any sample programs for using just 2 encoders on a four wheel drive with 4 motors?

0 Kudos
Message 1 of 7
(6,213 Views)

4 motors 2 econders.png

Dummi,

In this example we have two motors with encoders (Left Front Drive and Right Front Drive) and two motors that do not (Rear Left and Read Right).  In the outer while loop I simple tell the motors with encoders to move 1000 encoder ticks.  In the inner loop I tell my other two motors to move and poll the encoders attached to Left Front Drive and Right Front Drive to see if they are still moving.  If they have stopped the output Move in Progress? from the Motor Status VI outputs a false.  I use this value to end my inner while loop and then immediately set the motor speed for Rear Left an Rear Right to 0, stopping the motors.

This example will probably require some tweaking to get perfect and implement into your code.  Please post any questions you may have.

Cheers,

Mark

LabVIEW R&D

Mark
NI App Software R&D
0 Kudos
Message 2 of 7
(3,849 Views)

Thank you very much for the quick response, we appreciate it.

0 Kudos
Message 3 of 7
(3,849 Views)

We've been having a very difficult time to get the encoders in conjunction with the Texrix Move a Motor a fixed distance to function consistently.   We are just using the move distance function and are not using the Status function. We have the encoders hooked up to the left front and right front motors and then the rear motors connected in parallel to the corresponding front motors.  Isn't that an acceptable way to use four motors?  Is our configuration perhaps causing us issues with our LabVIEW program to behave inconsistently?   In your configuration below, we would need to use another HiTechnic Motor Controller to have the rear motors on their own ports.  Is that what we need to do for a four motor drive?

Thanks!

0 Kudos
Message 4 of 7
(3,849 Views)

In my example two motor controllers are used and the "decision" whether to stop the motor without encoders is made in software, by using the Status function as you pointed.  I am unsure if wiring two motors in parallel is recommended or what problems this may cause. Could you post a screen shot of your code, or go into more detail of what the "inconsistent" behavior is?

Thanks,

Mark

Mark
NI App Software R&D
0 Kudos
Message 5 of 7
(3,849 Views)

Mark,

Please see my post "What is the correct way to pivot (spin wheels in opposite directions )using Textix motors and encode...".  This explains in more detail the problem we are having and what we have tried.  Code is attached to the post.

Thanks,

Chris

0 Kudos
Message 6 of 7
(3,849 Views)

Wiring the Left motors in parallel, and the Right motors on Parallel is fine (since this is what is done on the robot in the Getting Started Manual).

And then you can put the encoders on just the front or rear wheels.

Putting encoders on all four wheels, or driving all four wheels independantly may cause more problems than it solves.

If you put encoders on all four wheels, then they will probably fight against each other when trying to come to a final stop.

If you drive all four wheels independantly, but only put encoders on two of them, you won't be able to use the built-in... "Move A Fixed Distance" VI, because the encoder/non-encoder wheels can't be driven at the same time.

On our robot, the front wheels are standard 3" and the rear wheels are omni's which have a slightly larger radius.  Each has it's own motor.

We just wire the left in parallel, and the right in parallel, and we put encoders on the "normal" 3" wheels.

Now we can drive the system just using the standard "Move DC Motors".VI (constant speed or power). or the "Move A Fixed Distance".VI.

Just make sure that the front and rear wheels are wired so they run in the same direction when connected together, and set either the left or right side as "inverted" using the motor configurator.

Get a life? This IS my life!
0 Kudos
Message 7 of 7
(3,849 Views)