From 7e212b58d414027cf090dc56f5a5cf6ca8f50e4b Mon Sep 17 00:00:00 2001 From: "Jeffrey M. Friesen" Date: Tue, 21 Jul 2020 09:42:31 -0700 Subject: [PATCH] Modified some pins config stuff for stormcore hardware --- hwconf/hw_stormcore_100d.c | 4 ++-- hwconf/hw_stormcore_100d.h | 9 ++++++--- hwconf/hw_stormcore_100s.h | 8 ++++---- hwconf/hw_stormcore_60d.c | 4 ++-- hwconf/hw_stormcore_60d.h | 9 +++++++-- 5 files changed, 21 insertions(+), 13 deletions(-) diff --git a/hwconf/hw_stormcore_100d.c b/hwconf/hw_stormcore_100d.c index a230b456..cfba7b2a 100644 --- a/hwconf/hw_stormcore_100d.c +++ b/hwconf/hw_stormcore_100d.c @@ -508,10 +508,10 @@ static THD_FUNCTION(smart_switch_thread, arg) { case SWITCH_TURNED_ON: if (smart_switch_is_pressed()) { millis_switch_pressed++; - switch_bright = 1.0; + switch_bright = 0.5; } else { millis_switch_pressed = 0; - switch_bright = 0.5; + switch_bright = 1.0; } if (millis_switch_pressed > SMART_SWITCH_MSECS_PRESSED_OFF) { diff --git a/hwconf/hw_stormcore_100d.h b/hwconf/hw_stormcore_100d.h index 0fba9649..698cde63 100644 --- a/hwconf/hw_stormcore_100d.h +++ b/hwconf/hw_stormcore_100d.h @@ -54,11 +54,11 @@ #define SWITCH_PRECHARGED_GPIO GPIOE #define SWITCH_PRECHARGED_PIN 2 #define SWITCH_LED_3_GPIO GPIOD -#define SWITCH_LED_3_PIN 15 +#define SWITCH_LED_3_PIN 11 #define SWITCH_LED_2_GPIO GPIOD #define SWITCH_LED_2_PIN 10 #define SWITCH_LED_1_GPIO GPIOD -#define SWITCH_LED_1_PIN 11 +#define SWITCH_LED_1_PIN 15 #define LED_PWM1_ON() palClearPad(SWITCH_LED_1_GPIO,SWITCH_LED_1_PIN) #define LED_PWM1_OFF() palSetPad(SWITCH_LED_1_GPIO,SWITCH_LED_1_PIN) @@ -390,6 +390,9 @@ #ifndef MCCONF_M_DRV8301_OC_ADJ #define MCCONF_M_DRV8301_OC_ADJ 14 #endif +#ifndef MCCONF_L_DUTY_START +#define MCCONF_L_DUTY_START 0.9 // Start limiting current at this duty cycle +#endif // Setting limits #ifdef HW_HAS_DUAL_PARALLEL #define HW_LIM_CURRENT -300.0, 300.0 @@ -404,7 +407,7 @@ #define MCCONF_L_MAX_ABS_CURRENT 200.0 // The maximum absolute current above which a fault is generated #endif #endif -#define HW_LIM_CURRENT_IN -150.0, 150.0 +#define HW_LIM_CURRENT_IN -100.0, 100.0 #define HW_LIM_VIN 6.0, 94.0 #define HW_LIM_ERPM -200e3, 200e3 #define HW_LIM_DUTY_MIN 0.0, 0.1 diff --git a/hwconf/hw_stormcore_100s.h b/hwconf/hw_stormcore_100s.h index cffd8902..8a975d45 100644 --- a/hwconf/hw_stormcore_100s.h +++ b/hwconf/hw_stormcore_100s.h @@ -235,20 +235,20 @@ #define MCCONF_L_IN_CURRENT_MIN -60.0 // Input current limit in Amperes (Lower) #endif #ifndef MCCONF_L_MAX_ABS_CURRENT -#define MCCONF_L_MAX_ABS_CURRENT 160.0 // The maximum absolute current above which a fault is generated +#define MCCONF_L_MAX_ABS_CURRENT 200.0 // The maximum absolute current above which a fault is generated #endif #ifndef MCCONF_DEFAULT_MOTOR_TYPE #define MCCONF_DEFAULT_MOTOR_TYPE MOTOR_TYPE_FOC #endif -#ifndef MCCONF_FOC_F_SW -#define MCCONF_FOC_F_SW 20000.0 +#ifndef MCCONF_L_DUTY_START +#define MCCONF_L_DUTY_START 0.9 // Start limiting current at this duty cycle #endif // Setting limits #define HW_LIM_CURRENT -120.0, 120.0 #define HW_LIM_CURRENT_IN -100.0, 100.0 -#define HW_LIM_CURRENT_ABS 0.0, 160.0 +#define HW_LIM_CURRENT_ABS 0.0, 200.0 #define HW_LIM_VIN 6.0, 92.0 #define HW_LIM_ERPM -200e3, 200e3 #define HW_LIM_DUTY_MIN 0.0, 0.1 diff --git a/hwconf/hw_stormcore_60d.c b/hwconf/hw_stormcore_60d.c index e9d98393..6cd827b2 100644 --- a/hwconf/hw_stormcore_60d.c +++ b/hwconf/hw_stormcore_60d.c @@ -505,10 +505,10 @@ static THD_FUNCTION(smart_switch_thread, arg) { case SWITCH_TURNED_ON: if (smart_switch_is_pressed()) { millis_switch_pressed++; - switch_bright = 1.0; + switch_bright = 0.5; } else { millis_switch_pressed = 0; - switch_bright = 0.5; + switch_bright = 1.0; } if (millis_switch_pressed > SMART_SWITCH_MSECS_PRESSED_OFF) { diff --git a/hwconf/hw_stormcore_60d.h b/hwconf/hw_stormcore_60d.h index 48e2c539..b144dd99 100644 --- a/hwconf/hw_stormcore_60d.h +++ b/hwconf/hw_stormcore_60d.h @@ -45,11 +45,11 @@ #define SWITCH_PRECHARGED_GPIO GPIOE #define SWITCH_PRECHARGED_PIN 2 #define SWITCH_LED_3_GPIO GPIOD -#define SWITCH_LED_3_PIN 15 +#define SWITCH_LED_3_PIN 11 #define SWITCH_LED_2_GPIO GPIOD #define SWITCH_LED_2_PIN 10 #define SWITCH_LED_1_GPIO GPIOD -#define SWITCH_LED_1_PIN 11 +#define SWITCH_LED_1_PIN 15 #define LED_PWM1_ON() palClearPad(SWITCH_LED_1_GPIO,SWITCH_LED_1_PIN) #define LED_PWM1_OFF() palSetPad(SWITCH_LED_1_GPIO,SWITCH_LED_1_PIN) @@ -381,6 +381,11 @@ #ifndef MCCONF_L_MAX_ABS_CURRENT #define MCCONF_L_MAX_ABS_CURRENT 200.0 // The maximum absolute current above which a fault is generated #endif +#ifndef MCCONF_L_DUTY_START +#define MCCONF_L_DUTY_START 0.9 // Start limiting current at this duty cycle +#endif + + // Setting limits #define HW_LIM_CURRENT -150.0, 150.0 #define HW_LIM_CURRENT_IN -120.0, 120.0