Help needed with F2812 based inverter

Hi I want help on multirate simulations. I want to run a real time system with two different simulation step for its sub systems. I have attached the vissim block diagram. When I compile and run an inverter system, the response is very slow and not as expected. Even the reference is not being generated at the specified rate.

Good day V- IIT Madras

Hi V,I see you are running

Hi V,
I see you are running one rate for your controller (200KHz) and another (1MHz) for your ADC subystem. You can't run much of a subsystem at 1 MHz on a 150 MHz part because at best you could only execute 150 machine instructions per microsecond tick, but due to interrupt overhead, cache stall etc, you can only execute ~100 assembly instructions. This does not leave you much room for your control calc. The good news is that TI has built-in hardware support so you don't need to sample at the rates you specified. Here are some suggestions to overcome your problems:

  • Problem 1 is that you are trying to run your control much faster than needed. Your PWM has a period of 7500 and an up/down count for an effective period of 15000. Since your system clock is 150 MHz, one full PWM waveform is running at 150 MHz / 15000 = 10 kHz. You can not update your PWM any faster than that, so your control should run at 10 kHz. While VisSim can sample at 200KHz, there is no need for your chosen period.

  • Problem 2: Normally in digital power you want to synchronize the ADC unit with the PWM waveform so that you measure current when it is flowing. The F2812 ADC Config... dialog lets you do that. You can configure the ADC to automatically sample on "T1 Period Match" (middle of active high off time) or "T1 Underflow" (middle of active high off time). Which you choose depends on the topology of your inverter. Note that your low pass discrete Bessel filter will need to be redesigned to run at 10 KHz instead of 1 MHz. This is just a click of the IIR filter wizard followed by the S->Z button to perform the bilinear transform.

  • Problem 3: You should check "Use full scale value = 1" in ADC Config..., this will speed up ADC use and avoid unneeded scaling.

  • Problem 4: You used floating point for saw tooth and delay in your "reg_gen" subsystem. As the F2812 is a fixed-point part this will run quite slowly. Change to fixed point to speed your alg. High level fixed-point blocks like sawtooth ramp, counters, one shot, delay, edge detect etc. are found under Diagrams > Tools > Fixed-point.

  • Problem 5: You were running your "new_out" debug diagram at 1 MHZ, but the JTAG can only run at 100-200 kHz. There is no need to run faster. Also, it is convenient to run in autorestart mode instead of choosing an arbitrary long end time.