|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
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
|
|||
|
|||
|
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? |
|
#3
|
||||
|
||||
|
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
|
|||
|
|||
|
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
|
||||
|
||||
|
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
|
|||
|
|||
|
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
|
||||
|
||||
|
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. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |