Help to check current value

Hello everyone.
How can I know if my board (STM32F446RE) is measuring the current correctly?

Is it normal for the current value displayed in simpleFOCstudio to oscillate so much?

Thank you very much for your help.

Hey @Francesc_Riera_Vidal ,

Could you share your code? Also, which driver/motor are you using?

The motor driver board is X-NUCLEO-IHM07M1.

The code
#include <SimpleFOC.h>

// BLDC motor & driver instance PA8, PA9, PA10, PC10, PC11, PC12
// BLDCMotor(int pp, (optional R, KV))
// - pp - pole pair number
// - R - phase resistance value - optional
// - KV - motor KV rating [rpm/V] - optional
BLDCMotor motor = BLDCMotor(7);//motor chino
// BLDCDriver3PWM( int phA, int phB, int phC, int enA, int enB, int enC )
// - phA, phB, phC - A,B,C phase pwm pins
// - enA, enB, enC - enable pin for each phase (optional)
BLDCDriver3PWM driver = BLDCDriver3PWM(PA8, PA9, PA10, PC10, PC11, PC12);
//LowsideCurrentSense(shunt_resistance, gain, adc_a, adc_b, adc_c)
LowsideCurrentSense current_sense = LowsideCurrentSense(0.33, 1.528, PA0, PC1,PC0);
// Example of AS5600 configuration
MagneticSensorI2C sensor = MagneticSensorI2C(AS5600_I2C);
//instantiate commander
Commander commander = Commander(Serial);
void onMotor(char* cmd){commander.motor(&motor, cmd);}

void setup()
{
Serial.begin(115200);
motor.useMonitoring(Serial);
driver.init();
current_sense.linkDriver(&driver);
// configure i2C
Wire.setClock(400000);
// initialise magnetic sensor hardware
sensor.init();
// link the motor to the sensor
motor.linkSensor(&sensor);
// driver config
// power supply voltage [V]
driver.voltage_power_supply = 15.5;
// link driver
motor.linkDriver(&driver);
// set control loop type to be used
motor.controller = MotionControlType::angle;
motor.torque_controller = TorqueControlType::dc_current;
//motor.foc_modulation = FOCModulationType::SinePWM;
// contoller configuration based on the controll type
motor.PID_velocity.P = 0.05;
motor.PID_velocity.I = 1;
motor.PID_velocity.D = 0;
// default voltage_power_supply
motor.voltage_limit = 12;
// velocity low pass filtering time constant
motor.LPF_velocity.Tf = 0.01;
// angle loop controller
motor.P_angle.P = 20;
// angle loop velocity limit
motor.velocity_limit = 30;
current_sense.init();
motor.linkCurrentSense(&current_sense);
// align encoder and start FOC
motor.init();
motor.initFOC();
// set the inital target value
motor.target = 4;
// subscribe motor to the commander
commander.add(‘M’,onMotor,“motor”);
}
void loop() {
// iterative setting FOC phase voltage
motor.loopFOC();
// iterative function setting the outter loop target
motor.move();
// motor monitoring
motor.monitor();
// user communication
commander.run();
}

Please place the motor.init() before the current_sense.init()

You can see some examples for the correct order for initialisation here: