blmc_drivers
blmc_drivers::SineTorqueControl Class Reference

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

#include <sine_torque_control.hpp>

Public Member Functions

 SineTorqueControl (std::vector< SafeMotor_ptr > motor_list)
 Construct a new SineTorqueControl object. More...
 
 ~SineTorqueControl ()
 Destroy the SineTorqueControl object.
 
void start_loop ()
 This method is a helper to start the thread loop.
 
void stop_loop ()
 Stop the control and dump the data.
 

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< SafeMotor_ptrmotor_list_
 This is list of motors.
 
real_time_tools::RealTimeThread rt_thread_
 This is the real time thread object.
 
bool stop_loop_
 managing the stopping of the loop
 
unsigned memory_buffer_size_
 memory_buffer_size_ is the max size of the memory buffer.
 
std::vector< std::deque< double > > encoders_
 Encoder data.
 
std::vector< std::deque< double > > velocities_
 Velocity data.
 
std::vector< std::deque< double > > currents_
 current data
 
std::vector< std::deque< double > > control_buffer_
 control_buffer_
 

Detailed Description

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

Constructor & Destructor Documentation

◆ SineTorqueControl()

blmc_drivers::SineTorqueControl::SineTorqueControl ( std::vector< SafeMotor_ptr motor_list)
inline

Construct a new SineTorqueControl object.

Parameters
motor_slider_pairs

Member Function Documentation

◆ loop()

void blmc_drivers::SineTorqueControl::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: