Difference between revisions of "DEWBOT VI Programming"

From DEW Robotics
Jump to: navigation, search
(February 13, 2010)
(Programming Overview: link to code functional specs)
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
=FRC Team 1640 Programming Team=
+
== Programming Overview ==
 +
Programming for this years robot is more complex than any other year. While there are two modes, an autonomous mode where the robot drives itself and a teleop mode where roboteers drive the robot, there is a huge amount of shared programming.
  
Journal for the Programming Team <br>
+
The largest amount of programming is used to manage the drive train. As chronicled above we have a pivot drive. Each pivot has it's own drive motor to move the robot. By varying the speed of each wheel the robot direction can be changed. If you make the right side drive motors go faster than the left the robot moves in a gentle arc to the left.  
Build Season 2010 "Breakaway"
 
If you are a programmer, please add/edit.
 
Repeat above, I mean it. If you are a programmer, please, please add more. I'm sure programmers did stuff week of 1/18-1/22!
 
  
==2010 DEWBOT VI Game Code==
+
The pivots also turn 360 degrees. Each pivot has it's own steering motor and a magnetic sensor. The sensor tells us what "direction" the pivot wheel is turning. So if we want to move to the left, we rotate the wheels 90 degrees to the left and apply power and the robot moves, looking like a crab. This is motion is call strafing, allowing us to quickly move side to side across the field.
Link to 2010 DEWBOT VI Game Code Page: [[2010 DEWBOT VI Game Code]]
 
  
==Programming Ideas/Goals==
+
The wheels can turn at any angle, allowing the robot to go in any direction. This crab like motion allows us to get to the ball while keeping the front kicker towards the goal. We strafe or crab over, align and kick.
  
*Pivot Drive         
+
On the fly we can change modes to "snake mode." This allows the robot to act like a snake going after prey. In our case the ball is the prey, snake mode keeps the ball in front of the robot (snake) while the back of the robot moves around. This allows us to herd balls into the goal.  
** Port to magnetic encoders
 
** Recalculate math for all drives
 
** Develop multi front chassis algorithm
 
** Talk about innovative pivot drive usage
 
* Vision
 
** Develop target tracking using camera (needs to work with something else other than arcade drive)
 
** Develop line tracking (done)
 
** Develop ball tracking (Need to know the sensor)
 
* Robot Safety
 
** Develop anti flipping system
 
* Robot Itself and Kicker
 
** Autonomous system with customization (part way done, need to know ball traking sensor)
 
** Program kicker
 
** Final tower climbing system
 
** LED for signaling
 
** Develop camera to kicker relationship
 
* Driver Station
 
** Update Classmate PC
 
** Design friendly control system with LEDs and toggle switches
 
* Lessons/Etc.
 
** Pivot Drive
 
** LabVIEW
 
** Algorithm development
 
** Programming management
 
** Camera System
 
*      Conclusive Paperwork
 
**      Detailed Documentation of Process and Code
 
**      Easy Driver's Manual
 
**      Nice demonstration PowerPoint
 
  
==Ideas Discussed==
+
Since the wheels can turn 360 degrees the robot can spin around on it's axis allowing us to reorient directions quickly.
  
===Vision System===
+
Finally while there is a "front" on DEWBOT VI where the kicker is, as far as the drive system is concerned there is no front. If you rotate the robot 90 degrees to the right, what was the left side is now the front.
  
====January 17, 2010====
+
So it's like rubbing your stomach while patting your head while chewing gum while running!
*Caged Camera for safety and protection
 
*Spring system that just knocks back or foward
 
**Material and shape TBA
 
*Located in middle of robot
 
*Rotation and Altitude control
 
*Recalibratible camera
 
*Reuse of camera code instead of making more
 
*3 Goals:
 
**Target Tracking
 
**Driver's Aid
 
**Field Watcher
 
  
==Tasks In Progress==
+
[[Media:DEWbot_VI_Controller_Map.pdf | Driver Control Documentation]] showing how the buttons are mapped to control functions
 +
See [[DEWBOT VI Code Functional Specifications]] for complete breakdown.
  
===January 17, 2010===
+
====Autonomous Mode====
*Vision system programming
+
:At the start of the match the robot has 15 seconds to try to score on it's own.  The plan sounds simple: Roll forward, find a ball, align the robot, kick the ball and SCORE!  In reality we need to move forward so far, use the IR sensors to find the ball, use the camera and the gyrocompass to find the target, use the drive system to line up the shot and fire the kicker. [[Glossary#easy peasy| Easy  Peasy]]!
*Pivot Drive math recalculations
 
*Remind Paul/Ken to update Classmate
 
  
===January 29, 2010===
+
====Teleop Mode====
 +
:This is where the two person drive team gets to show their stuff.  They move the robot around, find balls and shoot them into the goal.  Wait, that sounds like the autonomous mode, just use that.  Well we do, the targeting system shows us where the goal is and when we are aligned.  The reason the roboteers are needed is that under autonomous the balls are sitting still, now they are moving.  And there is not just one ball there could be 12 of them on the field.  Oh did we mention the other 5 robots? 
  
====Goals for January 30, 2010====
+
:So it gets a little wild and crazy and while our programmers are good, the roboteers drive the show.  The robot is still doing a lot of work, it's doing the drive train, tracking the goal and automatically cycling the kicker.  There is lots of teamwork going on!
  
*Have all drive modes ported over to game code (Kenneth)
+
== Safety ==
*Work on XBOX Controller (Paul)
+
Safety is important to our programming efforts.  The initial robot code is responsible for enable and disable functions. It connects to the driver station and follows it's control sequences.
*Use recalculated math from Clem in code
 
*Develop theoretical algorithms for [Least Limit Movement Algorithm 2.0]
 
*Develop theoretical algorithms for "Crab with a Twist of Snake" "Crab with a Twist of UFO"
 
*Despite our mentors recommendation that we don't program the same code, we will be programming the same theoretical code. With that we will see which works best (survival of fittest) and compromise (natural selection)
 
*Have a working drive code by night of January 30, 2010. We've moved deadline from January 31, 2010.
 
*We need a twist control.
 
  
==Tasks Accomplished==
+
At the end of the match it is possible that the robot is in a ''armed'' state with the kicker pulled back. This represents a hazard to the people moving the robot after the match. When the robot receives the ''end-of-match'' signal it releases the kicker, allowing the robot to be moved safely.
 
 
===January 17, 2010===
 
*Assembled successful Control System
 
*Tested out Control System
 
*Tested out Cherry Magnetic encoders and various light sensors
 
*Created power plug for camera
 
*Worked out some math for pivot drive
 
*Port most drive modes to 2010DEWBOTVI Code
 
 
 
==Programmer's Journal==
 
 
 
===January 16, 2010===
 
 
 
====9pm-12am====
 
*Set up control system
 
*Tore apart Pivot Bot Prototype
 
*Reimaged cRIO
 
*Installed drivers for Classmate
 
*Checked out Cypress First touch
 
*Talked about camera system (look above)
 
*Broke into vision and pivot crew
 
*Talked about drive math
 
*Tested out Cherry sensors
 
*LUNCH
 
====1pm-5pm====
 
*Tested out more of cherry sensor
 
*Tested out light sensors
 
*Worked on camera
 
*Went to RadioShack to buy H head for camera
 
*Solder plug and plugged in into power distrabution
 
*Realize need to update classmate
 
 
 
===January 29, 2010===
 
 
 
====6:00 BPC (Before Paul Came)====
 
*Kenneth and DJ arrives.
 
*Looked for power strips with Cole. There are none...
 
*Tried to get LabVIEW on DJ's Mac. No success.
 
*Started programming drive system.
 
*Programmer's cookie break
 
*Tried to get Max to come.
 
*Asked Clem about math for pivot drive. Success.
 
*Installed Cypress CD.
 
 
 
====6:00 APC (After Paul Came)====
 
*Paul arrived
 
*Discussed about status quo of code.
 
*Compromised code (survival of the fittest)
 
*Worked on XBOX Controller input .vi (Paul) Success
 
*Port pivot drive system over to 2010 DEWBOTVI Code
 
*Crab and Snake done. All other modes to be done (Kenneth) Success
 
*Paul and Kenneth decided on angle degree as base unit for crab.
 
*Discussed the [Least Limit Movement Algorithm] and seeing how to implement it
 
*Proposed new additional "limit" to [Least Limit Movement Algorithm], therefore upgrading it to [Least Limit Movement Algorithm 2.0beta]
 
*DJ still trying to install LabVIEW on Mac. Doesn't work.
 
*Paul and Kenneth worked on "Crab with a Twist"
 
*Departed ways
 
 
 
====After Robotics====
 
*12:15 AM - Paul completes theoretical test of Least movement algorithm ;) Success
 
 
 
===January 30, 2010===
 
 
 
====Pre Arrival====
 
*Paul worked on update Least Movement Algorithm
 
*Kenneth worked on finalization porting and redoing math.
 
 
 
====Arrival to Lunch====
 
*???
 
 
 
 
 
====Lunch to Snack Break====
 
*Traded code, compromised
 
*Talked about drive motors and rota motors
 
*Have working code
 
 
 
====Snack Break to Dinner====
 
*Talked about autonomous
 
*Drafted some autonomous
 
 
 
 
====Dinner to Departing====
 
