feedback struct first left, seconds value right
This commit is contained in:
parent
7bc84cf3e0
commit
fc5f5a26ca
|
@ -8,6 +8,8 @@
|
||||||
|
|
||||||
// ############################### DO-NOT-TOUCH SETTINGS ###############################
|
// ############################### DO-NOT-TOUCH SETTINGS ###############################
|
||||||
|
|
||||||
|
#define N_POLEPAIRS 15 //for wheel angle calculation
|
||||||
|
|
||||||
#define PWM_FREQ 16000 // PWM frequency in Hz
|
#define PWM_FREQ 16000 // PWM frequency in Hz
|
||||||
#define DEAD_TIME 32 // PWM deadtime
|
#define DEAD_TIME 32 // PWM deadtime
|
||||||
#define DELAY_IN_MAIN_LOOP 5 // in ms. default 5. it is independent of all the timing critical stuff. do not touch if you do not know what you are doing.
|
#define DELAY_IN_MAIN_LOOP 5 // in ms. default 5. it is independent of all the timing critical stuff. do not touch if you do not know what you are doing.
|
||||||
|
|
12
Src/main.c
12
Src/main.c
|
@ -85,10 +85,10 @@ typedef struct{
|
||||||
uint16_t start;
|
uint16_t start;
|
||||||
int16_t cmd1;
|
int16_t cmd1;
|
||||||
int16_t cmd2;
|
int16_t cmd2;
|
||||||
int16_t speedR;
|
|
||||||
int16_t speedL;
|
int16_t speedL;
|
||||||
int16_t speedR_meas;
|
int16_t speedR;
|
||||||
int16_t speedL_meas;
|
int16_t speedL_meas;
|
||||||
|
int16_t speedR_meas;
|
||||||
int16_t batVoltage;
|
int16_t batVoltage;
|
||||||
int16_t boardTemp;
|
int16_t boardTemp;
|
||||||
int16_t curL_DC;
|
int16_t curL_DC;
|
||||||
|
@ -483,10 +483,12 @@ int main(void) {
|
||||||
Feedback.start = (uint16_t)START_FRAME;
|
Feedback.start = (uint16_t)START_FRAME;
|
||||||
Feedback.cmd1 = (int16_t)cmd1;
|
Feedback.cmd1 = (int16_t)cmd1;
|
||||||
Feedback.cmd2 = (int16_t)cmd2;
|
Feedback.cmd2 = (int16_t)cmd2;
|
||||||
Feedback.speedR = (int16_t)speedR;
|
|
||||||
Feedback.speedL = (int16_t)speedL;
|
Feedback.speedL = (int16_t)speedL;
|
||||||
Feedback.speedR_meas = (int16_t)rtY_Left.n_mot;
|
Feedback.speedR = (int16_t)speedR;
|
||||||
Feedback.speedL_meas = (int16_t)rtY_Right.n_mot;
|
Feedback.speedL_meas = (int16_t)rtY_Left.n_mot;
|
||||||
|
Feedback.speedR_meas = (int16_t)rtY_Right.n_mot;
|
||||||
|
//Feedback.angleL_meas = (int16_t)rtY_Left.a_elecAngle/N_POLEPAIRS;
|
||||||
|
//Feedback.angleR_meas = (int16_t)rtY_Right.a_elecAngle/N_POLEPAIRS;
|
||||||
Feedback.batVoltage = (int16_t)(batVoltage * BAT_CALIB_REAL_VOLTAGE / BAT_CALIB_ADC);
|
Feedback.batVoltage = (int16_t)(batVoltage * BAT_CALIB_REAL_VOLTAGE / BAT_CALIB_ADC);
|
||||||
Feedback.boardTemp = (int16_t)board_temp_deg_c;
|
Feedback.boardTemp = (int16_t)board_temp_deg_c;
|
||||||
Feedback.curL_DC = (int16_t)curL_DC*10/A2BIT_CONV*100; //in milli Amperes, 100mA resolution
|
Feedback.curL_DC = (int16_t)curL_DC*10/A2BIT_CONV*100; //in milli Amperes, 100mA resolution
|
||||||
|
|
Loading…
Reference in New Issue