|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: Timed While loop within Teleop
So these iterations are happening at 1000Hz??
|
|
#2
|
|||
|
|||
|
Re: Timed While loop within Teleop
It's just a conceptual value to see if I'm understanding the issue/solution at hand. I know that Teleop runs at 20ms, so I'd also be able to do around 6 iterations at a 20ms delay, however I don't know how Watchdog would respond.
I assume I would start at 1, and keep increasing the delay till Watchdog got unhappy. |
|
#3
|
|||||
|
|||||
|
Re: Timed While loop within Teleop
Use a state machine instead.
The Safety vi defaults to .1sec, so delaying for .125sec will trigger it. If you feed the Drive motors the same value (-0.8) at a faster rate than .1 sec, then it won't trip. Last edited by Mark McLeod : 14-02-2012 at 23:40. |
|
#4
|
|||||
|
|||||
|
Re: Timed While loop within Teleop
You might trip the watchdog. You'll certainly mess with your drivers, since everything will pause for 1/8 of a second.
Teleop.vi happens pretty regularly. You really can use it as your timing loop. Have some value that passes between each run of Teleop.vi. (Use a feedback node for this.) If the value =0, do nothing and pass your joystick value through. If the value >0, subtract one from it and substitute 0.8 for your joystick value. To trigger it, set the value = 125 (or whatever's appropriate. I forget the timing of Teleop.vi) if the button is triggered. |
|
#5
|
|||
|
|||
|
Re: Timed While loop within Teleop
Quote:
As for State Machines, I've always had trouble comprehending those and still have this issue.. |
|
#6
|
||||
|
||||
|
Re: Timed While loop within Teleop
Quote:
Since TeleOp runs at ~20ms, just override the joysticks (with the -0.8 command) for 6 iterations (6*20ms = 120ms = approx 1/8 second). Your motor will be happy because it is being commanded more often than 100ms, so neither the safety nor the watchdog will trip. |
|
#7
|
|||
|
|||
|
Re: Timed While loop within Teleop
Ah, I see! ~~ 6 iterations it is. Thanks!
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|