Go to Post I can't believe it someone is talking about next years game rationally! - jamie_1930 [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 04-02-2012, 17:30
cilginbilgin cilginbilgin is offline
Registered User
FRC #2905
 
Join Date: Jan 2010
Location: Istanbul,Turkey
Posts: 188
cilginbilgin is a jewel in the roughcilginbilgin is a jewel in the roughcilginbilgin is a jewel in the roughcilginbilgin is a jewel in the rough
Restricting Window Motors Number of Turn

Hi everybody,

We wonder if we can restrict our window motors number of turn in our code. Regardless how long we push the button we want the window motor to stop at some point.

Is it possible to do it in our code?
Thanks in advance...
Reply With Quote
  #2   Spotlight this post!  
Unread 04-02-2012, 18:04
David Brinza's Avatar
David Brinza David Brinza is offline
Lead Mentor, Lead Robot Inspector
FRC #0980 (ThunderBots)
Team Role: Mentor
 
Join Date: Feb 2003
Rookie Year: 2003
Location: Glendale, CA
Posts: 1,378
David Brinza has a reputation beyond reputeDavid Brinza has a reputation beyond reputeDavid Brinza has a reputation beyond reputeDavid Brinza has a reputation beyond reputeDavid Brinza has a reputation beyond reputeDavid Brinza has a reputation beyond reputeDavid Brinza has a reputation beyond reputeDavid Brinza has a reputation beyond reputeDavid Brinza has a reputation beyond reputeDavid Brinza has a reputation beyond reputeDavid Brinza has a reputation beyond repute
Re: Restricting Window Motors Number of Turn

You'll need some form of sensor for feedback to the controller. Options include: digital encoder, potentiometer, limit switch, magnetic sensor...
__________________
"There's never enough time to do it right, but always time to do it over."
2003 AZ: Semifinals, Motorola Quality; SoCal: Q-finals, Xerox Creativity; IRI: Q-finals
2004 AZ: Semifinals, GM Industrial Design; SoCal: Winners, Leadership in Controls; Championship: Galileo #2 seed, Q-finals; IRI: Champions
2005 AZ: #1 Seed, Xerox Creativity; SoCal: Finalist, RadioShack Controls; SVR: Winners, Delphi "Driving Tomorrow's Technologies"; Championship: Archimedes Semifinals; IRI: Finalist
2007 LA: Finalist; San Diego: Q-finals; CalGames: Finalist || 2008 San Diego: Q-finals; LA: Winners; CalGames: Finalist || 2009 LA: Semifinals; Las Vegas: Q-finals; IRI: #1 Seed, Finalist
2010 AZ: Motorola Quality; LA: Finalist || 2011 SD: Q-finals; LA: Q-finals || 2013 LA: Xerox Creativity, WFFA, Dean's List Finalist || 2014 IE: Q-finals, LA: Finalist, Dean's List Finalist
2016 Ventura: Q-finals, WFFA, Engineering Inspiration
Reply With Quote
  #3   Spotlight this post!  
Unread 04-02-2012, 18:17
DonRotolo's Avatar
DonRotolo DonRotolo is offline
Back to humble
FRC #0832
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Atlanta GA
Posts: 7,011
DonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond repute
Re: Restricting Window Motors Number of Turn

That sensor David mentioned will tell your code exactly where the motor shaft is, and thus how many times the motor has turned. It is not terribly difficult. Your choice of sensor depends on how many turns you need to count and what your budget is.

Note that trying to do it by "dead reckoning" - that is, by guessing the motor's position according to time that it has been supplied power - will be disappointing.
__________________

I am N2IRZ - What's your callsign?
Reply With Quote
  #4   Spotlight this post!  
Unread 04-02-2012, 18:36
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,100
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: Restricting Window Motors Number of Turn

Quote:
Originally Posted by cilginbilgin View Post
Hi everybody,

We wonder if we can restrict our window motors number of turn in our code. Regardless how long we push the button we want the window motor to stop at some point.

Is it possible to do it in our code?
Thanks in advance...
If you could provide a bit more detail about your design and what you are trying to achieve, it might be possible to give you a more targeted answer concerning what type of sensor to use.

Reply With Quote
  #5   Spotlight this post!  
Unread 05-02-2012, 05:02
cilginbilgin cilginbilgin is offline
Registered User
FRC #2905
 
Join Date: Jan 2010
Location: Istanbul,Turkey
Posts: 188
cilginbilgin is a jewel in the roughcilginbilgin is a jewel in the roughcilginbilgin is a jewel in the roughcilginbilgin is a jewel in the rough
Red face Re: Restricting Window Motors Number of Turn

Quote:
Originally Posted by Ether View Post
If you could provide a bit more detail about your design and what you are trying to achieve, it might be possible to give you a more targeted answer concerning what type of sensor to use.

Here we have a drawing of the mechanism. Window motor will control the damper. We want damper to go down and up.

http://imageshack.us/photo/my-images...allholder.png/
Reply With Quote
  #6   Spotlight this post!  
Unread 05-02-2012, 07:59
cgmv123's Avatar
cgmv123 cgmv123 is offline
FRC RI/FLL Field Manager
AKA: Max Vrany
FRC #1306 (BadgerBOTS)
Team Role: College Student
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Madison, WI
Posts: 2,081
cgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond repute
Re: Restricting Window Motors Number of Turn

Quote:
Originally Posted by cilginbilgin View Post
Here we have a drawing of the mechanism. Window motor will control the damper. We want damper to go down and up.

I changed the quote from a URL to an embedded image.

Limit switches are your best bet. There are some Honeywell ones in the kit to use. One that triggers when the damper touches the holder and one that triggers when the damper is fully open.
__________________
BadgerBOTS Robotics|@team1306|Facebook: BadgerBOTS
2016 FIRST Championship Tesla Division | 2016 Wisconsin Regional Engineering Inspiration Award

2015 FIRST Championship Carson Division | 2015 Wisconsin Regional Chairman's Award

2013 FIRST Championship Curie Division | 2013 Wisconsin Regional Chairman's Award

2012 FIRST Championship Archimedes Division | 2012 Wisconsin Regional Engineering Inspiration Award, Woodie Flowers Finalist Award (Lead Mentor Ben Senson)

Reply With Quote
  #7   Spotlight this post!  
Unread 05-02-2012, 14:00
cilginbilgin cilginbilgin is offline
Registered User
FRC #2905
 
Join Date: Jan 2010
Location: Istanbul,Turkey
Posts: 188
cilginbilgin is a jewel in the roughcilginbilgin is a jewel in the roughcilginbilgin is a jewel in the roughcilginbilgin is a jewel in the rough
Question Re: Restricting Window Motors Number of Turn

Quote:
Originally Posted by DonRotolo View Post
Note that trying to do it by "dead reckoning" - that is, by guessing the motor's position according to time that it has been supplied power - will be disappointing.
Is that for sure? Because mechanics in our team refuses to use limit switch.
Reply With Quote
  #8   Spotlight this post!  
Unread 05-02-2012, 14:17
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,100
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: Restricting Window Motors Number of Turn

Quote:
Originally Posted by cilginbilgin View Post
Here we have a drawing of the mechanism. Window motor will control the damper. We want damper to go down and up.

http://imageshack.us/photo/my-images...allholder.png/
Since you're using a window motor, and it looks like you've got hard stops at each extreme, you may be able to get by without a sensor if the load on the damper is known and sufficiently consistent so you can time it properly.

Reply With Quote
  #9   Spotlight this post!  
Unread 05-02-2012, 14:58
cilginbilgin cilginbilgin is offline
Registered User
FRC #2905
 
