Go to Post If I can make one wish, it would be having Dean and Woodie read one of these writings of mine, so I can tell them "I get it! Give me time and give me inspiration, and one day I will be ready to take over the torch." - Ken Leung [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 06-02-2009, 16:22
EagleMentor's Avatar
EagleMentor EagleMentor is offline
Registered User
AKA: DBell
FRC #2533 (Juarez Aztec Eagles)
Team Role: Teacher
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Chicago
Posts: 4
EagleMentor is an unknown quantity at this point
Unhappy need help with motors

We know this is probably simple, but we are having trouble. In LABVIEW, we want a motor to run for x seconds, say 5 seconds, then stop. Is there something more elegant to stopping a motor in x seconds other than putting it in a loop?

Thanks for any help.

Last edited by EagleMentor : 06-02-2009 at 17:19. Reason: Clarification
  #2   Spotlight this post!  
Unread 06-02-2009, 16:59
bronxbomber92 bronxbomber92 is offline
Registered User
FRC #1551 (Grapes of Wrath)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Naples
Posts: 75
bronxbomber92 is an unknown quantity at this point
Re: need help with motors

I'm not positive what you're asking, but I think you want this:

Code:
if( joyStick.GetRawButton( 2 ) ) {
    motorSpeedController.Set( 1.0f ); // where motorSpeedController is either a Victor or Jaguar, run it at full forward
} else {
    motorSpeedController.Set( 0.0f ); // stop the motor when button two isn't pressed
}
  #3   Spotlight this post!  
Unread 06-02-2009, 17:25
EagleMentor's Avatar
EagleMentor EagleMentor is offline
Registered User
AKA: DBell
FRC #2533 (Juarez Aztec Eagles)
Team Role: Teacher
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Chicago
Posts: 4
EagleMentor is an unknown quantity at this point
Re: need help with motors

Thank you so much for your help. Sorry. We weren't clear. We are in LABVIEW, but your code actually helped us validate the values of 1 (run forward) and 0 (stop). We are that new to all this.
  #4   Spotlight this post!  
Unread 06-02-2009, 17:37
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: need help with motors

One way is to use the Feed and Delay VI. This should work pretty well if used in autonomous, or even in independent loops. It will not work well in teleop or in other loops meant to loop quickly. For those, you want to start the motor and note the time. Use a shift register or a feedback wire to compare the time each iteration to the start time and stop when enough time has elapsed. What you are building is a tiny state machine, and you can of course go further with it to include other states and other transitions.

Greg McKaskle
Closed Thread


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help with mini motors R.C. Motors 11 03-07-2008 16:25
questions on window motors!!!!! need help! nwbutterfly Motors 4 19-01-2005 18:01
Some help with motors Bharat Nain Technical Discussion 2 05-03-2004 19:29
Window Motors. Need help!!!! Mohsin Motors 1 27-02-2004 13:05
hey need some help with writing a code please help me here magical hands Programming 9 01-01-2004 21:46


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

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