ACS Firmware Documentation
Attitude Control System Capstone 2018 for OreSat
Data Fields
bldc Struct Reference

The structure that defines and characterizes a motor and how it's being control. More...

#include <bldc.h>

Data Fields

uint16_t count
 
uint16_t scale
 period counter More...
 
uint16_t steps
 scales the duty cycle More...
 
uint16_t stretch
 number of steps in lut More...
 
uint16_t skip
 
sinctrl_t u
 
sinctrl_t v
 
sinctrl_t w
 
sinctrl_t phase_shift
 signals More...
 
uint16_t current_sin_u
 should be by 120 degrees More...
 
uint16_t next_sin_u
 
uint16_t current_sin_v
 
uint16_t next_sin_v
 
uint16_t current_sin_w
 
uint16_t next_sin_w
 
uint8_t stretch_count
 
uint8_t sin_diff
 
uint16_t position
 
bool openLoop
 
sinctrl_t const * sinctrl
 
uint16_t spi_rxbuf [2]
 
thread_t * p_spi_thread
 
adcsample_t samples [ADC_GRP_NUM_CHANNELS *ADC_GRP_BUF_DEPTH]
 
int started
 

Detailed Description

The structure that defines and characterizes a motor and how it's being control.

steps: Steps in the LUT

stretch: How many steps are added in between LUT steps

skip: How many steps are skipped in the LUT

u, v, and w: The three sin signals, that traverse through the LUT current_sin_u,v,w and next_sin_u,v,w: Used in calculation of values for stretch

sin_diff: Difference in LUT steps for stretch

position: Position from encode, a value of 0 - 2^14

openLoop: Controls whether encoder feedback is used

sinctrl: The LUT

spi_rxbuff: Where the encoder position is after SPI transmission

p_spi_thread: Spi thread for the encoder feedback

samples: Samples from the ADC.

Field Documentation

◆ count

uint16_t bldc::count

◆ current_sin_u

uint16_t bldc::current_sin_u

should be by 120 degrees

◆ current_sin_v

uint16_t bldc::current_sin_v

◆ current_sin_w

uint16_t bldc::current_sin_w

◆ next_sin_u

uint16_t bldc::next_sin_u

◆ next_sin_v

uint16_t bldc::next_sin_v

◆ next_sin_w

uint16_t bldc::next_sin_w

◆ openLoop

bool bldc::openLoop

◆ p_spi_thread

thread_t* bldc::p_spi_thread

◆ phase_shift

sinctrl_t bldc::phase_shift

signals

◆ position

uint16_t bldc::position

◆ samples

adcsample_t bldc::samples[ADC_GRP_NUM_CHANNELS *ADC_GRP_BUF_DEPTH]

◆ scale

uint16_t bldc::scale

period counter

◆ sin_diff

uint8_t bldc::sin_diff

◆ sinctrl

sinctrl_t const* bldc::sinctrl

◆ skip

uint16_t bldc::skip

◆ spi_rxbuf

uint16_t bldc::spi_rxbuf[2]

◆ started

int bldc::started

◆ steps

uint16_t bldc::steps

scales the duty cycle

◆ stretch

uint16_t bldc::stretch

number of steps in lut

◆ stretch_count

uint8_t bldc::stretch_count

◆ u

sinctrl_t bldc::u

◆ v

sinctrl_t bldc::v

◆ w

sinctrl_t bldc::w

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