Prev: distributed computing without the distributed computing toolbox
Next: Avoid local stack variables with 2007b
From: Kopi on 14 Apr 2010 03:10 Hello! I've made a space vector PWM model in Simulink which outputs duty cycles for three phases (say A, B, C or U, V, W). Now I am stuck because I don't know how to convert duty cycles to times when phase is ON and OFF. (and use a center aligned PWM) I've tried to made a timer with level 2-Sfunction and c - code (and clock_t) but didn't get it work =/ So how this problem is solved? I hope that description below helps to understand what I mean.. T = switching time (in seconds) tA = duty cycle for phase A (percentages) time_zero = (T - T * tA) / 2 time_one = T * tA output = 0 ; when ( 0 < timer <= time_zero ) output = 1 ; when ( time_zero < timer <= (time_one + time_zero) ) output = 0 ; when ( (time_one + time_zero) < timer <= T ) then clear timer. Is this possibel at all? Thanks for help and sorry of my english skills =) ---- Kopi ----- |