Classes | Public Member Functions | Private Attributes
MultiLoopController Class Reference

#include <MultiLoopController.h>

List of all members.

Classes

struct  MultiLoopParams

Public Member Functions

double currentLoop (double desiredCurrent, double actualVelocity, double busVoltage)
 perform the current loop calculations
const MultiLoopParamsgetMultiLoopParameters () const
 MultiLoopController ()
 MultiLoopController (const MultiLoopController &mlc_in)
void reset ()
void setCurrentLoopParameters (double minCurrent, double maxCurrent, double maxDutyCycle, bool bypass=false)
 set the curent loop parameters
void setHardwareParameters (double motorViscousDampingCompensation, double motorInertia, double motorTorqueConstant, double motorPhaseResistance, double motorBackEMFConstant, double motorInductance, double motionRatio, double PWMFreq, double bridgeDeadTime, double bridgeSwitchTime)
 set the hardware parameters
void setLoopRate (double loopRate)
 set the loop rate to use for calculations
void setMultiLoopParameters (const MultiLoopParams &mlp_in)
void setPositionLoopParameters (double minPosition, double maxPosition, double Kp, bool bypass=false)
 set the position loop parameters
void setTorqueLoopParameters (double minTension, double maxTension, double Kp, double offset, bool bypass=false)
 set the torque loop parameters
void setVelocityLoopParameters (double minVelocity, double maxVelocity, double Kp, double Ki, double integratorWindupLimit, bool bypass=false)
 set the velocity loop parameters
double update (double desiredPosition, double actualPosition, double actualVelocity, double busVoltage, double &desiredVelocity)
 update run through the multiloop controller based on the given inputs
double update (double desiredPosition, double kTendon, double actualPosition, double actualTension, double actualVelocity, double busVoltage, double &desiredVelocity)
 update run through the multiloop controller based on the given inputs
double velocityLoop (double desiredVelocity, double actualVelocity, double busVoltage, double &limitedVelocity)
 these loops are broken out and public for testing purposes, update should be the primary interface
virtual ~MultiLoopController ()

Private Attributes

double busVoltageRatio
MultiLoopParams coeffs
bool currentLoopSet
bool hardwareSet
bool loopRateSet
bool positionLoopSet
double previousDesiredCurrent
double previousDesiredVelocity
bool ready
bool torqueLoopSet
double velocityLoopIntegrator
bool velocityLoopSet

Detailed Description

Definition at line 12 of file MultiLoopController.h.


Constructor & Destructor Documentation

Definition at line 5 of file MultiLoopController.cpp.

Definition at line 20 of file MultiLoopController.cpp.

virtual MultiLoopController::~MultiLoopController ( ) [inline, virtual]

Definition at line 17 of file MultiLoopController.h.


Member Function Documentation

double MultiLoopController::currentLoop ( double  desiredCurrent,
double  actualVelocity,
double  busVoltage 
)

perform the current loop calculations

Exceptions:
std::runtime_errorif busVoltage == 0

Current Loop

Limit dutyCycle

Definition at line 287 of file MultiLoopController.cpp.

Definition at line 117 of file MultiLoopController.h.

void MultiLoopController::reset ( ) [inline]

Definition at line 114 of file MultiLoopController.h.

void MultiLoopController::setCurrentLoopParameters ( double  minCurrent,
double  maxCurrent,
double  maxDutyCycle,
bool  bypass = false 
)

set the curent loop parameters

Exceptions:
std::runtime_errorif minCurrent > maxCurrent
std::runtime_errorif maxDutyCycle < 0

Definition at line 194 of file MultiLoopController.cpp.

void MultiLoopController::setHardwareParameters ( double  motorViscousDampingCompensation,
double  motorInertia,
double  motorTorqueConstant,
double  motorPhaseResistance,
double  motorBackEMFConstant,
double  motorInductance,
double  motionRatio,
double  PWMFreq,
double  bridgeDeadTime,
double  bridgeSwitchTime 
)

set the hardware parameters

Exceptions:
std::runtime_errorif motorTorqueConstant == 0
std::runtime_errorif motionRatio == 0
std::runtime_errorif (1. - 2. * PWMFreq * bridgeDeadTime) == 0.

Definition at line 219 of file MultiLoopController.cpp.

void MultiLoopController::setLoopRate ( double  loopRate)

set the loop rate to use for calculations

Exceptions:
std::runtime_errorif looprate <= 0

Definition at line 115 of file MultiLoopController.cpp.

Definition at line 104 of file MultiLoopController.cpp.

void MultiLoopController::setPositionLoopParameters ( double  minPosition,
double  maxPosition,
double  Kp,
bool  bypass = false 
)

set the position loop parameters

Exceptions:
std::runtime_errorif minPosition > maxPosition

Definition at line 130 of file MultiLoopController.cpp.

void MultiLoopController::setTorqueLoopParameters ( double  minTension,
double  maxTension,
double  Kp,
double  offset,
bool  bypass = false 
)

set the torque loop parameters

Exceptions:
std::runtime_errorif minTension > maxTension

Definition at line 148 of file MultiLoopController.cpp.

void MultiLoopController::setVelocityLoopParameters ( double  minVelocity,
double  maxVelocity,
double  Kp,
double  Ki,
double  integratorWindupLimit,
bool  bypass = false 
)

set the velocity loop parameters

Exceptions:
std::runtime_errorif minVelocity > maxVelocity
std::runtime_errorif integratorWindupLimit < 0

Definition at line 167 of file MultiLoopController.cpp.

double MultiLoopController::update ( double  desiredPosition,
double  actualPosition,
double  actualVelocity,
double  busVoltage,
double &  desiredVelocity 
)

update run through the multiloop controller based on the given inputs

Parameters:
desiredPositionin posUnits
actualPositionin posUnits
actualVelocityin velUnits
busVoltagein volts
Returns:
dutycycle command
Exceptions:
std::runtime_errorif parameters have not been set

Force Control Loop

Todo:
insert later

Position Loop

Velocity Loop

Definition at line 36 of file MultiLoopController.cpp.

double MultiLoopController::update ( double  desiredPosition,
double  kTendon,
double  actualPosition,
double  actualTension,
double  actualVelocity,
double  busVoltage,
double &  desiredVelocity 
)

update run through the multiloop controller based on the given inputs

Parameters:
desiredPositionin posUnits
kTendonin posUnits per tensionUnit
actualPositionin posUnits
actualTensionin tensionUnits
actualVelocityin velUnits
busVoltagein volts
Returns:
dutycycle command
Exceptions:
std::runtime_errorif parameters have not been set

Force Control Loop

Position Loop

Velocity Loop

Definition at line 67 of file MultiLoopController.cpp.

double MultiLoopController::velocityLoop ( double  desiredVelocity,
double  actualVelocity,
double  busVoltage,
double &  limitedVelocity 
)

these loops are broken out and public for testing purposes, update should be the primary interface

perform the velocity loop calculations; limitedVelocity is limited version of desiredVelocity

Velocity Loop

Current Loop

Definition at line 259 of file MultiLoopController.cpp.


Member Data Documentation

Definition at line 169 of file MultiLoopController.h.

Definition at line 168 of file MultiLoopController.h.

Definition at line 177 of file MultiLoopController.h.

Definition at line 178 of file MultiLoopController.h.

Definition at line 173 of file MultiLoopController.h.

Definition at line 174 of file MultiLoopController.h.

Definition at line 171 of file MultiLoopController.h.

Definition at line 172 of file MultiLoopController.h.

Definition at line 179 of file MultiLoopController.h.

Definition at line 175 of file MultiLoopController.h.

Definition at line 170 of file MultiLoopController.h.

Definition at line 176 of file MultiLoopController.h.


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


robodyn_utilities
Author(s):
autogenerated on Thu Jun 6 2019 18:56:08