Go to Post My favorite question of all time asked by "outsiders": How much does/did that thing cost? How can you put a price on the hard-work and dedication it took to build these machines? - KyleGilbert45 [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 16-02-2009, 16:35
T3H_K3YM45T3R's Avatar
T3H_K3YM45T3R T3H_K3YM45T3R is offline
Registered User
AKA: Christopher Robinson
FRC #1737 (Project X)
Team Role: Programmer
 
Join Date: Feb 2008
Rookie Year: 2006
Location: Excelsior Springs, Mo
Posts: 23
T3H_K3YM45T3R is an unknown quantity at this point
timer help with labview

my team needs help with some last minute programming, my team wants to put a motor on the robot and have it run on a cycle of on for 1ms and off for 11ms...I was trying to program it and cannot figure this out.

any help would be greatly appreciated.
  #2   Spotlight this post!  
Unread 16-02-2009, 17:13
EricVanWyk EricVanWyk is offline
Registered User
no team
 
Join Date: Jan 2007
Rookie Year: 2000
Location: Boston
Posts: 1,597
EricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond repute
Send a message via AIM to EricVanWyk
Re: timer help with labview

I've attached a picture of two simple examples. I'm sure a labview expert could do better.

In the top one I used a stacked sequence inside a while loop. This [sets the motor speed to 1, waits a millisecond], [sets the motor speed to 0, waits 11 milliseconds] repeat.

The top one uses the system timer. It grabs the current time in milliseconds (Tick Count), computes the remainder of that divided by 12 (Quotient and Remainder), and checks if the answer is 0 (Equal to 0?). (Select) is used to pass 1 if the remainder is 0 and 0 if the remainder isn't 0 to (Set Speed). This code would need to be run in a loop more often than once per millisecond.


For reference, the Jaguars are updated every 5ms, and the victors and spikes are updated slower. It is likely that this code will not behave as expected due to this. 12 milliseconds is a very short amount of time: why do you need to control them like this?

More to the point, why don't you simply set the speed to 1/12?
Attached Thumbnails
Click image for larger version

Name:	alternating motor.JPG
Views:	420
Size:	29.3 KB
ID:	7484  
  #3   Spotlight this post!  
Unread 16-02-2009, 17:44
T3H_K3YM45T3R's Avatar
T3H_K3YM45T3R T3H_K3YM45T3R is offline
Registered User
AKA: Christopher Robinson
FRC #1737 (Project X)
Team Role: Programmer
 
Join Date: Feb 2008
Rookie Year: 2006
Location: Excelsior Springs, Mo
Posts: 23
T3H_K3YM45T3R is an unknown quantity at this point
Re: timer help with labview

...I forgot to mention I was using a relay and not a speed controller.
we currently don't have the weight for a speed controller and we already had an extra spike on there...

but thanks for the code and help...
  #4   Spotlight this post!  
Unread 16-02-2009, 17:48
EricVanWyk EricVanWyk is offline
Registered User
no team
 
Join Date: Jan 2007
Rookie Year: 2000
Location: Boston
Posts: 1,597
EricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond repute
Send a message via AIM to EricVanWyk
Re: timer help with labview

In that case, just replace the motor VIs with relay VIs.

With spikes, you'll need to slow _way_ down.
  #5   Spotlight this post!  
Unread 16-02-2009, 18:04
T3H_K3YM45T3R's Avatar
T3H_K3YM45T3R T3H_K3YM45T3R is offline
Registered User
AKA: Christopher Robinson
FRC #1737 (Project X)
Team Role: Programmer
 
Join Date: Feb 2008
Rookie Year: 2006
Location: Excelsior Springs, Mo
Posts: 23
T3H_K3YM45T3R is an unknown quantity at this point
Re: timer help with labview

to answer the question of why we need it this way is because we are putting a coconut half on the robot and the motor we are using is extremely fast, we are wanting the coconut to look sort of like a radar dish...

and I'm not sure how to replace the motor vi's with the relay vi's
  #6   Spotlight this post!  
Unread 16-02-2009, 18:25
Russ Beavis Russ Beavis is offline
Registered User
no team
 
Join Date: Nov 2005
Location: Manchester, NH - DEKA R&D Corp.
Posts: 341
Russ Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond repute
Re: timer help with labview

Right click on the motor VI in the block diagram and use "replace->" to search for the appropriate relay VI. You'll probably have to change the reference input from a "motor type" to a "relay type". You may also have to change a "start" and "stop" VI from motor to relay types.

Russ
  #7   Spotlight this post!  
Unread 16-02-2009, 18:34
T3H_K3YM45T3R's Avatar
T3H_K3YM45T3R T3H_K3YM45T3R is offline
Registered User
AKA: Christopher Robinson
FRC #1737 (Project X)
Team Role: Programmer
 
Join Date: Feb 2008
Rookie Year: 2006
Location: Excelsior Springs, Mo
Posts: 23
T3H_K3YM45T3R is an unknown quantity at this point
Re: timer help with labview

after working on this for about 2 hours one of the mentors said we could use a victor...so I'll be able to use one of the two sample codes...

thank you for the help, hopefully we do good at our regional so everyone with FIRST can see the "CO-DAR" (coconut radar) on our robot...by the way, my team has a theme this year of Gilligan's Island so the coconut radar is more of a novelty item.
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 Festo Solenoid and Labview Team2883 General Forum 3 17-02-2010 12:56
Help with LabView daviamp NI LabVIEW 2 03-02-2009 19:55
help with Compressor and labview Team2883 General Forum 4 28-01-2009 22:18
Looking for help with creating a timer. stuffssguy Programming 7 16-02-2008 22:09
Labview and communication with peripheral device help jaijaidin LabView and Data Acquisition 3 26-01-2007 19:17


All times are GMT -5. The time now is 01:58.

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