*Worked on Math - Ben, Ken, Foster
 
*Math is complete and fixed
 
*Learned arrays to use for code
 
 
 
===January 31, 2010===
 
 
 
====12 PM====
 
*Paul finished Shortest Angle Algorithm
 
 
 
====3 PM====
 
*Kenneth and Ben finalized Snake and Auto array
 
*Paul fixes SAM.vi
 
 
 
====7 PM====
 
*Ben taught DJ LabVIEW
 
*Zain worked on his first code
 
*Paul finalizes Drive Motor.vi, Turn Target.vi, Crab Mode 3.vi, ShortestAngleMovement.vi
 
*Kenneth compromises all code together
 
*Waiting for the robot...
 
 
 
===February 12, 2010===
 
*Crab mode works!
 
*Ken is planning a snake mode.
 
*Tested Autonomous for Teleop, couldn't get past acquiring target.
 
*Regular Autonomous has yet to be tested (It is much different code than Autonomous for Teleop.)
 
 
 
===February 13, 2010===
 
Today we made great progress with the robot (Yesterday we made a lot too, programmers came in at 8:00 am and crab mode came to life)
 
*After some mechanical fixing-up, crab mode worked!
 
*Snake mode wasn't really tested, but it appeared to work up on blocks, so we need to test that tomorrow.
 
*Carly decided that she preferred the XBOX 360 controller over the twisting joystick
 
**The twisting joystick works fine when moving forward, but when going backwards or to the side, the natural twisting motion of a person's arm takes over
 
**The twist portion of the joystick is so sensitive that when moving to the side or backwards, it sees it as a twist
 
**The XBOX 360 controller is quite sensitive on the joystick part, but we can cut it down to half speed, and then set it so that holding down a button makes it full speed
 
*We also found that the wheels sometimes align to 0 degrees, sometimes to 180 degrees
 
**This can be explained by the chains always being on the inside, which would mean they flip, however, this doesn't mean too much since the magnets mounted for the magnetic encoders choose an arbitrary start position anyway.
 
***This means calibration code - which we already have implemented
 
****At the present moment, the code works like this: Take a reading when prompted to, and set that permanently as the calibration value
 
****We need to change this so that it initially takes the value checks that forward is in fact 0, and then sets the value. If it is not 0, then it needs to correct for that. This should then fix the problems we've been having.
 
**Though it is not a perfect explanation, I think it is at least part of the problem, especially since while we were testing today, we entered calibration mode while some of the wheels were reversed, and when we exited, some of the drive motors were spinning in the wrong direction.
 
*Hmmm...I forgot what the other thing we were supposed to is. So I'll keep this here as a placeholder just in case I remember, or if any of the other members edit this page and know what it is.
 
*On a final note, I'm planning (for fun) to bring in all my game controllers (DDR, Guitar Hero, XBOX 360 gamepad, Logitech Rumblepad 2 (generic gamepad), possibly the racing wheel) as well as to try to use my pen tablet to control the robot
 
**This should be interesting!!
 
  
 +
== How to Create a Custom Dashboard ==
 +
Instructions on how to create a custom dashboard in LabVIEW. (Thanks Mark McLeod)
 +
*Exit the Driver account to close everything (Setup tab -> Exit)
 +
*Login to the Developer Account
 +
*Use LabVIEW and create a new Dashboard project.
 +
*You'll then need to create an exe
 +
**Right click on Build Specifications -> New -> Application (EXE)
 +
**In the Popup:
 +
***"target filename" - change the name to Dashboard.exe
 +
***Change the Destination Directory to "C:\Program Files\FRC Dashboard"
 +
**Tell it where to begin:
 +
***In the left list click on "Source Files"
 +
***Click on "Dashboard Main.vi"
 +
***Click on the right pointing arrow that will highlight
 +
***You should see Dashboard Main appear on the right hand side under "Startup VIs"
 +
**Click on "Build" at the bottom to create your exe
 +
*Login to the Driver account to start up the new dashboard and see if it works.
 
== Labview links ==
 
== Labview links ==
 
