blmc_drivers
blmc_drivers::PDController Class Reference

This is a basic PD controller to be used in the demos of this package. More...

#include <pd_control.hpp>

Public Member Functions

 PDController (std::vector< PairMotorSlider > motor_slider_pairs)
 Construct a new PDController object. More...
 
 ~PDController ()
 Destroy the PDController object.
 
void start_loop ()
 This method is a helper to start the thread loop.
 

Private Member Functions

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

Static Private 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 Attributes

std::vector< PairMotorSlidermotor_slider_pairs_
 This is a pair of motor and sliders so that we associate one with the other.
 
real_time_tools::RealTimeThread rt_thread_
 This is the real time thread object.
 
bool stop_loop
 managing the stopping of the loop
 

Detailed Description

This is a basic PD controller to be used in the demos of this package.

Constructor & Destructor Documentation

◆ PDController()

blmc_drivers::PDController::PDController ( std::vector< PairMotorSlider motor_slider_pairs)
inline

Construct a new PDController object.

Parameters
motor_slider_pairs

Member Function Documentation

◆ loop()

void blmc_drivers::PDController::loop ( )
private

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 files: