-
Notifications
You must be signed in to change notification settings - Fork 0
PID Control
This functionality requires using the sensor struct. See how to use that here.
A PID control, or a Proportional Integral Derivative control, is a way to accurately control the motion of your robot. For a more thorough explanation, check out this video. This library provides a variety of methods to help use a PID control.
First, create a struct of type pid
. This stores the PID constants: kp
, ki
, and kd
(Read on to discover how to set these values). These are floats. If a constant is not initialized it will be automatically set to 0.
Next, this pid
struct must be bound to a sensor in order for it to be useful. To do this, initialize the sensor with a pointer to the pid struct. You can read more about sensors here.
Your sensor is now set up with the relevant PID constants and can be used with the included PID methods.
pid PID;
pid.kp = 0.1;
pid.kd = 0.1;
sensor Sensor;
initializeSensor(&Sensor, 1.0, dgtl1, &PID); //Notice that the PID struct is added as an additional argument.
Beginner Features:
Intermediate Features:
Advanced Features:
Controlling the LCD
Using Autonomous Modes
Custom Pre Auton Procedure
Using Autonomous Modes in User Control
More Remote Functionality
Configuring Bailout Button
Custom User Control Procedure
PID Control
Drive Train Control