From 40e076b5e542cd86d92067aa797ce9b2a815c439 Mon Sep 17 00:00:00 2001 From: Oskar Weigl Date: Sat, 19 Aug 2017 23:05:24 -0700 Subject: [PATCH 1/5] fix resistance measurement factor 2 error --- MotorControl/low_level.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MotorControl/low_level.c b/MotorControl/low_level.c index aa553f9d..43dc7df5 100755 --- a/MotorControl/low_level.c +++ b/MotorControl/low_level.c @@ -823,7 +823,7 @@ static bool measure_phase_resistance(Motor_t* motor, float test_current, float m motor->error = ERROR_PHASE_RESISTANCE_MEASUREMENT_TIMEOUT; return false; } - float Ialpha = -0.5f * (motor->current_meas.phB + motor->current_meas.phC); + float Ialpha = -(motor->current_meas.phB + motor->current_meas.phC); test_voltage += (kI * CURRENT_MEAS_PERIOD) * (test_current - Ialpha); if (test_voltage > max_voltage) test_voltage = max_voltage; if (test_voltage < -max_voltage) test_voltage = -max_voltage; From 08df9f7e759781ba267ec14a31e4298aeedf0542 Mon Sep 17 00:00:00 2001 From: Oskar Weigl Date: Wed, 23 Aug 2017 19:28:56 -0700 Subject: [PATCH 2/5] Add style guidelines notes to README --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e37e9292..bbb02f08 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ There is also [ODriveFPGA](https://github.com/madcowswe/ODriveFPGA), which conta - [Communicating over USB](#communicating-over-usb) - [Generating startup code](#generating-startup-code) - [Setting up Eclipse development environment](#setting-up-eclipse-development-environment) +- [Notes for Contributors](#notes-for-contributors) @@ -224,8 +225,10 @@ There is an excellent project called CubeMX2Makefile, originally from baoshi. Th * Set beakpoints, step, hit Resume, etc. * Make some cool features! ;D +## Notes for Contributors +In general the project uses the [Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html), except that the default indendtation is 4 spaces, and that the 80 character limit is not very strictly enforced, merely encouraged. -## Code maintenance notes +### Code maintenance notes The cortex M4F processor has hardware single precision float unit. However double precision operations are not accelerated, and hence should be avoided. The following regex is helpful for cleaning out double constants: find: `([-+]?[0-9]+\.[0-9]+(?:[eE][-+]?[0-9]+)?)([^f0-9e])` replace: `\1f\2` From 2a727c6f2d62a61f813a9665dcc0c799f558e05d Mon Sep 17 00:00:00 2001 From: Oskar Weigl Date: Thu, 24 Aug 2017 22:43:06 -0700 Subject: [PATCH 3/5] always float motor after calibration --- MotorControl/low_level.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/MotorControl/low_level.c b/MotorControl/low_level.c index 43dc7df5..04bb308c 100755 --- a/MotorControl/low_level.c +++ b/MotorControl/low_level.c @@ -1257,9 +1257,7 @@ void motor_thread(void const * argument) { if (motor->do_calibration) { __HAL_TIM_MOE_ENABLE(motor->motor_timer);// enable pwm outputs motor_calibration(motor); - if(!motor->calibration_ok){ - __HAL_TIM_MOE_DISABLE_UNCONDITIONALLY(motor->motor_timer);// disables pwm outputs - } + __HAL_TIM_MOE_DISABLE_UNCONDITIONALLY(motor->motor_timer);// disables pwm outputs motor->do_calibration = false; } From d5812d76b641525197e738005595c8c140ebfbc3 Mon Sep 17 00:00:00 2001 From: Oskar Weigl Date: Sat, 26 Aug 2017 10:25:40 -0700 Subject: [PATCH 4/5] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index bbb02f08..c52e2433 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,9 @@ TODO ### Building the firmware * Make sure you have cloned the repository. + * For v3.3, you should use the [v3.3-pinout](https://github.com/madcowswe/ODriveFirmware/tree/v3.3-pinout) branch. + * For other versions you should use master + * In the near future this will be controlled with a preprocessor switch, but is done with branches for now. * Navigate your terminal (bash/cygwin) to the ODriveFirmware dir. * Run `make` in the root of this repository. From 06047cb79139837de582afbf32202c237e1b5627 Mon Sep 17 00:00:00 2001 From: Oskar Weigl Date: Sat, 26 Aug 2017 10:26:01 -0700 Subject: [PATCH 5/5] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c52e2433..590903aa 100644 --- a/README.md +++ b/README.md @@ -91,9 +91,9 @@ TODO ### Building the firmware * Make sure you have cloned the repository. - * For v3.3, you should use the [v3.3-pinout](https://github.com/madcowswe/ODriveFirmware/tree/v3.3-pinout) branch. - * For other versions you should use master - * In the near future this will be controlled with a preprocessor switch, but is done with branches for now. + * For v3.3, you should use the [v3.3-pinout](https://github.com/madcowswe/ODriveFirmware/tree/v3.3-pinout) branch. + * For other versions you should use master + * In the near future this will be controlled with a preprocessor switch, but is done with branches for now. * Navigate your terminal (bash/cygwin) to the ODriveFirmware dir. * Run `make` in the root of this repository.