Join Date: Jan 2010
Location: Istanbul,Turkey
Posts: 188
cilginbilgin is a jewel in the roughcilginbilgin is a jewel in the roughcilginbilgin is a jewel in the roughcilginbilgin is a jewel in the rough
Re: Restricting Window Motors Number of Turn

Thank you David, Max, Don and Ether. We will try to do it without sensors because mechanics in our team are lazy.
Reply With Quote
  #10   Spotlight this post!  
Unread 05-02-2012, 16:49
cgmv123's Avatar
cgmv123 cgmv123 is offline
FRC RI/FLL Field Manager
AKA: Max Vrany
FRC #1306 (BadgerBOTS)
Team Role: College Student
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Madison, WI
Posts: 2,081
cgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond repute
Re: Restricting Window Motors Number of Turn

Quote:
Originally Posted by cilginbilgin View Post
Thank you David, Max, Don and Ether. We will try to do it without sensors because mechanics in our team are lazy.
Keeping track in code would be harder in my mind. And electrical has control over sensors on our team.
__________________
BadgerBOTS Robotics|@team1306|Facebook: BadgerBOTS
2016 FIRST Championship Tesla Division | 2016 Wisconsin Regional Engineering Inspiration Award

2015 FIRST Championship Carson Division | 2015 Wisconsin Regional Chairman's Award

2013 FIRST Championship Curie Division | 2013 Wisconsin Regional Chairman's Award

2012 FIRST Championship Archimedes Division | 2012 Wisconsin Regional Engineering Inspiration Award, Woodie Flowers Finalist Award (Lead Mentor Ben Senson)

Reply With Quote
  #11   Spotlight this post!  
Unread 12-02-2012, 10:29
cilginbilgin cilginbilgin is offline
Registered User
FRC #2905
 
Join Date: Jan 2010
Location: Istanbul,Turkey
Posts: 188
cilginbilgin is a jewel in the roughcilginbilgin is a jewel in the roughcilginbilgin is a jewel in the roughcilginbilgin is a jewel in the rough
Question Re: Restricting Window Motors Number of Turn

Quote:
Originally Posted by Ether View Post
Since you're using a window motor, and it looks like you've got hard stops at each extreme, you may be able to get by without a sensor if the load on the damper is known and sufficiently consistent so you can time it properly.

We tried to figure out how to restrict window motors and we created a while loop in the timed.vi because using while loop in the teleop.vi is not recommended. Are we supposed to put the while loop in the timed vi or in which vi should we use the while loop??? Thanks in advance!!!
Reply With Quote
  #12   Spotlight this post!  
Unread 12-02-2012, 15:02
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,100
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: Restricting Window Motors Number of Turn

Quote:
Originally Posted by cilginbilgin View Post
We tried to figure out how to restrict window motors and we created a while loop in the timed.vi because using while loop in the teleop.vi is not recommended. Are we supposed to put the while loop in the timed vi or in which vi should we use the while loop??? Thanks in advance!!!
I'm not a LabVIEW guru and I don't have LabVIEW installed here so I'm not equipped to give you LabVIEW-specific examples, but I think you want to put the equivalent of this into the periodic tasks vi:

Code:
while (1) {

if (!run_me) {sleep(20ms); continue;}

run_me= false;

doSomething;

sleep(3000ms);

doSomethingElse;

}
"run_me" is a boolean global variable. Whenever your TeleOp code sets it to "true", the code in red runs once.

The "doSomething" would be to turn your motor on. The "sleep(3000ms)" would be how long you want to leave the motor running. The "doSomethingElse" would be to turn the motor off.

The "sleep(20ms)" is there to limit how fast the code polls "run_me" while waiting for it to become true. Without the sleep, this loop would always want a slice of CPU time. That would waste resources. Make the 20ms as long as tolerable and only as short as necessary.

Perhaps a knowledgeable LabVIEW person could post a code snippet.


Last edited by Ether : 12-02-2012 at 15:07.
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 22:32.

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