Skip to content

Add Phoque and Phoque2a current sense#90

Open
Moddingear wants to merge 1 commit into
simplefoc:devfrom
Moddingear:Phoque2_CurrentSense
Open

Add Phoque and Phoque2a current sense#90
Moddingear wants to merge 1 commit into
simplefoc:devfrom
Moddingear:Phoque2_CurrentSense

Conversation

@Moddingear
Copy link
Copy Markdown

Yes, the boards aren't available yet, and Phoque2a is an alpha version.

Yet, I believe that this implementation of current sense is good, and could be applied to BG431-ESC1 with only a few modifications (it could even reuse the common Phoque_CurrentSense class).

Most notable, is that the ADC channels are resolved at runtime, so this leaves less room for error, the calibration doesn't wait 1ms every round, making it run ~20 times faster (if at 20kHz), and driver align is removed so around 3.8K of code is freed from the flash.

Furthermore, the ADC can be configured to read from more channels by making a class inherit from Phoque2a_CurrentSense and adding some more ADC channels to the planned channels.

Using the same framework, Phoque1 and Phoque2 will be supported. (Technically, Phoque2 doesn't have any analog pin change, so it will probably be the same class)

@github-actions
Copy link
Copy Markdown

Memory usage change @ 1d7c972

Board flash % RAM for global variables %
adafruit:samd:adafruit_metro_m4 0 - 0 0.0 - 0.0 N/A N/A
rp2040:rp2040:rpipico 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:sam:arduino_due_x 0 - 0 0.0 - 0.0 N/A N/A
arduino:samd:nano_33_iot 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
esp32:esp32:esp32 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
esp32:esp32:esp32s2 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
STMicroelectronics:stm32:GenF1:pnum=BLUEPILL_F103C8 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
STMicroelectronics:stm32:Nucleo_64:pnum=NUCLEO_F411RE 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
Click for full report table
Board examples/drivers/drv8316/drv8316_3pwm
flash
% examples/drivers/drv8316/drv8316_3pwm
RAM for global variables
% examples/drivers/drv8316/drv8316_6pwm
flash
% examples/drivers/drv8316/drv8316_6pwm
RAM for global variables
% examples/encoders/calibrated_sensor/calibration_save
flash
% examples/encoders/calibrated_sensor/calibration_save
RAM for global variables
% examples/encoders/linearhall
flash
% examples/encoders/linearhall
RAM for global variables
% examples/encoders/mt6816/mt6816_spi
flash
% examples/encoders/mt6816/mt6816_spi
RAM for global variables
% examples/encoders/calibrated_sensor/calibrated
flash
% examples/encoders/calibrated_sensor/calibrated
RAM for global variables
%
adafruit:samd:adafruit_metro_m4 0 0.0 N/A N/A 0 0.0 N/A N/A 0 0.0 N/A N/A 0 0.0 N/A N/A 0 0.0 N/A N/A
rp2040:rp2040:rpipico 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:sam:arduino_due_x 0 0.0 N/A N/A 0 0.0 N/A N/A 0 0.0 N/A N/A 0 0.0 N/A N/A 0 0.0 N/A N/A
arduino:samd:nano_33_iot 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
esp32:esp32:esp32 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
esp32:esp32:esp32s2 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
STMicroelectronics:stm32:GenF1:pnum=BLUEPILL_F103C8 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
STMicroelectronics:stm32:Nucleo_64:pnum=NUCLEO_F411RE 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
Click for full report CSV
Board,examples/drivers/drv8316/drv8316_3pwm<br>flash,%,examples/drivers/drv8316/drv8316_3pwm<br>RAM for global variables,%,examples/drivers/drv8316/drv8316_6pwm<br>flash,%,examples/drivers/drv8316/drv8316_6pwm<br>RAM for global variables,%,examples/encoders/calibrated_sensor/calibration_save<br>flash,%,examples/encoders/calibrated_sensor/calibration_save<br>RAM for global variables,%,examples/encoders/linearhall<br>flash,%,examples/encoders/linearhall<br>RAM for global variables,%,examples/encoders/mt6816/mt6816_spi<br>flash,%,examples/encoders/mt6816/mt6816_spi<br>RAM for global variables,%,examples/encoders/calibrated_sensor/calibrated<br>flash,%,examples/encoders/calibrated_sensor/calibrated<br>RAM for global variables,%
adafruit:samd:adafruit_metro_m4,0,0.0,N/A,N/A,0,0.0,N/A,N/A,0,0.0,N/A,N/A,0,0.0,N/A,N/A,0,0.0,N/A,N/A
rp2040:rp2040:rpipico,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:sam:arduino_due_x,0,0.0,N/A,N/A,0,0.0,N/A,N/A,0,0.0,N/A,N/A,0,0.0,N/A,N/A,0,0.0,N/A,N/A
arduino:samd:nano_33_iot,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
esp32:esp32:esp32,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,,,,,0,0.0,0,0.0
esp32:esp32:esp32s2,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
STMicroelectronics:stm32:GenF1:pnum=BLUEPILL_F103C8,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,,,,
STMicroelectronics:stm32:Nucleo_64:pnum=NUCLEO_F411RE,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant