Your SlideShare is downloading. ×
7 Steps to Autonomous for FRC LabVIEW Programmers
7 Steps to Autonomous for FRC LabVIEW Programmers
7 Steps to Autonomous for FRC LabVIEW Programmers
7 Steps to Autonomous for FRC LabVIEW Programmers
7 Steps to Autonomous for FRC LabVIEW Programmers
7 Steps to Autonomous for FRC LabVIEW Programmers
7 Steps to Autonomous for FRC LabVIEW Programmers
7 Steps to Autonomous for FRC LabVIEW Programmers
7 Steps to Autonomous for FRC LabVIEW Programmers
7 Steps to Autonomous for FRC LabVIEW Programmers
7 Steps to Autonomous for FRC LabVIEW Programmers
7 Steps to Autonomous for FRC LabVIEW Programmers
7 Steps to Autonomous for FRC LabVIEW Programmers
7 Steps to Autonomous for FRC LabVIEW Programmers
7 Steps to Autonomous for FRC LabVIEW Programmers
7 Steps to Autonomous for FRC LabVIEW Programmers
7 Steps to Autonomous for FRC LabVIEW Programmers
7 Steps to Autonomous for FRC LabVIEW Programmers
7 Steps to Autonomous for FRC LabVIEW Programmers
7 Steps to Autonomous for FRC LabVIEW Programmers
7 Steps to Autonomous for FRC LabVIEW Programmers
7 Steps to Autonomous for FRC LabVIEW Programmers
7 Steps to Autonomous for FRC LabVIEW Programmers
7 Steps to Autonomous for FRC LabVIEW Programmers
7 Steps to Autonomous for FRC LabVIEW Programmers
7 Steps to Autonomous for FRC LabVIEW Programmers
7 Steps to Autonomous for FRC LabVIEW Programmers
7 Steps to Autonomous for FRC LabVIEW Programmers
7 Steps to Autonomous for FRC LabVIEW Programmers
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

7 Steps to Autonomous for FRC LabVIEW Programmers

