Go to Post What's an autonomous mode? - Bill Gold [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
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 09-02-2010, 23:17
DWirth DWirth is offline
Registered User
FRC #2509
 
Join Date: Feb 2009
Location: Hutch
Posts: 10
DWirth is an unknown quantity at this point
Running Motor for X Milliseconds

Hello,
I'm working on programming our kicker which our team would like to wind up at certain tensions. To do this, I want to have the CIM motor to run for a certain amount of milliseconds if one button is pressed on the joystick. It would be nice if I could use a couple different buttons for different times. Then use a limit switch to tell the motor so stop all the way back no matter what time I select. However, I am not sure how to make the motor set speed vi to run continuously for a set amount of time. Does anyone have any ideas on how I can achieve that? Thanks for your help.
Dillon Wirth
Reply With Quote
  #2   Spotlight this post!  
Unread 09-02-2010, 23:51
Ziaholic's Avatar
Ziaholic Ziaholic is offline
Elec/SW Mentor
AKA: Marc
FRC #1164 (Project NEO)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2002
Location: Las Cruces, NM
Posts: 194
Ziaholic is a jewel in the roughZiaholic is a jewel in the roughZiaholic is a jewel in the roughZiaholic is a jewel in the rough
Re: Running Motor for X Milliseconds

I just posted a reply in a different thread that almost applies to your situation.

It's not exactly what you're looking for, but it involves writing code that runs in TeleOp, but takes longer than the 20msec main-loop time. It involves using shift registers to provide feedback from loop-to-loop in your teleop routines.

Here's a link to that thread.
__________________
----
There are 10 types of people. Those who understand binary, and those that do not.
Team #1164 - Project NEO Robotics
Reply With Quote
  #3   Spotlight this post!  
Unread 10-02-2010, 07:54
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Running Motor for X Milliseconds

It sounds like what you want is in three parts. First, start a motor running forward when a button is pressed. Second, stop the motor a certain amount of time after the motor is started. Third, if the motor isn't running forward, run it backward until a limit switch activates. Is that right?

You'll need a "rising edge detector" to find the start of the button press. Then you'll want something that runs the motor until a certain time has elapsed. The attached code fragment shows a way to do that.

I'll leave it up to you to figure out how to make the motor run the other way only when it's not being told to run forward and the limit switch is not active.
Attached Thumbnails
Click image for larger version

Name:	one-shot.jpg
Views:	42
Size:	30.2 KB
ID:	8600  
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
MIG welder feed motor always running sanddrag Electrical 14 11-09-2006 09:46
DC Motor running as a Generator IrisLab Motors 16 12-01-2004 12:23
A vampire running for office MissInformation Chit-Chat 2 30-08-2003 14:36
Running a motor for a set time in auton Morgoth Programming 5 11-03-2003 13:59


All times are GMT -5. The time now is 13:26.

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