View Single Post
  #1   Spotlight this post!  
Unread 30-03-2010, 20:28
sparks-1784 sparks-1784 is offline
Lance Stronk
FRC #1784 (Litchbots)
Team Role: Engineer
 
Join Date: Feb 2006
Rookie Year: 2005
Location: Litchfield, CT
Posts: 46
sparks-1784 is on a distinguished road
Re: Autonomous Independent

We tested the Autonomous independent tonight. At first, we had a FOR loop with drive commands and delays (similar to the tutorial example) and a WHILE loop with a watchdog with 20mS delay. What happened was that the motor commands and delay was being executed and the solenoid logic (in the WHILE loop) was only executed (briefly) after each delay was executed. This seems to make sense that the delay processing was 'hogging' all the processing resources and the solenoid logic would only be executed where each delay had finished.
We removed the FOR loop and brought a single motor command into the WHILE loop with the rest of the solenoid logic. What happened next was interesting, but first an explanation of the attached. The attached does not show all the cases for the solenoid logic, but I didn't think that was important for this discussion. If you need to look at all of the case states, let me know and I will send some screen shots of those.

We copied the solenoid logic from our Teleop program and used it in the autonomous. The way it works in Teleop is with 3 different button depressions - 1 fires the 'B' side of all solenoids for max kick, another fires 2 solenoids for a lesser kick and the third is the smallest kick. Each button depress fires the solenoid for 1 second and then fires the 'A' side of the solenoid for returning the kicker to 'cocked' mode. There is a 2 second timer to prevent the kicker from being fired again (within 2 seconds).
For the autonomous version, we replaced the 'buttons' with the optical sensor DIO and fire all the solenoid 'B' sides for the max kick in autonomous.

All of this was done with what I will call 'classical' logic and does not employ state machines of the type in the labview tutorial. I am sure that using the 'tutorial' type state machine would result in more 'readable' code, but all I can say is that I am still learning labview. Converting this to be more readable will be left as and exercise for the student (and mentor!).

Ok - so, we ran the autonomous and the autonomous mode was picking up the sensor and causing the solenoid logic to transition. However, the solenoid logic 1 second timing loops were quite a bit less than 1 second and the result was a flash change of state and back to 'cocked mode' for the kicker. The interesting thing was that the 2 second timer seemed to work...when we interrupted the optical beam constantly, the 2 second timer would count and then the solenoid logic would 'flash' and then the 2 second timer would repeat. We could not understand why one timer in the WHILE loop worked while the others did not.
Anyway...sorry for the long explanation. Hope you can help.
Attached Files
File Type: doc autonomous Indendent.doc (251.0 KB, 46 views)
__________________
Lance
Reply With Quote