This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi
I am trying to adapt the
E:\ti\controlSUITE\development_kits\DRV8312-C2-KIT_v128\BLDC_Sensorless
to drive a BLDC motor with LAUNCHXL-F28069M + BOOSTXL-DRV8301
I managed to import it in CCS 6, compile (changes some dir / environnement variables) and Run It
I didn't succeed in starting the GUI of : E:\ti\controlSUITE\development_kits\DRV8312-C2-KIT_v128\GUI_project_InstaSPIN_BLDC
or E:\ti\controlSUITE\development_kits\DRV8312-C2-KIT_v128\GUI_project
the connection to Port COM 8 over USB fails while it works with another project example of InstSPIN -FOC _so I know that the harware / pilot are ok_
Even by trinyng manualy in a watch window to change the variables : EnableFlag and RunMotor
id didnt work in Leven1 or 2
/*------------------------------------------------------------------------------ Following is the list of the Build Level choices. ------------------------------------------------------------------------------*/ #define LEVEL1 1 // Module check out (do not connect the motors) #define LEVEL2 2 // Verify ADC, calibrate the offset, run the motor open loop #define LEVEL3 3 // Auto-calibrate the current sensor and BEMF sense offsets #define LEVEL4 4 // Verify CMTN_TRIG module #define LEVEL5 5 // Verify the closed loop based on the computed BEMF zero crossings #define LEVEL6 6 // Verify the closed current loop and current PI controller #define LEVEL7 7 // Verify the closed speed loop and speed PI controller
Can anyone advice me the correction I must made to the code to get it spinning the BLDC sensorless
thanks
Thanks Chris
I have go with all kind of GPIO with no success
I have also tried SCI A and B on the simple example 28069M as said in my other post
The code BLDC_Sensorless runs (tried level1 and 2) by managing the 8301 inverter enable flag
#define OnduleurOff { GpioDataRegs.GPBCLEAR.bit.GPIO50 = 1; } #define OnduleurOn { GpioDataRegs.GPBSET.bit.GPIO50 = 1; }
it drive a huge current and drop the power supply voltage down to 6 V (that goes in current limitation)
also:
1. the 2 GUI examples provided do not connect via my COM port, I don't know why.
2. I can change the variable by my own GUI (using the variable EnableFlag to make it spin) that is integrated to CCS 6.
3. There is no DC current measure on the 8301, is it mandatory for the control (Level >3) , do the 2 and 3 phase currents enough, which file I must change ?
4. I can sum manually the 3 currents if required, I have changed (but not tested) the ADC inputs as for InstaSpin FOC example 5g :
f2806xileg_vdc_BLDC.h /******* CHANNEL SELECT *******/ \ \ AdcRegs.ADCSOC0CTL.bit.CHSEL = 0; /* ChSelect: ADC A0-> Phase U Churrent*/ \ AdcRegs.ADCSOC0CTL.bit.TRIGSEL = 5; /* Set SOC0 start trigger on EPWM1A, due to round-robin SOC0 converts first then SOC1*/ \ AdcRegs.ADCSOC0CTL.bit.ACQPS = 6; /* Set SOC0 S/H Window to 7 ADC Clock Cycles, (6 ACQPS plus 1)*/ \ \ AdcRegs.ADCSOC1CTL.bit.CHSEL = 8; /* ChSelect: ADC B0-> Phase V Current*/ \ AdcRegs.ADCSOC1CTL.bit.TRIGSEL = 5; \ AdcRegs.ADCSOC1CTL.bit.ACQPS = 6; \ \ AdcRegs.ADCSOC2CTL.bit.CHSEL = 7; /* ChSelect: ADC A7-> DC Bus Voltage*/ \ AdcRegs.ADCSOC2CTL.bit.TRIGSEL = 5; \ AdcRegs.ADCSOC2CTL.bit.ACQPS = 6; \ \ AdcRegs.ADCSOC3CTL.bit.CHSEL = 9; /* ChSelect: ADC B1-> V Phase A */ \ AdcRegs.ADCSOC3CTL.bit.TRIGSEL = 5; \ AdcRegs.ADCSOC3CTL.bit.ACQPS = 6; \ \ AdcRegs.ADCSOC4CTL.bit.CHSEL = 2; /* ChSelect: ADC A2-> V Phase B */ \ AdcRegs.ADCSOC4CTL.bit.TRIGSEL = 5; \ AdcRegs.ADCSOC4CTL.bit.ACQPS = 6; \ \ AdcRegs.ADCSOC5CTL.bit.CHSEL = 10; /* ChSelect: ADC B2-> V Phase C */ \ AdcRegs.ADCSOC5CTL.bit.TRIGSEL = 5; \ AdcRegs.ADCSOC5CTL.bit.ACQPS = 6; \ \ AdcRegs.ADCSOC6CTL.bit.CHSEL = 1; /* ChSelect: ADC A1-> Phase W Current -> Low Side DC Bus Return Cur.*/ \ AdcRegs.ADCSOC6CTL.bit.TRIGSEL = 5; \ AdcRegs.ADCSOC6CTL.bit.ACQPS = 6; \ instead of the original: AdcRegs.ADCSOC0CTL.bit.CHSEL = 1; ChSelect: ADC A1-> Phase U Churrent \ AdcRegs.ADCSOC0CTL.bit.TRIGSEL = 5; Set SOC0 start trigger on EPWM1A, due to round-robin SOC0 converts first then SOC1 \ AdcRegs.ADCSOC0CTL.bit.ACQPS = 6; Set SOC0 S/H Window to 7 ADC Clock Cycles, (6 ACQPS plus 1) \ \ AdcRegs.ADCSOC1CTL.bit.CHSEL = 9; ChSelect: ADC B1-> Phase V Current \ AdcRegs.ADCSOC1CTL.bit.TRIGSEL = 5; \ AdcRegs.ADCSOC1CTL.bit.ACQPS = 6; \ \ AdcRegs.ADCSOC2CTL.bit.CHSEL = 10; ChSelect: ADC B2-> DC Bus Voltage \ AdcRegs.ADCSOC2CTL.bit.TRIGSEL = 5; \ AdcRegs.ADCSOC2CTL.bit.ACQPS = 6; \ \ AdcRegs.ADCSOC3CTL.bit.CHSEL = 15; ChSelect: ADC B7-> V Phase A \ AdcRegs.ADCSOC3CTL.bit.TRIGSEL = 5; \ AdcRegs.ADCSOC3CTL.bit.ACQPS = 6; \ \ AdcRegs.ADCSOC4CTL.bit.CHSEL = 7; ChSelect: ADC A7-> V Phase B \ AdcRegs.ADCSOC4CTL.bit.TRIGSEL = 5; \ AdcRegs.ADCSOC4CTL.bit.ACQPS = 6; \ \ AdcRegs.ADCSOC5CTL.bit.CHSEL = 12; ChSelect: ADC B4-> V Phase C \ AdcRegs.ADCSOC5CTL.bit.TRIGSEL = 5; \ AdcRegs.ADCSOC5CTL.bit.ACQPS = 6; \ \ AdcRegs.ADCSOC6CTL.bit.CHSEL = 2; ChSelect: ADC A2-> Low Side DC Bus Return Cur. \ AdcRegs.ADCSOC6CTL.bit.TRIGSEL = 5; \ AdcRegs.ADCSOC6CTL.bit.ACQPS = 6; \
Why I dont use the InstaSpin FOC:
I have a BLDC PMSM motor (with trapezoidal bemf), when using the InstaSpin FOC _which require a sinus bemf SM), the current is "pumping" and I got a bad behavior over 3000 rpm.
Is there a InstaSPIN BLDC for 28069M _ the only one is for 283xxx E:\ti\controlSUITE\development_kits\DRV8312-C2-KIT_v128\InstaSPIN_BLDC) instead of using this ?
Is the code InstaSpin FOC for 69M / 8301 simpler to adapt than the BLDC_Sensorless code for 69M / 8312 ?
Thanks for your kind help, we are almost lost here...
Lotfi
I'm not sure what your problem is...porting SW to an new set of HW can be tricky. Need to configure all the I/O correct, set-up clocking, all scaling variables, etc. You'll have to check your work.
1. The GUI provided for the DRV83xx EVM won't work with your LaunchPad. The binary is tied into the .exe, and that binary is built for the EVM. You need to use the CCS project and GUI Composer to create a new GUI if you need it for your application.
2. ok
3 / 4. For trapezoidal BLDC control having a sum current is usually preferred. We specifically built the BOOSTXL-DRV8301 to work for FOC control with just low leg shunts. You can use these for total current sum. I don't know what this has to do with lab 5g
InstaSPIN-FOC can certainly be used with trapezoidal Bemf motors, and quite well. If there is a current issue it is more likely to do with PWM frequency or misidentified motor parameters.
InstaSPIN-BLDC is available for the F28035 and F28069 controlCARDs (the project is dual built). Technically the F28069M controlCARD should work, but I think you will have to add the Iqmath library to the project and probably update the memory map .cmd file.
Lotfi said:Is the code InstaSpin FOC for 69M / 8301 simpler to adapt than the BLDC_Sensorless code for 69M / 8312 ?
Adapt to what? If you are just changing HW platforms I think MotorWare / InstaSPIN-FOC is simpler to adapt.
If you are porting HW and to a different MCU then controlSUITE code is probably where you should start.
In your shoes I would look again at InstaSPIN-FOC. Work through the labs, post here to confirm your settings and ID'd parameters, and plan on using proj_lab10 eventually which offers over-modulation (trapezoidal drive at the top 25% of the duty cycle)
Thanks for your kind help
I am still deep inside the BLDC sensorless code, trying to make it work, it just spinning the ramps... but no real control
Is there a pdf describing the code ?
If it don't work I will go back to InstaSPIN FOC or InstaSpin BLDC
As I already said, InstaSPIN FOC is working, I can change the speed, but above 2500 rpm the current begins pumping a lot, it is not as perfect as I expect, perhaps motor parameter is the issue as you said.
I found that the BLDC sensorless code is smaller / simpler than InstaSPIN FOC, though this one is partially written in ROM, but the lib is huge and need lot of understanding.
As far as now, my control works better with Instspin FOC...
Thanks for the advices
speed control Kp from 3 to 1, solved the current pumping
I would like to modify the code to switch online between current control only to current and speed control, for testing
is it safe to change it online in the main_ISR ?
// Enable or not the Library internal PI. Iq is referenced by the speed PI now if ( ctrl_speed_Iq) CTRL_setFlag_enableSpeedCtrl(ctrlHandle, true); else CTRL_setFlag_enableSpeedCtrl(ctrlHandle, false);
of course I have to update manually Iqs_ref
also I notice that GUI composer sometimes doesn't work fine, for example, it does not display the Binding details Pre and Post Process function that I have already affected, and if I restart, I can see them...
also when copying from an html to another, it does not keep the bindings name :-((