TRC Library for FTC (2011) 2011
TRC Library Code Project

C:/Users/Michael/Ftc/2011/code/trclib/piddrive.h File Reference

Go to the source code of this file.

Data Structures

struct  PIDDRIVE


#define _PIDDRIVE_H
#define PIDDRIVEF_PIDMODE_ON   0x0100
#define PIDDRIVEF_USER_MASK   0x00ff


void PIDDriveEvent (__in PIDDRIVE &pidDrive)
void PIDDriveReset (__out PIDDRIVE &pidDrive)
void PIDDriveInit (__out PIDDRIVE &pidDrive, __in int drive, __in int drivePIDCtrl, __in int turnPIDCtrl, __in int pidDriveFlags)
void PIDDriveSetTarget (__out PIDDRIVE &pidDrive, __in float distSetPoint, __in float distTolerance, __in float angleSetPoint, __in float angleTolerance, __in bool fStopOnTarget)
void PIDDriveTask (__inout PIDDRIVE &pidDrive)

Define Documentation

#define _PIDDRIVE_H

Definition at line 17 of file piddrive.h.


Definition at line 24 of file piddrive.h.


Definition at line 32 of file piddrive.h.

#define PIDDRIVEF_PIDMODE_ON   0x0100

Definition at line 29 of file piddrive.h.


Definition at line 30 of file piddrive.h.

#define PIDDRIVEF_USER_MASK   0x00ff

Definition at line 31 of file piddrive.h.

Function Documentation

void PIDDriveEvent ( __in PIDDRIVE pidDrive)
void PIDDriveInit ( __out PIDDRIVE pidDrive,
__in int  drive,
__in int  drivePIDCtrl,
__in int  turnPIDCtrl,
__in int  pidDriveFlags 

This function initializes the drive system.

pidDrivePoints to the PIDDRIVE structure to be initialized.
drivePoints to the DRIVE structure.
drivePIDCtrlPoints to the PIDCTRL structure for drive.
turnPIDCtrlPoints to the PIDCTRL structure for turn.
pidDriveFlagsSpecifies the drive flags.

Definition at line 93 of file piddrive.h.

void PIDDriveReset ( __out PIDDRIVE pidDrive)

This function resets the PID Drive system.

pidDrivePoints to the PIDDRIVE structure to be reset.

Definition at line 62 of file piddrive.h.

void PIDDriveSetTarget ( __out PIDDRIVE pidDrive,
__in float  distSetPoint,
__in float  distTolerance,
__in float  angleSetPoint,
__in float  angleTolerance,
__in bool  fStopOnTarget 

This function sets PID drive target with the given drive distance and turn angle setpoints.

pidDrivePoints to the PIDDRIVE structure.
distSetPointSpecifies the target distance to travel.
distToleranceSpecifies the distance tolerance when determining OnTarget.
angleSetPointSpecifies the target angle to turn.
angleToleranceSpecifies the angle tolerance when determining OnTarget.
fStopOnTargetIf true, stop PIDDrive when target is reached. Otherwise, continue to monitor the target and readjust if necessary.

Definition at line 132 of file piddrive.h.

void PIDDriveTask ( __inout PIDDRIVE pidDrive)

This function performs the PID drive.

pidDrivePoints to the PIDDRIVE structure.

Definition at line 174 of file piddrive.h.

 All Data Structures Files Functions Variables Defines