I set up a model in simulink containing a couple of ADCs which sample signals , a few calculations are done ( 2 PR controllers ) and the output is used as the duty cycle to an epwm . I set up the epwm for 20 kHz ( 50 microseconds ) . The ADCs also sample at the same frequency.
First I tested a simple - sample a single signal via 1 ADC and then output from PWM. This worked perfectly , I get a 20 KHz PWM signal and after filtering , get my input signal. Then I tried my model, which I though was working fine but then I noticed the pwm had the frequency of about 6 kHz ! I hadn't changed any settings!
Is there a reason this happens ? Does my model not meet timing , so matlab slows down the system?
Additional Info : I had a sine block , which I replaced a buffer containing sine values and now its outputting a 20 kHz wave again.