#include <MotorControl.h>
Constructor of class MotorControl.
- Parameters
-
motor | which will be regulated |
encoder | with information about the motor movements |
config | structConfig} |
float nxpcup::MotorControl::actualSpeed |
( |
| ) |
const |
|
inline |
Get actual speed.
- Returns
- internal state of variable actual speed in [m/s]
Config nxpcup::MotorControl::config |
( |
| ) |
const |
|
inline |
Get the actual configuration of theMotorControl}.
float nxpcup::MotorControl::desiredSpeed |
( |
| ) |
const |
|
inline |
Get desire speed.
- Returns
- internal state of variable desire speed in [m/s]
void nxpcup::MotorControl::regulate |
( |
uint16_t |
timeSinceLastCallUs | ) |
|
|
inline |
Calculate and set new power for motor.
Take actual speed from encoder and required speed -> calculate error -> update power.
- Parameters
-
timeSinceLastCallUs | time in microseconds from last call this function (NOT USED) |
void nxpcup::MotorControl::reset |
( |
| ) |
|
|
inline |
Reset the whole regulator.
void nxpcup::MotorControl::setConfig |
( |
Config & |
config | ) |
|
|
inline |
Set new configuration forMotorControl}.
- Parameters
-
void nxpcup::MotorControl::setSpeed |
( |
float |
desiredSpeed | ) |
|
|
inline |
Set desired speed.
- Parameters
-
The documentation for this class was generated from the following file: