Changes between Version 6 and Version 7 of MotorControl


Ignore:
Timestamp:
Feb 24, 2016, 1:19:38 PM (9 years ago)
Author:
benjialbert
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • MotorControl

    v6 v7  
    2424
    2525__PID Control__
    26 Closed-loop motor control (including the Talons) typically uses PID control loops to achieve the mechanism's control objectives: balancing responsiveness with stability.  PID control considers 3 factors (P, I, D) when deciding how to adjust motor power to balance responsiveness (how fast the motor responds to changes) with stability (not over/under shooting the target).  Because motors drive different mechanisms with different loads, inertia, speeds, and responsiveness requirements, you must tune the PID factors properly for each Talon when you configure it for close-loop control; this email discusses in plain language what that means.
     26Closed-loop motor control (including the Talons) typically uses PID control loops to achieve the mechanism's control objectives: balancing responsiveness with stability.  PID control considers 3 factors (P, I, D) when deciding how to adjust motor power to balance responsiveness (how fast the motor responds to changes) with stability (not over/under shooting the target).  Because motors drive different mechanisms with different loads, inertia, speeds, and responsiveness requirements, you must tune the PID factors properly for each Talon when you configure it for close-loop control; this page discusses in plain language what that means.
    2727
    2828__The problems PID is intended to solve__
     
    3434
    3535__What PID means__
    36 PID is used to balance responsiveness and stability using 3 factors (P, I, D) that you can tune.  When you configure your talon for closed loop control, you will need to set those 3 factors.  There is no perfect setting, it's always going to be a trade off between responsiveness and stability, but you should experiment with different values to tune your mechanism properly (there are also mathematical approaches to tuning that I will not address here).
     36PID is used to balance responsiveness and stability using factors P, I, D, and sometimes F that you can tune.  When you configure your talon for closed loop control, you will need to set those 3 factors.  There is no perfect setting, it's always going to be a trade off between responsiveness and stability, but you should experiment with different values to tune your mechanism properly (there are also mathematical approaches to tuning that I will not address here).
    3737
    3838   * Proportion (P): Power is increased/decreased in proportion to how far the last measurement was from its goal (i.e. the instantaneous error): if far from goal, add a lot of power, if close to goal, add a little power).  Adjusting P determines how responsive the system is.
    3939   * Integral (I): Power is increased/decreased in proportion to the average size and duration of the error: this accelerates movement towards the goal, increasing responsiveness, but increasing the tendency to overshoot goals (instability).
    4040   * Derivative (D): Power is increased/decreased in proportion to the rate at which the motor is approaching its goal (i.e. if the motor is not closing in fast enough, increase power, if it is closing in fast, decrease power); D increases stability by slowing the motor as it approaches its goal; this lets you increase P and I (responsiveness) without making the system unstable.
     41   * FeedForward (F): Adds a constant to the output to keep it from going to zero
    4142
    42 PID control loops are an important concept and the basics are explained in [https://en.wikipedia.org/wiki/PID_controller Wikipedia] and [http://www.expertune.com/tutor.aspx this tutorial] and [http://www.csimn.com/CSI_pages/PIDforDummies.html PID for Dummies].
     43PID control loops are an important concept and the basics are explained in [https://en.wikipedia.org/wiki/PID_controller Wikipedia] and [http://www.expertune.com/tutor.aspx this tutorial] and [http://www.csimn.com/CSI_pages/PIDforDummies.html PID for Dummies].  You can implement a PID control loop using the Talon SRX; you should refer to the [https://www.ctr-electronics.com/Talon%20SRX%20Software%20Reference%20Manual.pdf Talon software manual] section 12.4 (page 75) for a detailed explanation of how to configure the Talon for PID control with Java example code.  In cases where PID control can't be implemented via the TalonSRX (e.g. for a non-Talon-controlled motor or when the feedback mechanism can't connect to the Talon), the RoboRio can also implement PID control using the PIDController and PIDSubsystem classes; see [https://wpilib.screenstepslive.com/s/4485/m/13809/l/241901-pidsubsystems-for-built-in-pid-control here] and [http://cntsoftware.com/robotics/pdf/WPILib_programming.pdf here], and [https://www.assembla.com/spaces/rbhsrobotics/documents/cS2tESqASr45PGacwqjQYw/download/cS2tESqASr45PGacwqjQYw# here].
     44
     45[http://www.orientalmotor.com/technology/articles/motor-sizing-calculations.html Motor Sizing Calculations]