Go to Post I do know a lot of teams need to be saved from themselves. - Karthik [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 01-02-2013, 19:28
r0306 r0306 is offline
Registered User
AKA: Robert Lu
FRC #0253 (MRT)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2010
Location: California
Posts: 13
r0306 is an unknown quantity at this point
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
               
            }

Last edited by r0306 : 01-02-2013 at 19:40.
Reply With Quote
  #2   Spotlight this post!  
Unread 01-02-2013, 19:37
9072997 9072997 is offline
Registered User
FRC #3608 (LISA Jaguars)
Team Role: Programmer
 
Join Date: Feb 2013
Rookie Year: 2011
Location: Arkansas
Posts: 4
9072997 is an unknown quantity at this point
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).
Reply With Quote
  #3   Spotlight this post!  
Unread 01-02-2013, 20:30
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,089
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Program Motor to Make One Exact Revolution

Quote:
Originally Posted by 9072997 View Post
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.


Reply With Quote
  #4   Spotlight this post!  
Unread 01-02-2013, 21:37
FrankJ's Avatar
FrankJ FrankJ is offline
Robot Mentor
FRC #2974 (WALT)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2009
Location: Marietta GA
Posts: 1,931
FrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond repute
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?
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 11:40.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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