4,377

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
4,377
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
54
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. 7 steps to autonomous for FRC LabVIEW programmers Jim Chastain jimc2550@gmail.com
  • 2. PingPong BunnyBot• WE HAVE ENCODERS ON OUR WHEELS• We want Arcade manual control (single joystick)• In autonomous we want to use TANK control• AND A SOLENOID “CLAW” TO HOLD OUR BUNNY• IN AUTONOMOUS, WE WANT TO DESIGN A STATE MACHINE WHICH WILL : – MOVE FORWARD 10 FEET – TURN RIGHT – GO FORWARD 3 FEET – OPEN CLAW TO DROP BUNNYBOT – THEN STOP AND WAIT FOR TELEOP
  • 3. 7 steps to Autonomous• 1 Create list of all variables needed for autonomous – All inputs (encoders) – All outputs (drive motor signals, solenoid controls, encoder reset) – Add a Boolean “Auto Enable”• 2 From this list, set up an indicator in Robot Global Data for each one ( In Robot Main.vi assign value to “Auto Enable”)• 3 In “Timed Tasks.vi” read all sensors including joystick.• 4 Create a CASE struct in Timed Tasks.vi and use “Auto Enable” to switch controls between signals from “Autonomous” and “manual” control• 5 Make a list of all steps needed in autonomous, include steps to reset encoders; put steps in STATE CHART (4 columns)• 6 Build LABVIEW STATE MACHINE in Autonomous• 7 Use Robot Global Data to Debug
  • 4. set up list of auto variables• Autonomous inputs – Right and left encoders• Autonomous outputs – Auto drive right – Auto drive left – Auto sol Close (close solenoid) – Auto sol Open (open solenoid) – Auto enc reset (reset both encoders every time)• We also want a signal “Auto Enable” to be on Robot Global Data• THIS GIVES US A SINGLE CONTROL SIGNAL WHICH CAN BE USED to switch manual to auto.
  • 5. From list, create indicators on Robot Global DATAYOU MUST SAVE AFTER UPDATING RGD
  • 6. Read all sensors (and joystick) in Periodic tasks.vi I used the 10 ms loop, but changed it to 20 ms
  • 7. AUTO ENABLE GETS VALUE IN ROBOT MAIN.VI TRUE IN AUTONOMOUS, FALSE ALL OTHER STATES
  • 8. CREATE CASE TO SWITCHCONTROL SIGNALS THIS CASE SWITCHES CONTROL FOR MOTOR AND SOLENOID FALSE MEANS MANUAL CONTROL
  • 9. TRUE MEANSAUTONOMOUS IS CONTROLLING
  • 10. NOTE, WHEN I CONTROL DRIVE MOTORS IN PERIODIC TASK, I MUST DIASABLE CONTROL IN TELEOP.VI
  • 11. LIST OF STEPS FOR AUTONOMOUS• 1 START WITH WHEELS STOPPED, CLAW CLOSED; RESET ENCODERS• 2 GO FORWARD 300 REVOLUTIONS ON BOTH ENCODERS• 3 STOP, RESET BOTH ENCODERS, (wait 20 ms)• 4 RIGHT WHEEL STOPPED, LEFT WHEEL FORWARD 25 REVOLUTIONS (HALF SPEED)• 5 STOP, RESET BOTH ENCODERS (wait 20 ms)• 6 GO FORWARD 95 REVOLUTIONS ON BOTH ENCODERS• 7 STOP, RESET ENCODERS, OPEN CLAW (wait 20 ms)• 8 WAIT FOR MANUAL CONTROL• NOW PUT IN STATE CHART WITH 4 COLUMNS – LEFT COLUMN IS STATE NAME – NEXT IS STATE OUTPUT – NEXT IS TRIGGER TO GO TO NEXT STATE – FINAL COLUMN IS NEXT STATE (if you do not count notes)
  • 12. L = Auto Left; R = Auto Right; RS = encoder reset; Open & Close = Solenoid STATE CHARTSTATE NAME OUTPUTS TRIGGER NEXT STATE NOTESSTART L=R=0; None TWO RS=true; Close=TrueTWO L=R=.-4 ENCODERS = THREE TRICKY STEP TO RS = false 300 STOP EACH Close =false MOTOR SEPARATELYTHREE L=R=0;RS=true 100 ms FOURFOUR R=0; L=-.3;RS=f ENCODER=25 FIVEFIVE L=R=0; RS=t 100 ms delay SIXSIX L=R=-.4;RS=f ENCODERS =95 SEVEN AGAIN, TRICKYSEVEN L=R=0;RS=t; 100 ms delay END Open =trueEND L=R=0, RS=f 100 ms delay END Open = f
  • 13. BUILD LV STATE MACHINE• IN AUTONOMOUS – PUT LARGE WHILE LOOP – IN CENTER PUT MEDIUM SIZE CASE STRUCT – PUT GLOBAL OUTPUT VARIABLE ON RIGHT – PUT GLOBAL INPUTS ON LEFT – CREATE ENUM (numeric pallet) • Edit items to enter all STATE NAMES – CONNECT ENUM TO “?” OF CASE – CHANGE TUNNEL THRU WALL TO SHIFT REGISTER
  • 14. BASIC BLOCKS IN AUTONOMOUS Leave original autonomous code disabled OUTPUTS INPUTS WHILE LOOP CASE
  • 15. NOW ADD ENUM ENUM FROM ‘NUMERIC’ MENU, RIGHT CLICK, EDIT ITEMS, INSERT STATE NAMES FROM CHART! ENUM GOES OUTSIDE WHILE, ON LEFT
  • 16. COMPLETE FRAMEWORKCONNECT ENUM TO ? RIGHT CLICK ON CASE OF CASE; CHANGE CONTROL BOX, ‘ADD CASETUNNEL TO SHIFT REG FOR EVERY VALUE’
  • 17. COMPLETE CONTENTS FOR EACH STATE… FROM CHART
  • 18. State TWO
  • 19. State THREE
  • 20. State FOUR
  • 21. State FIVE
  • 22. State SIX
  • 23. State SEVEN
  • 24. State END
  • 25. DEBUG USING RGD• Robot Global Data can be very useful in debug if you include a STATE indicator (here is how) – Put an indicator on the STATE line (right side of while loop) – Right click on it (find) to locate it on front panel of Autonomous.vi – Then copy it to Robot Global Data , call “current State” – Delete it from the Block Diagram and replace it with Robot Global Data.. See next three slides.• Now when you run the robot in Autonomous mode, you can watch Robot Global Data and see if things run in the correct order.
  • 26. Create an indicator on the STATE variable lineThen right click on it and ‘find indicator’
  • 27. Then put a copy on front panel of ROBOT GLOBAL DATA
  • 28. Label the Enum, “Current STATE”, Save RGD Delete the first enum indicatorConnect the RGD to the state variable line.
  • 29. NOTES• I used 100 ms as a time delay just to let everything rest before going to next state (where there is a delay)• Shoot me an email if you have questions• Good luck!

×