Other Parts Discussed in Thread: TMDSCNCD28335,
Hi, I am experiencing a curious issue. I am using MATLAB Simulink 2018a for creating and loading the application code. Application code consists of ADC blocks, sinusoidal reference, control, PWM reference and PWM blocks (standard three-phase inverter closed-loop control)
There are four different cases, each with different results I have trouble explaining. In each case I monitor two signals on DAC (DACOUTA and DACOUTB): Ch1 is a sinusoidal reference and Ch4 is a space vector PWM reference.
- I load application code (Build, Load, Run and Boot from Flash (stand-alone)). Ch1 is a sinusoidal reference (50 Hz) and Ch4 is a space vector PWM reference (50 Hz) -> expacted results
- Same application code, but now in an External Mode: Ch1 is a sinusoidal reference (50 Hz) and Ch4 also a sinusoidal reference (50 Hz).
- I remove most of the code and keep only a sinusoidal reference and PWM reference calculation (open-loop control). I load application code (Build, Load, Run and Boot from Flash (stand-alone)). Ch1 is a sinusoidal reference (100 Hz) and Ch4 is a space vector PWM reference (100 Hz).
- Same simplified application code, but now in an External Mode: Ch1 is a sinusoidal reference (100 Hz) and Ch4 also sinusoidal reference (100 Hz)
Case 1 (Build, Load, Run) and 2 (External Mode):
Case 3 (Build, Load, Run) and 4 (External Mode):
Not sure why DACOUTB (Ch4) is showing different result for cases 1 and 2; can this mean the code for space vector reference is not executing?
Also, why is there a difference between case 1 and 3 when the waveform frequency increases from 50 Hz to 100 Hz? Does this mean all the code is executing slower in the former cases (case 1 and 2) .. which I could live with if I knew the fundamental and any other sample time is 2x higher for the 'bigger' code?
I had a similar issue with TMDSCNCD28335 and asked the question in the MATLAB forum where they suggested it might be due to overrun and I should optimise the sinusoidal reference block generation. So I moved to TMDSCNCD28379D, split the code between two CPUs and implemented a new sinusoidal reference calculation: now I am using optimised C28x DMC and IQmath block in the code and generate only ramp (0 - 2pi, 20 ms) and by using inverse Park transformation (Vd is set to 1, Vq and V0 are set to 0) I calculate three-phase sinusoidal reference.
Update:
Different waveform issue resolved.
In the space vector waveform calculation block I had several Simulink switches in the code, so it seems they stayed in a different position when the External Mode was running compared to the standard Build, Load and Run option. The zero-sequence waveform was not being injected into sinusoidal reference, hence the same waveform. Now I removed switches and the waveforms are as expected... It seems there is a problem with the switch block!
The frequency difference is still present.