Changes between Version 18 and Version 19 of ControlSystems/SoftwareTeam/Training/GettingStarted/IntroRobotJava


Ignore:
Timestamp:
Oct 16, 2019, 1:03:08 AM (6 years ago)
Author:
David Albert
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ControlSystems/SoftwareTeam/Training/GettingStarted/IntroRobotJava

    v18 v19  
    8080== Third program: Servo Motor Control
    8181
    82 Robots must be able to interact with the environment around them too.  Many types of actuators are used in FRC robotics; one of them is the [https://wpilib.screenstepslive.com/s/currentCS/m/java/l/599703-repeatable-low-power-movement-controlling-servos-with-wpilib Servo Motor].  A servo motor is a special type of motor that can rotate to a precise position, usually between 0 and 180 degrees.  They come in a variety of sizes and strengths.  You can connect a servo motor to any of the PWM ports on the !RoboRIO.  Examine the PWM ports and identify which row of pins are ground ([[Image(GroundSymbol.png,25px)]], +6V, and Signal (S).  Make sure you connect them to the proper pins on the Servo motor: black or brown goes to Ground, red or orange goes to +6V, yellow/white/blue goes to Signal.  You can read more about servo motors [https://learn.sparkfun.com/tutorials/servo-trigger-hookup-guide/all here]
     82Robots must be able to interact with the environment around them too.  Many types of actuators are used in FRC robotics; one of them is the [https://wpilib.screenstepslive.com/s/currentCS/m/java/l/599703-repeatable-low-power-movement-controlling-servos-with-wpilib Servo Motor].  A servo motor is a special type of motor that can rotate to a precise position, usually between 0 and 180 degrees.  They come in a variety of sizes and strengths.  You can connect a servo motor to any of the [http://www.ni.com/pdf/manuals/375274a.pdf#_OPENTOPIC_TOC_PROCESSING_d443e2165 PWM ports] on the !RoboRIO.  Examine the PWM ports and identify which row of pins are ground ([[Image(GroundSymbol.png,25px)]], +6V, and Signal (S).  Make sure you connect them to the proper pins on the Servo motor: black or brown goes to Ground, red or orange goes to +6V, yellow/white/blue goes to Signal.  You can read more about servo motors [https://learn.sparkfun.com/tutorials/servo-trigger-hookup-guide/all here]
    8383
    8484Create another program using the !TimedRobot java template and name it !ServoTest. Modify the generated code as follows:
     
    116116
    117117== Fourth program: DC Motor Control
    118 
    119 Create another program using the !TimedRobot java template and name it !MotorTest.
    120 The motor controller Class is provided by a third party so you need to add the vendor library to the project:
     118For stronger and faster movement, FRC robots use all sorts of motors.  There are large motors that propel the robot, small motors that drive flywheel or manipulators, etc.  Most DC motors use more power than can be supplied directly from the !RoboRIO so instead the roboRIO communicates with a dedicated high-power motor controller and tells it how fast and in which direction to move the motor.  FRC robots support several types of motor controllers; a common and powerful controller is the [https://www.andymark.com/products/talon-srx-speed-controller Talon SRX] often called a CAN Talon.
     119
     120Create another program using the !TimedRobot java template and name it !MotorTest.
     121 
     122The motor controller Class is provided by a third party (Cross The Road Electronics aka CTRE); the team laptops already have the CTRE framework installed; if your laptop does not, you can download and install it [http://www.ctr-electronics.com/control-system/hro.html#product_tabs_technical_resources here].  To use the library, you need to add it to the project:
    121123* WPILib->Manage Vendor Libraries
    122124* -> Install new library (offline)
    123 * -> Select ctre Phoneix library  (or similar)
     125* -> Select ctre phoneix library  (or similar)
    124126
    125127Modify the generated code as follows: