Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Sequencing Question (http://www.chiefdelphi.com/forums/showthread.php?t=93581)

Egg 3141592654 14-03-2011 08:44

Sequencing Question
 
So i had programmed an arm via a PID loop for our autonomous code. Naturally, I put this in a sequenceing loop so that the arm would raise BEFORE the robot went barreling into the plexiglass wall. I was told the wrong times that the arm would complete it's cycle, and naturally it was too short. The arm in autonomous naturally during the match kept going during the match and blew the arm out (those at nycfrc got to see the nice show. Match 8 i believe).

My hypothesis on what happened is that the PID ended after the time sequence and the motors retained their values (in our case, full throttle). I am almost certain this is right, but i just want to check with you guys. Thank you in advance.

Mark McLeod 14-03-2011 09:32

Re: Sequencing Question
 
The last thing you should always do in autonomous is zero out all your motors...:ahh:
The FPGA always remembers and keeps doing the last thing you told it to do.

You can also zero everything in a First Time Only case in Teleop to be on the safe side.

Egg 3141592654 14-03-2011 10:49

Re: Sequencing Question
 
Yeah, I figured that the the arm would have hit the required position and the PID would have corrected and done this all for me at the time BEFORE the time terminated. In the last step, all the motors are set back to zero but at that point it was too late, what a shame:( .

Mark McLeod 14-03-2011 11:05

Re: Sequencing Question
 
Yea, in the case of potential unfinished auto actions (PID loop not completing, encoder value not reached, etc.), adding a block in Teleop to initialize everything will safeguard against runaway motors and PID integral windup.

Two simple ways to set that up are:
  1. Programming->Synchronization->First Call?
  2. The Call Context global in the default Teleop Framework has an Init state.
Either of these can feed a Case statement that duplicates what you have in the last frame of your sequence in Autonomous to stop/halt/pause/wait.


All times are GMT -5. The time now is 09:24.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi