Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Program Motor to Make One Exact Revolution (http://www.chiefdelphi.com/forums/showthread.php?t=112543)

r0306 01-02-2013 19:28

Program Motor to Make One Exact Revolution
 
We're using a 12V Tetrix Motor connected to a spike. Right now, we're trying to program the motor so that it starts and ends in the exact position but it never seems to do so. Please help.

Here is the current code we're using:

Code:

            if (leftStick.getRawButton(3))
            {
                             
                    piston.set(Relay.Value.kForward);

                    new java.util.Timer().schedule(new TimerTask() {         
 
                    public void run() {
         
                        piston.set(Relay.Value.kOff);
                           
                  }
            }, 1000L); //motor spins for one second
             
            }


9072997 01-02-2013 19:37

Re: Program Motor to Make One Exact Revolution
 
I believe you will need some kind of encoder to achieve that (unless your motor has one built in).

Ether 01-02-2013 20:30

Re: Program Motor to Make One Exact Revolution
 
Quote:

Originally Posted by 9072997 (Post 1226125)
I believe you will need some kind of encoder to achieve that (unless your motor has one built in).

You'll also probably have to control it with a speed controller, not a relay.



FrankJ 01-02-2013 21:37

Re: Program Motor to Make One Exact Revolution
 
If this is for this year's competition--the tetrix is not legal for FRC. It seems it would be difficult to consistently get one revolution just on time. Maybe add a limit switch?


All times are GMT -5. The time now is 10:04.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi