![]() |
Zap'Em Blast'Em Robots
robots that play laser tag!
|
Structure that defines the controller task. More...
#include <controller_task.h>
Data Fields | |
int32_t | dir |
int32_t | state |
int32_t | num_states |
uint32_t | chan1 |
uint32_t | chan2 |
int32_t | pot_zero |
int32_t | des_pos |
uint32_t | prev_time |
uint32_t | current_time |
uint32_t | prev_ticks |
float | k_p |
float | k_i |
uint32_t | adc_val |
int32_t | integral_error |
TIM_HandleTypeDef * | htim_encoder |
TIM_HandleTypeDef * | htim_dt |
ADC_HandleTypeDef * | hadc |
motor_t * | motor |
encoder_t * | encoder |
float | prev_error |
controller_fcn_t | state_list [] |
Structure that defines the controller task.
Contains all configuration, timing, control, and peripheral references needed to manage a motor control task using state functions.
uint32_t adc_val |
Current potentiometer ADC value
uint32_t chan1 |
Motor channel 1
uint32_t chan2 |
Motor channel 2
uint32_t current_time |
Current time reading
int32_t des_pos |
Desired position in ticks
int32_t dir |
Direction of movement
encoder_t* encoder |
Pointer to encoder object
ADC_HandleTypeDef* hadc |
ADC handle for potentiometer
TIM_HandleTypeDef* htim_dt |
Timer for delta time calc
TIM_HandleTypeDef* htim_encoder |
Timer for encoder ticks
int32_t integral_error |
Integrated error term
float k_i |
Integral gain
float k_p |
Proportional gain
motor_t* motor |
Pointer to motor object
int32_t num_states |
Total number of states
int32_t pot_zero |
Zero offset from ADC pot
float prev_error |
Previous PID error
uint32_t prev_ticks |
Last encoder tick value
uint32_t prev_time |
Previous time reading
int32_t state |
Current state index
controller_fcn_t state_list[] |
Function pointer list for states