Okada
Banned
I have to implement Constant V/F for a Three Phase Induction Motor. I am referring Microchip AN900 application note.
I need 6 SPWM signals.
I have configured the registers like these.
1. I want to know if I have to use a sine table with duties for 180 degrees or 360 degrees ?
2. If 180 degrees can be used then how to invert the PWM signals that is say I want to invert PWM0 after 180 degrees then how to do that ?
3. If 360 degrees can be used then how to generate the values for 360 degrees sine table. I used
https://tahmidmc.blogspot.in/2012/10/smart-sine-software-to-generate-sine.html
software but for 360 degrees it generates some negative values and I can't use negative values in the PWm duty registers.
I need 6 SPWM signals.
I have configured the registers like these.
1. I want to know if I have to use a sine table with duties for 180 degrees or 360 degrees ?
2. If 180 degrees can be used then how to invert the PWM signals that is say I want to invert PWM0 after 180 degrees then how to do that ?
3. If 360 degrees can be used then how to generate the values for 360 degrees sine table. I used
https://tahmidmc.blogspot.in/2012/10/smart-sine-software-to-generate-sine.html
software but for 360 degrees it generates some negative values and I can't use negative values in the PWm duty registers.
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 // PWM Control module enable configuration // PWM timer control register configuration PTCON0 = 0x02; // PWM timer control register 0 configured in the free running mode, 1:1 postscale,Fosc/4 (1:1 prescale) PTCON1 = 0x80; // PWM timer control register 1 with PWM time base timer bit enabled //PWM control register configuration PWMCON0 = 0x40; // PWM0, PWM1, PWM2, PWM3, PWM4 and PWM5 pins are enabled for PWM output PWMCON1 = 0x00; // Dead time control register DTCON = 0x00; // dead time disabled //Output override control register OVDCOND = 0xFF; // Output on PWM I/O pin is controlled by the value in the corresponding POUT bit // Output state register OVDCONS = 0x00; // Output on PWM I/O pin is inactive when the corresponding PWM output override bit is cleared //Fault configuration register FLTCONFIG = 0x00; // disable fault detection feature // PWM time base registers PTMRL = 0x7D; // PWM time base register (lower 8 bits) PTMRH = 0x00; // PWM time base register (upper 4 bits) //PWM time base period registers are set to get 20kHz PWM frequency PTPERL = 0x7D; // PWM time base period register (lower 8 bits) PTPERH = 0x00; // PWM time base period register (upper 4 bits) // PWM special event trigger compare registers SEVTCMPL = 0x00; SEVTCMPH = 0x00; // PWM Duty cycle registers