Go to Post Slight physical blocks will never stop a good programmer, we can just program around it. - AIBob [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
  #16   Spotlight this post!  
Unread 07-03-2010, 11:54
billbo911's Avatar
billbo911 billbo911 is offline
I prefer you give a perfect effort.
AKA: That's "Mr. Bill"
FRC #2073 (EagleForce)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Elk Grove, Ca.
Posts: 2,349
billbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond repute
Re: Teleop Issue - Motor Control Seems to Freeze

We have our kicker state machine running as a parallel task in the main.vi. That way it can run in both teleop and autonomous without delaying anything else. You can see this in this thread where this issue has been discussed already.
__________________
CalGames 2009 Autonomous Champion Award winner
Sacramento 2010 Creativity in Design winner, Sacramento 2010 Quarter finalist
2011 Sacramento Finalist, 2011 Madtown Engineering Inspiration Award.
2012 Sacramento Semi-Finals, 2012 Sacramento Innovation in Control Award, 2012 SVR Judges Award.
2012 CalGames Autonomous Challenge Award winner ($$$).
2014 2X Rockwell Automation: Innovation in Control Award (CVR and SAC). Curie Division Gracious Professionalism Award.
2014 Capital City Classic Winner AND Runner Up. Madtown Throwdown: Runner up.
2015 Innovation in Control Award, Sacramento.
2016 Chezy Champs Finalist, 2016 MTTD Finalist
Reply With Quote
  #17   Spotlight this post!  
Unread 26-03-2010, 04:09
helenajoy helenajoy is offline
Registered User
FRC #2437
 
Join Date: Nov 2008
Location: Hawaii
Posts: 31
helenajoy is an unknown quantity at this point
Re: Teleop Issue - Motor Control Seems to Freeze

Quote:
Originally Posted by Ether View Post
You placed the joystick and kicker code in separate tasks (correct?). What iteration period (ms) did you assign to each of these tasks?

Please explain what you mean by "extremely dependent".


~
The codes I have been testing are posted as images below.

Our kicker sequence is extremely dependent on the Watchdog Delay and Feed in that the solenoids need to be accuated in a certain sequence and needs the delays in as well. The kicker would not work without the solenoids accuating in order or the delays. The code itself probably explains it better than I can.

The first image is the kicker sequence within Teleop only. When our driver presses Button One on Joystick 3, our robot kicks. The problem with this code is that it seems to freeze the Tank Drive Joysticks.

The second image is the kicker sequence in Periodic Tasks. With this code, the driver can control the Tank Drive but the kicker sequence stops midway and does not complete itself.

I have not yet tried using global variables to fix this problem. I'll post up an image of that code when I make it.
Attached Thumbnails
Click image for larger version

Name:	Hawaii Competition Code b2.3 Teleop.jpg
Views:	50
Size:	74.9 KB
ID:	8927  Click image for larger version

Name:	Hawaii Competition Code b2.2 Periodic Tasks.jpg
Views:	53
Size:	73.5 KB
ID:	8928  
Reply With Quote
  #18   Spotlight this post!  
Unread 13-04-2010, 17:56
helenajoy helenajoy is offline
Registered User
FRC #2437
 
Join Date: Nov 2008
Location: Hawaii
Posts: 31
helenajoy is an unknown quantity at this point
Re: Teleop Issue - Motor Control Seems to Freeze

Hm, the codes I have posted above still seem to freeze up the joystick control when the kicker is activated.

Are there any other options or ideas that could fix this?
Reply With Quote
  #19   Spotlight this post!  
Unread 13-04-2010, 18:45
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,731
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Teleop Issue - Motor Control Seems to Freeze

Yes, the code you posted for Teleop will freeze your driver controls for the duration of the kick sequence.

Concentrate on fixing your Periodic code.
At what step does it stop working?

P.S.
The code left in Teleop on the outside of the Case statement (where you set the four solenoids) will override the Periodic code and mess up the kick sequence. Even without pulling the joystick trigger.
In Periodic that code outside the While loop only happens once per robot boot, but the Teleop outside code happens 50 times per second.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 13-04-2010 at 19:24.
Reply With Quote
  #20   Spotlight this post!  
Unread 13-04-2010, 18:55
kamocat's Avatar
kamocat kamocat is offline
Test Engineer
AKA: Marshal Horn
FRC #3213 (Thunder Tech)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 2008
Location: Tacoma
Posts: 894
kamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nice
Send a message via AIM to kamocat Send a message via MSN to kamocat
Re: Teleop Issue - Motor Control Seems to Freeze

Once you have the kicker code all in Periodic Tasks, you can delete it from Teleop.
__________________
-- Marshal Horn
Reply With Quote
  #21   Spotlight this post!  
Unread 14-04-2010, 00:36
Aren Siekmeier's Avatar
Aren Siekmeier Aren Siekmeier is offline
on walkabout
FRC #2175 (The Fighting Calculators)
Team Role: Mentor
 
Join Date: Apr 2008
Rookie Year: 2008
Location: 대한민국
Posts: 735
Aren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond repute
Re: Teleop Issue - Motor Control Seems to Freeze

I think your problem may be the Delay and Feeds in your Periodic Tasks case. Right now, when you press the joystick button, it picks the true case and executes all the solenoid and watchdog vis in the order defined by the error lines. Since the delays total to 3 seconds, I think it will take 3 seconds to run this while loop once when you start the kicker sequence. I'm not sure if this disallows Teleop from running (I kind of doubt it, this it is running parallel to and independent of Timed Tasks in Robot Main), but it may cause some undesirable overhead. At the very least it will keep everything else in that 100 ms loop from executing properly (whatever else that is).

A state machine is probably what you want here, as it will execute each of these steps in the kicker sequence at the appropriate times without interfering with the rest of your code. We have a state machine for our kicker that stores a variable (enums are usually appropriate) for the current state, such as loaded, fire, wait, reload, wait, etc. or however your kick sequence goes. In periodic tasks, a case structure reads this state and picks the appropriate case, and it is these cases which contain the solenoid set VIs. For the timing you could use a tick count block to store a time when you first enter a state, and then go to the next state (write the next state to the state variable) when the desired time has elapsed. Actually, our state variable is jsut initialized outside the while loop and then fed back with a shift register, so only the state machine can change its own state. Hopefully that made some sense...

I've attached our Periodic Tasks.vi. Our state machine is in the 20ms loop, and reads the global variable Kick?, which is set to the joystick button in TeleOp.
Attached Files
File Type: vi Periodic Tasks.vi (26.1 KB, 16 views)
Reply With Quote
  #22   Spotlight this post!  
Unread 14-04-2010, 08:37
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,034
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: Teleop Issue - Motor Control Seems to Freeze

Quote:
Originally Posted by compwiztobe View Post
Since the delays total to 3 seconds, I think it will take 3 seconds to run this while loop once when you start the kicker sequence... [which] may cause some undesirable overhead.
I believe the "watchdog delay and feed" blocks waiting for the specified time so the overhead should be minimal.


Quote:
Originally Posted by compwiztobe View Post
A state machine is probably what you want here,
A state machine is a viable alternate way to do this sort of thing, but many teams have successfully used a concurrent periodic task.

We were successful using both approaches. We started out using state machines, then switched to using event-triggered periodic tasks. The periodic tasks approach is easier to look at and see the sequential flow. Makes it easier for peer review, particularly for inexperienced programmers.

~
Reply With Quote
  #23   Spotlight this post!  
Unread 14-04-2010, 22:32
Aren Siekmeier's Avatar
Aren Siekmeier Aren Siekmeier is offline
on walkabout
FRC #2175 (The Fighting Calculators)
Team Role: Mentor
 
Join Date: Apr 2008
Rookie Year: 2008
Location: 대한민국
Posts: 735
Aren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond repute
Re: Teleop Issue - Motor Control Seems to Freeze

Quote:
Originally Posted by Ether View Post
I believe the "watchdog delay and feed" blocks waiting for the specified time so the overhead should be minimal.
But doesn't this suspend the entire 100 ms loop for the whole 3 seconds? The watchdog may be fed, but that doesn't mean the code will still iterate at 100ms. In fact, that's why you need to feed the watchdog (I think?). I'm not entirely sure about how the watchdog works.

Quote:
Originally Posted by Ether View Post
A state machine is a viable alternate way to do this sort of thing, but many teams have successfully used a concurrent periodic task.
So is this concurrent periodic task the same kind of sequence structure or delay and feed structure that he used? Cuz I'm pretty sure both of those would still take the whole 3 seconds for one execution once its triggered, which may be fine if it's entirely independent of other tasks (like driving). And what do you mean by event driven? Our state machine could be classified as event driven in the sense that it waits for a button press to begin the state sequence.... Or did you set up some error handling in LabView? (something else I haven't really looked into at all)
Reply With Quote
  #24   Spotlight this post!  
Unread 14-04-2010, 23:31
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,034
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: Teleop Issue - Motor Control Seems to Freeze

Quote:
Originally Posted by compwiztobe View Post
But doesn't this suspend the entire 100 ms loop for the whole 3 seconds?
Yes, but it doesn't freeze up other concurrent tasks. The "watchdog delay and feed" releases the processor to go service other tasks while it's waiting for the specified delay to expire. It doesn't sit there burning cycles.


Quote:
Originally Posted by compwiztobe View Post
what do you mean by event driven?
event-triggered. an event (the press of a joystick button) triggers the periodic task to go do something.

for example: you could set up your kicker as a separate 50ms periodic task that normally does nothing except check to see if the "kick" button is pressed. if the button is pressed, it goes through the kick cycle, taking as long as it needs. It can take as long as it needs because if it's in a separate periodic task, then it is run concurrently and doesn't prevent other robot tasks (like driving) from running.


~
Reply With Quote
  #25   Spotlight this post!  
Unread 16-04-2010, 08:12
helenajoy helenajoy is offline
Registered User
FRC #2437
 
Join Date: Nov 2008
Location: Hawaii
Posts: 31
helenajoy is an unknown quantity at this point
Smile Re: Teleop Issue - Motor Control Seems to Freeze

I compeletely removed anything related to the kicker sequence from Teleop and the code now works perfectly.

Thank you for all of the help, everybody! (:
Reply With Quote
  #26   Spotlight this post!  
Unread 15-07-2010, 15:41
dotbran dotbran is offline
Registered User
AKA: Brandon Olsen
FRC #3219 (TREAD)
Team Role: Programmer
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Auburn, WA
Posts: 68
dotbran is on a distinguished road
Re: Teleop Issue - Motor Control Seems to Freeze

You problem may be in the sequence. I was having a similar problem triggering solenoids within the teleop, and the sequence itself was delaying drive operations from runnning in real-time.

I fixed this by using a few case structures and feedback notes to keep the extending solenoid enabled and the retracting solenoid disabled while the trigger was held and the inverse when the trigger wasn't held.

Timing operations can cause a delay.

Another option would be to make an entirely new SubVI in Robot Main so kicking runs in parallel with drive.
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
Labview Servo Control Issue EricWilliams Programming 5 22-01-2010 14:24
Jaguars Slow Yellow Blink - Possible Control System Issue MikeDubreuil FRC Control System 3 26-01-2009 23:04
Driver Station Watch Dog / Motor Won't Spin Issue RMiller FRC Control System 5 20-01-2009 09:58
Small Banebots Motor Issue - Lessened torque and smoke sanddrag Motors 10 12-02-2007 21:41
CIM motor issue dmellich Motors 4 11-02-2005 11:10


All times are GMT -5. The time now is 03:46.

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