Skip to content

Commit

Permalink
g431 ADC, telemetry, Auto TIming
Browse files Browse the repository at this point in the history
  • Loading branch information
AlkaMotors committed Jul 16, 2024
1 parent a770b8d commit eef9cb4
Show file tree
Hide file tree
Showing 98 changed files with 160,109 additions and 10,172 deletions.
2 changes: 1 addition & 1 deletion Inc/dshot.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ extern char dir_reversed;
extern char bi_direction;
extern char buffer_divider;
extern uint8_t last_dshot_command;
extern uint16_t commutation_interval;
extern uint32_t commutation_interval;

// int e_com_time;

Expand Down
89 changes: 83 additions & 6 deletions Inc/targets.h
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,16 @@
#define HARDWARE_GROUP_AT_C
#define FIRMWARE_NAME "FOXEER F4 "
#define FILE_NAME "FOXEER_F421"
#define DEAD_TIME 60
#define DEAD_TIME 80
#define HARDWARE_GROUP_AT_540
#define USE_SERIAL_TELEMETRY
#endif

#ifdef IFLIGHT_TEST_F4A
#define HARDWARE_GROUP_AT_C
#define FIRMWARE_NAME "IFLIGHT_F4A "
#define FILE_NAME "IFLIGHT_TEST_F4A"
#define DEAD_TIME 80
#define HARDWARE_GROUP_AT_540
#define USE_SERIAL_TELEMETRY
#endif
Expand Down Expand Up @@ -493,7 +502,7 @@
#ifdef AT32DEV_F415
#define FIRMWARE_NAME "AT32F415 "
#define FILE_NAME "AT32DEV_F415"
#define DEAD_TIME 80
#define DEAD_TIME 100
#define HARDWARE_GROUP_AT_D
#define USE_SERIAL_TELEMETRY
#endif
Expand Down Expand Up @@ -637,6 +646,15 @@
#define USE_INVERTED_HIGH
#endif

#ifdef AT_F4_04_F421
#define FIRMWARE_NAME "AT_F4_4_F421"
#define FILE_NAME "AT_F4_04_F421"
#define DEAD_TIME 80
#define HARDWARE_GROUP_AT_B
#define HARDWARE_GROUP_AT_540
#define USE_SERIAL_TELEMETRY
#endif

/*****************************************************AT32F415 targets ************************************************/

#ifdef PB450_F051
Expand Down Expand Up @@ -997,6 +1015,36 @@
#define SIXTY_FOUR_KB_MEMORY
#endif

#ifdef ST_G0_03_N_G071
#define FILE_NAME "ST_G0_03_N_G071"
#define FIRMWARE_NAME "ST_G0_03_N "
#define DEAD_TIME 40
#define MILLIVOLT_PER_AMP 20
#define CURRENT_OFFSET 0
#define HARDWARE_GROUP_G0_H
#define USE_SERIAL_TELEMETRY
#define SIXTY_FOUR_KB_MEMORY
#define VOLTAGE_ADC_CHANNEL LL_ADC_CHANNEL_5
#define VOLTAGE_ADC_PIN LL_GPIO_PIN_5
#define CURRENT_ADC_CHANNEL LL_ADC_CHANNEL_4
#define CURRENT_ADC_PIN LL_GPIO_PIN_4
#endif

#ifdef ST_G0_04_G071
#define FILE_NAME "ST_G0_04_G071"
#define FIRMWARE_NAME "ST_G0_04 "
#define DEAD_TIME 40
#define MILLIVOLT_PER_AMP 20
#define CURRENT_OFFSET 0
#define HARDWARE_GROUP_G0_F
#define USE_SERIAL_TELEMETRY
#define SIXTY_FOUR_KB_MEMORY
#define VOLTAGE_ADC_CHANNEL LL_ADC_CHANNEL_0
#define VOLTAGE_ADC_PIN LL_GPIO_PIN_0
#define CURRENT_ADC_CHANNEL LL_ADC_CHANNEL_4
#define CURRENT_ADC_PIN LL_GPIO_PIN_4
#endif

#ifdef AM32_ESC_G071
#define FILE_NAME "AM32_ESC_G071"
#define FIRMWARE_NAME "AM32ESC_G071"
Expand Down Expand Up @@ -1076,14 +1124,30 @@
#define USE_LED_STRIP
#endif

#ifdef SEQURE_G071
#ifdef IFLIGHT_12S_SINGLE_N_G071
#define FILE_NAME "IFLIGHT_12S_G071"
#define FIRMWARE_NAME "12s G071N "
#define DEAD_TIME 100
#define MILLIVOLT_PER_AMP 67
#define CURRENT_OFFSET 0
#define TARGET_VOLTAGE_DIVIDER 210
#define HARDWARE_GROUP_G0_G
#define USE_SERIAL_TELEMETRY
#define SIXTY_FOUR_KB_MEMORY
#define RAMP_SPEED_LOW_RPM 1
#define RAMP_SPEED_HIGH_RPM 1
#define TARGET_MIN_BEMF_COUNTS 4
#define USE_LED_STRIP
#endif

#ifdef SEQURE_G071
#define FILE_NAME "SEQURE_G071"
#define FIRMWARE_NAME "SEQURE G071 "
#define DEAD_TIME 60
#define MILLIVOLT_PER_AMP 33
#define CURRENT_OFFSET 0
#define TARGET_STALL_PROTECTION_INTERVAL 9000
#define TARGET_VOLTAGE_DIVIDER 210
#define TARGET_STALL_PROTECTION_INTERVAL 7000
#define TARGET_VOLTAGE_DIVIDER 110
#define HARDWARE_GROUP_G0_A
#define USE_SERIAL_TELEMETRY
#define SIXTY_FOUR_KB_MEMORY
Expand Down Expand Up @@ -1166,6 +1230,19 @@
#define SIXTY_FOUR_KB_MEMORY
#endif


#ifdef SURFBEE_G071
#define FILE_NAME "SURFBEE_G071"
#define FIRMWARE_NAME "SurfBee 4in1"
#define DEAD_TIME 60
#define MILLIVOLT_PER_AMP 20
#define CURRENT_OFFSET 0
#define TARGET_VOLTAGE_DIVIDER 210
#define HARDWARE_GROUP_G0_N
#define USE_SERIAL_TELEMETRY
#define SIXTY_FOUR_KB_MEMORY
#endif

#ifdef FLYCOLOR_HV3_G071
#define FILE_NAME "FLYCOLOR_HV3_G071"
#define FIRMWARE_NAME "Flycolor HV3"
Expand Down Expand Up @@ -2660,7 +2737,7 @@
#define EXTI_LINE LL_EXTI_LINE_22
#define TARGET_MIN_BEMF_COUNTS 3
#define COMPARATOR_IRQ COMP1_2_3_IRQn
// #define USE_ADC
#define USE_ADC
// #ifndef CURRENT_ADC_CHANNEL
// #define CURRENT_ADC_CHANNEL LL_ADC_CHANNEL_5
// #endif
Expand Down
8 changes: 7 additions & 1 deletion Keil_Projects/AM32_MultiProject.uvmpw
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,18 @@

<project>
<PathAndName>.\Am32G071.uvprojx</PathAndName>
<NodeIsActive>1</NodeIsActive>
<NodeIsExpanded>1</NodeIsExpanded>
<NodeIsCheckedInBatchBuild>1</NodeIsCheckedInBatchBuild>
</project>

<project>
<PathAndName>.\Am32G431.uvprojx</PathAndName>
<NodeIsActive>1</NodeIsActive>
<NodeIsCheckedInBatchBuild>1</NodeIsCheckedInBatchBuild>
</project>

<project>
<PathAndName>.\Am32l431.uvprojx</PathAndName>
<NodeIsCheckedInBatchBuild>1</NodeIsCheckedInBatchBuild>
</project>

