From b56d6c92dba20eebc5061b8e599febd775f5b9ac Mon Sep 17 00:00:00 2001 From: Oskar Weigl Date: Tue, 16 May 2017 17:42:56 -0700 Subject: [PATCH] make pole pairs param named --- MotorControl/low_level.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MotorControl/low_level.c b/MotorControl/low_level.c index 6d51aa0c..329beb7d 100755 --- a/MotorControl/low_level.c +++ b/MotorControl/low_level.c @@ -37,7 +37,8 @@ float vbus_voltage = 12.0f; // TODO stick parameter into struct #define ENCODER_CPR (600*4) -static float elec_rad_per_enc = 7.0 * 2 * M_PI * (1.0f / (float)ENCODER_CPR); +#define POLE_PAIRS 7 +static float elec_rad_per_enc = POLE_PAIRS * 2 * M_PI * (1.0f / (float)ENCODER_CPR); // TODO: Migrate to C++, clearly we are actually doing object oriented code here... // TODO: For nice encapsulation, consider not having the motor objects public