blmc_drivers
Controller Class Reference

This is a simple PD control on one motor and one slider. More...

Public Member Functions

 Controller (std::shared_ptr< blmc_drivers::Motor > motor, std::shared_ptr< blmc_drivers::AnalogSensor > analog_sensor)
 Construct a new Controller object. More...
 
void start_loop ()
 main control loop
 

Static Public Member Functions

static THREAD_FUNCTION_RETURN_TYPE loop (void *instance_pointer)
 this function is just a wrapper around the actual loop function, such that it can be spawned as a posix thread.
 

Private Member Functions

void loop ()
 this is a simple control loop which runs at a kilohertz. More...
 

Private Attributes

std::shared_ptr< blmc_drivers::Motormotor_
 one motor.
 
std::shared_ptr< blmc_drivers::AnalogSensoranalog_sensor_
 one slider.
 
real_time_tools::RealTimeThread rt_thread_
 the realt time thread object.
 

Detailed Description

This is a simple PD control on one motor and one slider.

Constructor & Destructor Documentation

◆ Controller()

Controller::Controller ( std::shared_ptr< blmc_drivers::Motor motor,
std::shared_ptr< blmc_drivers::AnalogSensor analog_sensor 
)
inline

Construct a new Controller object.

Parameters
motor
analog_sensor

Member Function Documentation

◆ loop()

void Controller::loop ( )
inlineprivate

this is a simple control loop which runs at a kilohertz.

it reads the measurement from the analog sensor, in this case the slider. then it scales it and sends it as the current target to the motor.


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