Visual updates

This commit is contained in:
EmanuelFeru 2019-10-22 21:45:47 +02:00
parent 99f07cc174
commit 1cc8b3475f
4 changed files with 13 additions and 14 deletions

View File

@ -58,16 +58,16 @@ r_cos_M1 = cos((a_elecAngle_XA + 30)*(pi/180));
%% Control Manager
% Control type selection
CTRL_COM = 0; % [-] Commutation Control
CTRL_FOC = 1; % [-] Field Oriented Control (FOC)
z_ctrlTypSel = 1; % [-] Control Type Selection (default)
CTRL_COM = 0; % [-] Commutation Control
CTRL_FOC = 1; % [-] Field Oriented Control (FOC)
z_ctrlTypSel = CTRL_FOC; % [-] Control Type Selection (default)
% Control model request
OPEN_MODE = 0; % [-] Open mode
VLT_MODE = 1; % [-] Voltage mode
SPD_MODE = 2; % [-] Speed mode
TRQ_MODE = 3; % [-] Torque mode
z_ctrlModReq = 1; % [-] Control Mode Request (default)
OPEN_MODE = 0; % [-] Open mode
VLT_MODE = 1; % [-] Voltage mode
SPD_MODE = 2; % [-] Speed mode
TRQ_MODE = 3; % [-] Torque mode
z_ctrlModReq = VLT_MODE; % [-] Control Mode Request (default)
%% F01_Estimations
% Position Estimation Parameters

View File

@ -137,7 +137,7 @@
* 1. In BLDC_controller_data.c you can find the field weakening Map as a function of input target: MAP = id_fieldWeak_M1, XAXIS = r_fieldWeak_XA
* 2. The default calibration was experimentally calibrated to my particular needs
* 3. If you re-calibrate the field weakening map please take all the safety measures! The motors can spin very fast!
* 4. During the recalibration make sure the speed values in XAXIS are equally spaced for a correct Map interpolation.
* 4. During the recalibration make sure the values in XAXIS are equally spaced for a correct Map interpolation.
*/
@ -152,7 +152,7 @@
*/
// Value of FILTER is in fixdt(0,16,16)
// VAL_fixedPoint = VAL_floatingPoint * 2^16. In this case 6554 = 0.1 * 2^16
// VAL_fixedPoint = VAL_floatingPoint * 2^16. In this case 6553 = 0.1 * 2^16
#define FILTER 6553 // 0.1f [-] lower value == softer filter [0, 65535] = [ 0.0 - 1.0].
// Value of COEFFICIENT is in fixdt(1,16,14)

View File

@ -79,10 +79,9 @@ static int16_t offsetdcr = 2000;
int16_t batVoltage = (400 * BAT_CELLS * BAT_CALIB_ADC) / BAT_CALIB_REAL_VOLTAGE;
static int16_t batVoltageFixdt = (400 * BAT_CELLS * BAT_CALIB_ADC) / BAT_CALIB_REAL_VOLTAGE << 4; // Fixed-point filter output initialized at 400 V*100/cell = 4 V/cell converted to fixed-point
//scan 8 channels with 2ADCs @ 20 clk cycles per sample
//meaning ~80 ADC clock cycles @ 8MHz until new DMA interrupt =~ 100KHz
//=640 cpu cycles
// =================================
// DMA interrupt frequency =~ 16 kHz
// =================================
void DMA1_Channel1_IRQHandler(void) {
DMA1->IFCR = DMA_IFCR_CTCIF1;