Expand Down
137 changes: 100 additions & 37 deletions Keil_Projects/AM32_MultiProject.uvmpw.uvgui.alkaz

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Keil_Projects/Am32F031.uvguix.alkaz
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@
<MDIClientArea>
<RegID>0</RegID>
<MDITabState>
<Len>582</Len>
<Data>0100000004000000010000000100000001000000010000000000000002000000000000000100000001000000000000002800000028000000010000000400000000000000010000003B433A5C55736572735C616C6B617A5C4F6E6544726976655C446F63756D656E74735C414D33325F4D554C54495F4D43555C5372635C6D61696E2E6300000000066D61696E2E6300000000C5D4F200FFFFFFFF3E433A5C55736572735C616C6B617A5C4F6E6544726976655C446F63756D656E74735C414D33325F4D554C54495F4D43555C696E635C746172676574732E680000000009746172676574732E6800000000FFDC7800FFFFFFFF5D433A5C55736572735C616C6B617A5C4F6E6544726976655C446F63756D656E74735C414D33325F4D554C54495F4D43555C4B65696C5F50726F6A656374735C4C697374696E67735C414D33325F54454B4B4F33325F463431352E6D61700000000015414D33325F54454B4B4F33325F463431352E6D617000000000BECEA100FFFFFFFF4B433A5C55736572735C616C6B617A5C4F6E6544726976655C446F63756D656E74735C414D33325F4D554C54495F4D43555C4D63755C663431355C5372635C61743332663431355F69742E63000000000D61743332663431355F69742E6300000000F0A0A100FFFFFFFF0100000010000000C5D4F200FFDC7800BECEA100F0A0A100BCA8E1009CC1B600F7B88600D9ADC200A5C2D700B3A6BE00EAD6A300F6FA7D00B5E99D005FC3CF00C1838300CACAD500010000000000000002000000B50100007000000080070000C8030000</Data>
<Len>1274</Len>
<Data>0100000004000000010000000100000001000000010000000000000002000000000000000100000001000000000000002800000028000000010000000B000000020000000100000043433A5C55736572735C616C6B617A5C4F6E6544726976655C446F63756D656E74735C414D33325F4D554C54495F4D43555C4D63755C673037315C5372635C4144432E6300000000054144432E6300000000C5D4F200FFFFFFFF43433A5C55736572735C616C6B617A5C4F6E6544726976655C446F63756D656E74735C414D33325F4D554C54495F4D43555C4D63755C673433315C5372635C4144432E6300000000054144432E6300000000FFDC7800FFFFFFFF3E433A5C55736572735C616C6B617A5C4F6E6544726976655C446F63756D656E74735C414D33325F4D554C54495F4D43555C496E635C746172676574732E680000000009746172676574732E6800000000BECEA100FFFFFFFF4B433A5C55736572735C616C6B617A5C4F6E6544726976655C446F63756D656E74735C414D33325F4D554C54495F4D43555C4D63755C673433315C5372635C7065726970686572616C732E63000000000D7065726970686572616C732E6300000000F0A0A100FFFFFFFF4B433A5C55736572735C616C6B617A5C4F6E6544726976655C446F63756D656E74735C414D33325F4D554C54495F4D43555C4D63755C673433315C496E635C7065726970686572616C732E68000000000D7065726970686572616C732E6800000000BCA8E100FFFFFFFF3B433A5C55736572735C616C6B617A5C4F6E6544726976655C446F63756D656E74735C414D33325F4D554C54495F4D43555C5372635C6D61696E2E6300000000066D61696E2E63000000009CC1B600FFFFFFFF50433A5C55736572735C616C6B617A5C4F6E6544726976655C446F63756D656E74735C414D33325F4D554C54495F4D43555C4D63755C673433315C5372635C73797374656D5F73746D3332673478782E63000000001273797374656D5F73746D3332673478782E6300000000F7B88600FFFFFFFF4C433A5C55736572735C616C6B617A5C4F6E6544726976655C446F63756D656E74735C414D33325F4D554C54495F4D43555C4D63755C673433315C5372635C73746D3332673478785F69742E63000000000E73746D3332673478785F69742E6300000000D9ADC200FFFFFFFF4C433A5C55736572735C616C6B617A5C4F6E6544726976655C446F63756D656E74735C414D33325F4D554C54495F4D43555C4D63755C673037315C5372635C73746D3332673078785F69742E63000000000E73746D3332673078785F69742E6300000000A5C2D700FFFFFFFF43433A5C55736572735C616C6B617A5C4F6E6544726976655C446F63756D656E74735C414D33325F4D554C54495F4D43555C4D63755C6C3433315C5372635C4144432E6300000000054144432E6300000000B3A6BE00FFFFFFFF50433A5C55736572735C616C6B617A5C4F6E6544726976655C446F63756D656E74735C414D33325F4D554C54495F4D43555C4D63755C673433315C5372635C73657269616C5F74656C656D657472792E63000000001273657269616C5F74656C656D657472792E6300000000EAD6A300FFFFFFFF0100000010000000C5D4F200FFDC7800BECEA100F0A0A100BCA8E1009CC1B600F7B88600D9ADC200A5C2D700B3A6BE00EAD6A300F6FA7D00B5E99D005FC3CF00C1838300CACAD500010000000000000002000000B50100007000000080070000C8030000</Data>
</MDITabState>
</MDIClientArea>
<ViewEx>
Expand Down Expand Up @@ -3605,7 +3605,7 @@
<Size>100</Size>
<ActiveTab>1</ActiveTab>
<Doc>
<Name>&lt;1&gt;..\inc\targets.h</Name>
<Name>C:\Users\alkaz\OneDrive\Documents\AM32_MULTI_MCU\Inc\targets.h</Name>
<ColumnNumber>19</ColumnNumber>
<TopLine>648</TopLine>
<CurrentLine>654</CurrentLine>
Expand Down
Loading

0 comments on commit eef9cb4

Please sign in to comment.