Skip to content

Commit

Permalink
Merge pull request #1152 from victorhook/upgrade-kit-param-update
Browse files Browse the repository at this point in the history
Improvements for the Motor Upgrade Kit
  • Loading branch information
krichardsson authored Nov 16, 2022
2 parents fce6f32 + e82edd4 commit 5124f58
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
4 changes: 0 additions & 4 deletions src/drivers/interface/motors.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@
#define MOTORS_TIM_DBG_CFG DBGMCU_APB2PeriphConfig
#define MOTORS_GPIO_AF_CFG(a,b,c) GPIO_PinAFConfig(a,b,c)

// Compensate thrust depending on battery voltage so it will produce about the same
// amount of thrust independent of the battery voltage. Based on thrust measurement.
// Not applied for brushless motor setup.
#define ENABLE_THRUST_BAT_COMPENSATED

#ifdef CONFIG_MOTORS_ESC_PROTOCOL_ONESHOT125
/**
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/src/motors.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ GPIO_InitTypeDef GPIO_PassthroughOutput =
// Voltage needed with the Supply voltage.
float motorsCompensateBatteryVoltage(uint32_t id, float iThrust, float supplyVoltage)
{
#ifdef ENABLE_THRUST_BAT_COMPENSATED
#ifdef CONFIG_ENABLE_THRUST_BAT_COMPENSATED
ASSERT(id < NBR_OF_MOTORS);

if (motorMap[id]->drvType == BRUSHED)
Expand Down
9 changes: 9 additions & 0 deletions src/modules/src/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,15 @@ config POWER_DISTRIBUTION_FLAPPER_REVB
help
Power distribution function for Flapper Nimble+ with revB PCB

config ENABLE_THRUST_BAT_COMPENSATED
bool "Enable battery thrust compensation"
default y
help
Compensate thrust depending on battery voltage so it will produce about the same
amount of thrust independent of the battery voltage.
The compensation is based on thrust measurements, which are only valid for CF2.X stock configuration.
Not applied for brushless motor setup.

endmenu

menu "Parameter subsystem"
Expand Down
2 changes: 1 addition & 1 deletion src/modules/src/health.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ PARAM_ADD_CORE(PARAM_UINT8, startBatTest, &startBatTest)
/**
* @brief PWM ratio to use when testing propellers. Required for brushless motors. [0 - UINT16_MAX]
*/
PARAM_ADD_CORE(PARAM_UINT16, propTestPWMRatio, &propTestPWMRatio)
PARAM_ADD_CORE(PARAM_UINT16 | PARAM_PERSISTENT, propTestPWMRatio, &propTestPWMRatio)

PARAM_GROUP_STOP(health)

Expand Down

0 comments on commit 5124f58

Please sign in to comment.