DCAITI Robot Hardware  1.0
Public Member Functions | Public Attributes | List of all members
Motor Class Reference

#include <MotorWheel.h>

Inheritance diagram for Motor:
Inheritance graph
[legend]
Collaboration diagram for Motor:
Collaboration graph
[legend]

Public Member Functions

 Motor (unsigned char _pinPWM, unsigned char _pinDir, unsigned char _pinIRQ, unsigned char _pinIRQB, struct ISRVars *_isr)
 
void setupInterrupt ()
 
unsigned char getPinPWM () const
 
unsigned char getPinDir () const
 
unsigned char getPinIRQ () const
 
unsigned char getPinIRQB () const
 
unsigned int runPWM (unsigned int PWM, bool dir, bool saveDir=true)
 
unsigned int getPWM () const
 
unsigned int advancePWM (unsigned int PWM)
 
unsigned int backoffPWM (unsigned int PWM)
 
bool setDesiredDir (bool dir)
 
bool getDesiredDir () const
 
bool reverseDesiredDir ()
 
bool setCurrDir ()
 
bool getCurrDir () const
 
int getSpeedRPM () const
 
unsigned int setSpeedRPM (int speedRPM, bool dir)
 
int setSpeedRPM (int speedRPM)
 
bool PIDSetup (float kc=KC, float taui=TAUI, float taud=TAUD, unsigned int sampleTime=1000)
 
bool PIDGetStatus () const
 
bool PIDEnable (float kc=KC, float taui=TAUI, float taud=TAUD, unsigned int sampleTime=1000)
 
bool PIDDisable ()
 
bool PIDReset ()
 
bool PIDRegulate (bool doRegulate=true)
 
unsigned int PIDSetSpeedRPMDesired (unsigned int speedRPM)
 
unsigned int PIDGetSpeedRPMDesired () const
 
void delayMS (unsigned int ms, bool debug=false)
 
void debugger () const
 
int getSpeedPPS () const
 
long getCurrPulse () const
 
long setCurrPulse (long _pulse)
 
long resetCurrPulse ()
 
- Public Member Functions inherited from PID
 PID (int *, int *, int *, float, float, float)
 
 PID (int *, int *, int *, int *, float, float, float)
 
void SetMode (int Mode)
 
void Compute ()
 
void SetInputLimits (int, int)
 
void SetOutputLimits (int, int)
 
void SetTunings (float, float, float)
 
void SetSampleTime (int)
 
void Reset ()
 
bool JustCalculated ()
 
int GetMode ()
 
int GetINMin ()
 
int GetINMax ()
 
int GetOUTMin ()
 
int GetOUTMax ()
 
int GetSampleTime ()
 
float GetP_Param ()
 
float GetI_Param ()
 
float GetD_Param ()
 

Public Attributes

struct ISRVarsisr
 

Constructor & Destructor Documentation

◆ Motor()

Motor::Motor ( unsigned char  _pinPWM,
unsigned char  _pinDir,
unsigned char  _pinIRQ,
unsigned char  _pinIRQB,
struct ISRVars _isr 
)
Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ advancePWM()

unsigned int Motor::advancePWM ( unsigned int  PWM)
Here is the call graph for this function:

◆ backoffPWM()

unsigned int Motor::backoffPWM ( unsigned int  PWM)
Here is the call graph for this function:

◆ debugger()

void Motor::debugger ( ) const
Here is the caller graph for this function:

◆ delayMS()

void Motor::delayMS ( unsigned int  ms,
bool  debug = false 
)
Here is the call graph for this function:

◆ getCurrDir()

bool Motor::getCurrDir ( ) const
Here is the caller graph for this function:

◆ getCurrPulse()

long Motor::getCurrPulse ( ) const
Here is the caller graph for this function:

◆ getDesiredDir()

bool Motor::getDesiredDir ( ) const
Here is the caller graph for this function:

◆ getPinDir()

unsigned char Motor::getPinDir ( ) const

◆ getPinIRQ()

unsigned char Motor::getPinIRQ ( ) const

◆ getPinIRQB()

unsigned char Motor::getPinIRQB ( ) const
Here is the caller graph for this function:

◆ getPinPWM()

unsigned char Motor::getPinPWM ( ) const

◆ getPWM()

unsigned int Motor::getPWM ( ) const
Here is the caller graph for this function:

◆ getSpeedPPS()

int Motor::getSpeedPPS ( ) const

◆ getSpeedRPM()

int Motor::getSpeedRPM ( ) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PIDDisable()

bool Motor::PIDDisable ( )
Here is the caller graph for this function:

◆ PIDEnable()

bool Motor::PIDEnable ( float  kc = KC,
float  taui = TAUI,
float  taud = TAUD,
unsigned int  sampleTime = 1000 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PIDGetSpeedRPMDesired()

unsigned int Motor::PIDGetSpeedRPMDesired ( ) const
Here is the caller graph for this function:

◆ PIDGetStatus()

bool Motor::PIDGetStatus ( ) const
Here is the caller graph for this function:

◆ PIDRegulate()

bool Motor::PIDRegulate ( bool  doRegulate = true)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PIDReset()

bool Motor::PIDReset ( )
Here is the call graph for this function:

◆ PIDSetSpeedRPMDesired()

unsigned int Motor::PIDSetSpeedRPMDesired ( unsigned int  speedRPM)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PIDSetup()

bool Motor::PIDSetup ( float  kc = KC,
float  taui = TAUI,
float  taud = TAUD,
unsigned int  sampleTime = 1000 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ resetCurrPulse()

long Motor::resetCurrPulse ( )
Here is the call graph for this function:

◆ reverseDesiredDir()

bool Motor::reverseDesiredDir ( )
Here is the call graph for this function:

◆ runPWM()

unsigned int Motor::runPWM ( unsigned int  PWM,
bool  dir,
bool  saveDir = true 
)
Here is the caller graph for this function:

◆ setCurrDir()

bool Motor::setCurrDir ( )
Here is the call graph for this function:

◆ setCurrPulse()

long Motor::setCurrPulse ( long  _pulse)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setDesiredDir()

bool Motor::setDesiredDir ( bool  dir)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setSpeedRPM() [1/2]

int Motor::setSpeedRPM ( int  speedRPM)
Here is the call graph for this function:

◆ setSpeedRPM() [2/2]

unsigned int Motor::setSpeedRPM ( int  speedRPM,
bool  dir 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setupInterrupt()

void Motor::setupInterrupt ( )
Here is the caller graph for this function:

Member Data Documentation

◆ isr

struct ISRVars* Motor::isr

The documentation for this class was generated from the following files: