Skip to content

Commit

Permalink
Fixed default gear ratio value precision
Browse files Browse the repository at this point in the history
  • Loading branch information
dzid26 committed Dec 1, 2023
1 parent a25ebd9 commit d14105d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions firmware/src/BSP/actuator_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ float volatile gearing_ratio;
float volatile actuatorTq_to_current;
float volatile current_to_actuatorTq;

//todo move these parameters to NVRAM
//specify motor parameters here:
// todo move these parameters to NVRAM
// specify motor parameters here:
const uint16_t rated_current = 1300; //mA
const uint16_t rated_torque = 45; //cNm

Expand All @@ -39,9 +39,9 @@ const uint16_t phase_L = 3; //Henry
const uint16_t motor_k_bemf = 1765; // mV/(rev/s)


//specify gearing parameters here:
const float motor_gearbox_ratio = 5+2/11; //gearbox ratio - enter planetary gearbox tooth calculation for best accuracy
const float final_drive_ratio = 2; //assembly gearing ratio
// specify gearing parameters here:
const float motor_gearbox_ratio = 5.0F+(2.0F/11.0F); // gearbox ratio - enter planetary gearbox tooth calculation for best accuracy
const float final_drive_ratio = 2.0F; // assembly gearing ratio

const int8_t anticogging_factor = 30; //minimizes cogging under load (0-127)

Expand All @@ -51,6 +51,6 @@ void update_actuator_parameters(void){
actuatorTq_to_current = (float) rated_current / rated_torque * 100 / gearing_ratio;
current_to_actuatorTq = 1 / actuatorTq_to_current;

closeLoopMaxDes = 2000U; //sets maximum close loop current [mA] to limit stresses and heat generation
closeLoopMaxDes = 2000U; // posiiton control maximum close loop current [mA] to limit stresses and heat generation

}

0 comments on commit d14105d

Please sign in to comment.