[http://joule.ni.com/nidu/cds/view/p/lang/en/id/1534 FIRST Robotics Software 2010 - Windows - LabVIEW & NI Utilities] - this is the initial release, Do not use the serial number that comes in the software kit for activation. You MUST use the following Serial Number to activate LabVIEW: L13R00000
 
[http://joule.ni.com/nidu/cds/view/p/lang/en/id/1534 FIRST Robotics Software 2010 - Windows - LabVIEW & NI Utilities] - this is the initial release, Do not use the serial number that comes in the software kit for activation. You MUST use the following Serial Number to activate LabVIEW: L13R00000
Line 222: Line 65:
  
 
----
 
----
[[Category:Robot]][[Category:DEWBOT VI]]
+
[[Category:DEWBOT VI]]

Latest revision as of 13:28, 13 July 2010

Programming Overview

Programming for this years robot is more complex than any other year. While there are two modes, an autonomous mode where the robot drives itself and a teleop mode where roboteers drive the robot, there is a huge amount of shared programming.

The largest amount of programming is used to manage the drive train. As chronicled above we have a pivot drive. Each pivot has it's own drive motor to move the robot. By varying the speed of each wheel the robot direction can be changed. If you make the right side drive motors go faster than the left the robot moves in a gentle arc to the left.

The pivots also turn 360 degrees. Each pivot has it's own steering motor and a magnetic sensor. The sensor tells us what "direction" the pivot wheel is turning. So if we want to move to the left, we rotate the wheels 90 degrees to the left and apply power and the robot moves, looking like a crab. This is motion is call strafing, allowing us to quickly move side to side across the field.

The wheels can turn at any angle, allowing the robot to go in any direction. This crab like motion allows us to get to the ball while keeping the front kicker towards the goal. We strafe or crab over, align and kick.

On the fly we can change modes to "snake mode." This allows the robot to act like a snake going after prey. In our case the ball is the prey, snake mode keeps the ball in front of the robot (snake) while the back of the robot moves around. This allows us to herd balls into the goal.

Since the wheels can turn 360 degrees the robot can spin around on it's axis allowing us to reorient directions quickly.

Finally while there is a "front" on DEWBOT VI where the kicker is, as far as the drive system is concerned there is no front. If you rotate the robot 90 degrees to the right, what was the left side is now the front.

So it's like rubbing your stomach while patting your head while chewing gum while running!

Driver Control Documentation showing how the buttons are mapped to control functions See DEWBOT VI Code Functional Specifications for complete breakdown.

Autonomous Mode

At the start of the match the robot has 15 seconds to try to score on it's own. The plan sounds simple: Roll forward, find a ball, align the robot, kick the ball and SCORE! In reality we need to move forward so far, use the IR sensors to find the ball, use the camera and the gyrocompass to find the target, use the drive system to line up the shot and fire the kicker. Easy Peasy!

Teleop Mode

This is where the two person drive team gets to show their stuff. They move the robot around, find balls and shoot them into the goal. Wait, that sounds like the autonomous mode, just use that. Well we do, the targeting system shows us where the goal is and when we are aligned. The reason the roboteers are needed is that under autonomous the balls are sitting still, now they are moving. And there is not just one ball there could be 12 of them on the field. Oh did we mention the other 5 robots?
So it gets a little wild and crazy and while our programmers are good, the roboteers drive the show. The robot is still doing a lot of work, it's doing the drive train, tracking the goal and automatically cycling the kicker. There is lots of teamwork going on!

Safety

Safety is important to our programming efforts. The initial robot code is responsible for enable and disable functions. It connects to the driver station and follows it's control sequences.

At the end of the match it is possible that the robot is in a armed state with the kicker pulled back. This represents a hazard to the people moving the robot after the match. When the robot receives the end-of-match signal it releases the kicker, allowing the robot to be moved safely.

How to Create a Custom Dashboard

Instructions on how to create a custom dashboard in LabVIEW. (Thanks Mark McLeod)

  • Exit the Driver account to close everything (Setup tab -> Exit)
  • Login to the Developer Account
  • Use LabVIEW and create a new Dashboard project.
  • You'll then need to create an exe
    • Right click on Build Specifications -> New -> Application (EXE)
    • In the Popup:
      • "target filename" - change the name to Dashboard.exe
      • Change the Destination Directory to "C:\Program Files\FRC Dashboard"
    • Tell it where to begin:
      • In the left list click on "Source Files"
      • Click on "Dashboard Main.vi"
      • Click on the right pointing arrow that will highlight
      • You should see Dashboard Main appear on the right hand side under "Startup VIs"
    • Click on "Build" at the bottom to create your exe
  • Login to the Driver account to start up the new dashboard and see if it works.

Labview links

FIRST Robotics Software 2010 - Windows - LabVIEW & NI Utilities - this is the initial release, Do not use the serial number that comes in the software kit for activation. You MUST use the following Serial Number to activate LabVIEW: L13R00000

Link to the FIRST FRC Software Page that has all the programming information on the 2010 software packages.

LabVIEW Tutorials to learn some LabVIEW

FRC 2010 Training Tutorials to learn the 2010 LabVIEW

FRC 2010 Driver Station to learn the 2010 Driver Station

FIRST Community National Instrument's FIRST Community

Programming Forum from Chief Delphi - Chief Delphi Programming