Part Number: LAUNCHXL-F280049C
Other Parts Discussed in Thread: INA240, BOOSTXL-DRV8320RS, MOTORWARE, EK-TM4C1294XL, TIDA-00778
Having issues to set the ADC scale factor for INA240 set 40mV/A, reference mid supply 1.65v and Voltage SF are not so precision. A big SPM will stall at start of LC (20Hz) unless USER_MOTOR_RES_EST_CURRENT_A is set very high (12.5A) and well above SF for PGA shunts (7mohm) x13 gain (91mV/A), 35A full scale! Assuming the PGA's are not rail-rail amps gives us a 3.2v ADC FS so 42A was over the sample margin (user.h).
High EST current R/L samples cause (motor.vars_RsOnline_Ohms) reading to be hundreds of ohms when actually 0.56 ohms. Perhaps is not producing good ID values via USER_ADC_FULL_SCALE_VOLTAGE_V = (330) , nominal DC input is now 41V?
1. Where are the mV/A current formula/s or SF in the SDK for I_A sample conversions, so the math can be made more precision for off board sensors? It seems PGA 7mohm shunt was ok for 42A but going to 80A the 2mOhm shunt gives 40mV/A x20 gain of INA240A1. That seems to work to keep motor spinning entire LC test but all other values go to bad monkey.
2. It seems the USER_ADC_FULL_SCALE_CURRENT_A is missing USER_IQ_FULL_SCALE_CURRENT_A part shown SPRUHJ1H–Page 255 and offset does not seem to get it accurate enough. The test does not explain how to fix the SDK for other testing modes.
3. How to improve (motorVars.Rs_Ohm) measure or what needs to be tweaked for the higher voltage USER_ADC_FULL_SCALE_VOLTAGE_V ((float32_t)(330.0)) and USER_VOLTAGE_FILTER_POLE_Hz((float32_t)(348.794)) so the L-L Ohms can be more accurate? Oddly starts out ok then crosses the true value but ends test with fictional 1mohm value? Reducing R1/R2 EMF, Buss voltage divider values helps to push up ADC precision to 4 LSB versus 1LSB.
4. Swapping the current source ADC=A,B,C to a 1-1 (SOC is I_A) produces higher currents and motor spins in LC mode, but motor.vars_RsOnline_Ohms is then in the hundreds of ohms.
Oddly BoostXL-DRV8320rs motor stalls during LC too but ID did seem to get close enough values to run large SPM to 550Hz. The new Nidec 20v motor vibrates from basic setting (user.c) but run much longer time than pUserParams->estWaitTime[EST_STATE_LS] = 0; The newly added LC states (ramp, course, fine, done) are missing in is05_motor_id.js.
// set the current scale factor
HAL_setCurrentScaleFactor(handle,USER_CURRENT_SF);
// set the voltage scale factor
HAL_setVoltageScaleFactor(handle,USER_VOLTAGE_SF);
//! \brief Defines the maximum current at the AD converter //! BOARD_BSXL8320RS_REVA, Gain=12, INA240 Gain=20 #define USER_ADC_FULL_SCALE_CURRENT_A ((float32_t)(80.00)) //! \brief ADC current offsets for A, B, and C phases #define IA_OFFSET_A (-40.00) //-21.428 ~=0.5*USER_ADC_FULL_SCALE_CURRENT_A #define IB_OFFSET_A (-40.00) //-21.428 ~=0.5*USER_ADC_FULL_SCALE_CURRENT_A #define IC_OFFSET_A (-40.00)

