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.

Field Oriented Control on EZ DSP F28335

Other Parts Discussed in Thread: CONTROLSUITE

I have an F28335 EZ DSP.  I am trying to impliment a Field Oriented Controller.  I have downloaded the FOC example for 28335 in Control Suite.  That example is for the High Voltage kit.  I do not have that, I have the EZ DSP.  How do I determine in CCS4 what IO is being used in the example application so that I can use that same IO in the EZ DSP?  I have a 3 phase mosfet bridge that I can connect my EZ DSP to, but I need to figure out what IO to use.  I am a 40+ yr old grad student and working engineer who has not done any C programming for nearly 20 yrs.  I also understand that I may have to change the IO assignments to use the appropriate IO in the ez dsp.  I just do not see where in the CCS file structure the IO assignments are made.

Thank you.

Brad Mularcik

  • Brad,

    You'll want to look at C:\ti\controlSUITE\development_kits\HVMotorCtrl+PfcKit_v1.3\HVPM_Sensorless_2833x\HVPM_Sensorless-DevInit_F2833x.c

    To see the device / IO set-up.

    You would then need to route the correct pins to your power stage.

     

  • Thanks.  I have a lot to learn here.  I feel like a caveman looking at a calculus book.  When I look at the IO assignments in this file, I see the pwm assignments, but I do not see the adc and qep?  I did however go to the control suite documentation and get the HV kit schematic and that tells me what pins the DSP is using for the various functions, but I still need to understand the code.

    Brad Mularcik

  • ADCs are hardwired to pins, you don't have to set a mux.

    QEP are at GPIO 20-23 in the file I pointed you to.

    We are about to release a motor control primer. I have a section on the file associations, what is where, etc. But I should probably expand to include all of this set-up information as well.  It can be confusing/intimidating for a novice.

     

  • In order to use this HV kit code with my 28338 EZDSP board and my driver hardware, I will have to also bring in feedback from my inverter to the EZ DSP for Bus voltage, phase voltages and phase currents.  I see those circuits on the HV kit schematic.  Where do I find the code that sets the scaling of those feedback signals?  My circuits will be slightly different, and will therefore have different scaling.

    Please advise.

    Brad Mularcik

  • Brad,

    Have you looked at the HV Kit code for delfino and piccolo in ConrolSuite?

    controlSUITE\development_kits\HVMotorCtrl+PfcKit_v1.4\HVACI_Sensorless_2833x

    If you see in the ISR we normalize the ADC values here. Not much is going to change except for the offsets on your board. 

    for example the current is normalized as follows,

    (controlSUITE\development_kits\HVMotorCtrl+PfcKit_v1.4\HVACI_Sensorless_2833x\HVACI_Sensorless.c)

       #ifdef DSP2833x_DEVICE_H
        clarke1.As=((AdcMirror.ADCRESULT0)*0.00024414-0.5524)*2*0.909; // Phase A curr.
        clarke1.Bs=((AdcMirror.ADCRESULT1)*0.00024414-0.5539)*2*0.909; // Phase B curr.
        #endif                                                           // ((ADCmeas(q12)/2^12)-0.55)*2*(3.0/3.3)

    Also the multiply by 0.909 would not be needed if you are only using delfino, we had ot multiply by that to keep normalization same b/w piccolo and delfino.               

      #ifdef DSP2833x_DEVICE_H
        clarke1.As=((AdcMirror.ADCRESULT0)*0.00024414-OffsetLegA)*2;              // Phase A curr.
        clarke1.Bs=((AdcMirror.ADCRESULT1)*0.00024414-OffsetLegB)*2;            // Phase B curr.
        #endif

    Same goes for voltage,

    Regards

    Manish Bhardwaj

  • Looking at C:\ti\controlSUITE\development_kits\HVMotorCtrl+PfcKit_v1.4\HVPM_Sensorless_2833x\HVPM_Sensorless.c

    Look at line 628

    The scaling happens inside the

    C:\ti\controlSUITE\libs\app_libs\motor_control\math_blocks\v2.0\volt_calc.h

    macro

    The ADC driver is

    C:\ti\controlSUITE\libs\app_libs\motor_control\drivers\f2833x_v1.0\f2833xileg_vdc.h

     

  • Is this all in PU?  I do not see where the gain of the voltage sensing circuit on the HV kit board is accounted for.  There is a voltage divider and an opamp circuit that scales the sensed voltage relative to the actual voltage.  Where in the code does this gain scaling occur?

  • Brad,

    We scale it for the entire ADC Input range, that's why the multiplication by (1/2^12=0.00024414), We do not translate it back to a physical world quantity,

    We use references in build 1-2-3 for IqRef and IdRef such that they takes the physical scaling into account,

    Also you can find all the divider values here controlSUITE\development_kits\HVMotorCtrl+PfcKit_v1.4\~HVMotorCtrl+PFC-HWdevPkg\HVMotorCtrl+PFCKit-R5\HV-DMC-Calculations.xls

    Regards

    Manish Bhardwaj

  • Hello,

     

    I am having some of the same issues (I am using the experimenters kit but using my own hardware, 900V,1400 Amp inverters from APS to control a large Axial Flux Motor) and I have found this post very helpful, so thank you. I have been following the build guide for the sensorless FOC PMSM example and my plot windows do not look at all like the manual says it should as I increment the build level. Moreover, the user guide says I should be seeing different plots between 2A and 2B. Could you explain how to get the plots to follow the various build levels?

    I believe at level 2 the motor should spin around, but mine doesnt move and the inverter just starts 'singing'. I have tried flipping the out of phase flag and I still get the same result. My motor has 18 poles (9pp), and I have changed this value in addition to my stator resistance and inductance in the HVPM-sensorlessSettings.h. Other than that, is there anything else that I need to do to configure the software to control my motor?

    Thanks for your help.

     

    Gideon Prior

     

     

     

  • Gideon,

    Did you put the lsw to equal to 1 ? 

    Also if that's what you have already tried please play with the value of VqTesting and VdTesting, these are dependent on the scaling of the sense parameters on the board,

    Regards

    Manish Bhardwaj

  • Thanks for your reply. I wasnt setting lsw, but it I am still having a problem. I am using GPIO0->high side A, GPIO1->low side A, GPIO2->high side B, GPIO3 -> low side B etc

     

    Under the scope, I see the high and low sides switching on at the same time. I tried switching it to GPIO0->high side A, GPIO1->High Side B, ...GPIO5 low side C and I am still not able to spin the motor. In particular I am seeing oscilations in the switching time of all the low sides, and it gets worse when I increase VqTesting.

    1)Where can I find out the correct GPIO to Switch connections?

    2) If I am using VqTesting, and VdTesting, do I need to bother with setting iqRef and idRef? Are the testing voltages generated by simulating an input to the SVM block?

    Thanks again for your help

  • Gideon,

    Are you using the pwm driver fo the HV Kit or the LV Kit,

    From what you have described the HV Kit driver would suit you, and if you are using the HV Kit project you should be getting this,

    what oscillations are you talking about? If you have SV PWM you would see oscillating PWMs,

    Please Refer to incremntal build document on diagrams where it details on which builds VqTesting is used and on which iqRef etc.

    Regards

    Manish Bhardwaj

  • I am driving a large, rather exotic motor and I am using a 900v, 1400A inverter from Applied Power Systems, so unfortunately I am not able to use the HV project kit. The documentation says you are using GPIO0-5 for PWM, but it doesnt say which side (high or low) each one is mapped to. I think I have it through a scope and trial & error, but I am seeing oscilations in the PWM at build level two where, at a certain VqTesting, the low side and the high side will periodically turn on at the same time.

     

    Additionally, I noticed that there is no sensored FOC for a PMSM using the delfino chip, and the app note included in the control suite says to add a few lines of code to calibrate the QEP. It looks like it gets the calibration angle if lsw==0, but I am setting that to 1 before I run. I guess I am not understanding what lsw does, and I seem to have missed it in the documentation.

     

    Lastly (I do appreciate you helping me with this rather long list!) , I described in my earlier post the data log plots not behaving as it says they should in the incremental build documentation. I am always generating the same plots and they do not change as I change the build level. Could you point me to some documentation about how this is supposed to work? The documentation has plots listed as A6, B6, A7, B7 at build level 2, but mine always stay at A0, B0, A1, B1 and they dont look anything like what is shown in the doc.

     

    Thank you so much for your help

     

    Gideon

     

  • Brad

    I am planning to buy EZ DSP 28335 for BLDC motor control about 2.2kW.

    What would you recommend what I start from?

     

    Na

     

     

  • Na,

         I am not sure I understand your question.  I am using the EZ DSP with the IO connected to my own inverter circuit.  As far as the connections to the inverter are concerned, I have hade the IO connections to the inverter (including all feedback connections) the same as the IO connections for the TI high voltage kit.  This way, I can use the example code for the high voltage kit to control my inverter.  I am doing a field oriented control, so I am using the example code for FOC on the 28335 for the high voltage kit.  This code is part of the high voltage kit files under TI Control Suite which I downloaded from TI.

    I hope this helps.

    Brad Mularcik

  • Brad

    As I said that, I would like to run brushless DC motor(BLDC) thru. the three phase inverter up to 2.2kW.

    And by connecting to load to the BLDC motor, would like to keep monitoring DC link voltage.  And by connecting a series circuit that  switch (IGBT or Mosfet) and power resistor in parallel to the DC link voltage for the inverter, I would like to dissipate the braking (regenerative energy) thru the high power resistor by turning on the switch if the DC is fully charged.   My plan is to use TI high voltage kit and play with BLDC motor control and make my own inverter for this regenerative braking test setup for 2.2KW BLDC motor with dynamometer using EZ DSP 28335 with my own inverter. I am just wondering if it is a right step or anything you can recommend for my test setup?

    I mean an example code for BLDC motor control  and hardware I/O setup between EZ DSP and my own inverter like this data, where can I get this?

    Thanks,

     

    Na

     

     

  • Na,

         Look at Control Suite from TI (free download).  There is an example for the 28335 for High Voltage BLDC.  You can also look at the schematics for the HV kit along with the schematic of the EZ DSP and figure our how to imitate the same control and feedback signals of the HV kit when connceting the EZ DSP to your inverter.  This way, the HV kit code will run on your setup with the EZ DSP.  The TI guys can give you more help than this I am sure, as I am just trying to make mine work right now.

    Good Luck,

    Brad

  • Thank you, Brad

    Now it sounds work for me. I will let you know if I have a problem for using this.

    Have a good weekend.

    Na

     

  • I was away from this project for a while but am back on it now.  I am having some problems.  I am doing Build Level 2 right now.  I can get the motor to turn by increasing the value of Vqtesting from 0.15 to 0.25.  However, when I do this, my inverter mosfets get hot.  I do not think I have a shoot thru issue.  It looks like I do not have overlap of the gate signals. The inverter circuit I am using is one of our circuits for a BLDC.  I have modified the feedback resistors to have seperate feedback resistors for the A and B legs.  The resistors are connected between the source of the low side mosfet and ground.  I did notice that the feedback resistors are wired differently on to the PS21765 in the HV kit schematic.  It appears there that there are resistors from the low side sources of U to W V to W and from W to gnd.   I also see that you suggested to someone else that Isw must be set to 1.  I have tried it at 1 as well as the previous default value of 0.  What is the Isw signal? 

    I am open to any suggestions you have on how to proceed.

    Thanks.

    Brad Mularcik

  • Brad,

    Isw is really LSW. . all lower case.  It does nothing until you get to build level 3

    I have been pounding on the same set of code. . and it appears that we are trying to solve the same problems.

    Will Friesen

  • lsw stands for loop switch...

     

    it's used when we close the speed loop, from the torque loop..

     

    Brad,

     

    Not sure why the mos are getting hot, are they rated for the voltage and current levels..

  • Manish,

            The inverter circuit and motor are an existing motor and circuit that we presently use in a 6 step application.  I modified the circuit to have a current feedback resistor on 2 of the legs of the inverter, instead of only a single feedback resistor for all 3 legs as in our original circuit.  The current and voltage ratings of components should not be an issue.  I did an experiment by running the level2 code with the motor disconnected.  The mosfets do not get hot.  When I have the motor connnected, they do not get hot until I change the Vqtesting to anything higher than 0.16.  At 0.15, it can run a long time and the mosfets are not too hot to touch.  Unfortunately, at that setting, the motor just oscillates.  When I change VqTesting to 0.2, then the motor turns but the mosfets get hot.  I am using the same 5uS deadband that we use on our 6 step BLDC application with this inverter and motor.  Do I understand correctly that the current loop is not closed in the level2 build?  I am not seeing a pretty current waveform like figure 17 of "Sensorless FOC of PMSM_F2833x.pdf"  DLOG_4CH_buff2 and DLOG_4CH_buff4 should be the clark1.alpha and clark1.beta waveforms right?

    Please advise.

    Thanks,

    Brad Mularcik