View Single Post
  #3   Spotlight this post!  
Unread 12-01-2013, 09:50
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,751
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Coding the drive system? (Arcade?)

Arcade drive is named around how arcade games would operate. A single stick would move you forward, backward, or rotate you clockwise or counterclockwise. Perhaps the easiest way to experience it is to run it in the simulator.

Then to understand how it works. A simple version of it sums the X and Y axis and sends that to side's motors and subtracts the two and sends that to the other side's motors. To understand a few example points, consider just the Y axis with an X of zero. The output to the motors is Y to one side and -Y to the other. Seems like that works to move the robot in a straight line. Now plot out the X axis with Y at zero. We end upsending X to both motors, and since the motors on one side of the robot are flipped, this results in the robot spinning in place at the given speed of X.

Combine the two vectors we've just mapped, and take a corner as an example. Full X and Full Y give all power to one motor and none to the other leading to a rotation about one wheel.

This simple arcade mapping will work and is probably pretty common, but it is also useful to scale the values or map the values first to make it easier to drive straight and in gentle arcs and making less of the XY space about spinning.

The default dashboard shows the motor outputs and joystick inputs, and you may find it useful to connect to a cRIO or simulated robot and pay attention to the plots as you move the joystick around and think about the X, Y, and outputL and outputR values that it generates.

Greg McKaskle
Reply With Quote