Here, in pwm.c file, the TIM1_OCPOLARITY_HIGH,
There is configured polarity for OC and OCN channels. Please adjust for all 3 pwm channels.
Also first disable the PWM as seen on that piece of code, by setup TIM1_OUTPUTSTATE_ENABLE,
TIM1_OUTPUTNSTATE_ENABLE and test before enable on all of the channels, to make sure the change you did do work.
I hope stacecoke can also validate this my suggestion.
void pwm_init_bipolar_4q (void)
TIM1_TimeBaseInit(0, // TIM1_Prescaler = 0
(512 - 1), // clock = 16MHz; counter period = 1024; PWM freq = 16MHz / 1024 = 15.625kHz;
//(BUT PWM center aligned mode needs twice the frequency)
1); // will fire the TIM1_IT_UPDATE at every PWM period cycle
255, // initial duty_cycle value
eimertvm wrote: ↑
Jan 24 2019 11:00am
For my bike am I using a kt36/48ZWS, but for my mopet/scooter I would like to use KT60 controller to get at least 2KW.
After flashing the software on the KT60SVP and powering it on with a testing voltage of 36V I blew some mosfets.
After removing all of them and retrying it with only the low side active (3 mosfets) It didn't blew. but adding a high side mosfet created a big spark.
comparing the KT36/48 to the KT60 pcb i concluded that the pin-out of the microchip is the same but the mosfet-driver-circuit is different. Only the low side is the same (sort of). The high side consist of a PNP trasistor (Y2) in the KT36/48 and a NPN transitor (Y1) in the KT60.
My question: How can I invert the duty cycle of the HIGH side. So if I want a duty cycle of 200 the chip need to been set to 55, and from 0 to 255, and from 255 to 0 etc. I am a starter in programming, only familiar with Arduino
The marking on the transistor is G1(NPN) Y1(NPN) Y2(PNP).
simple diagram in the pictures
HIGH SIDE KT36/48ZWSRM-SLS02G
KT36 48 HIGH SIDE.jpg
LOW SIDE KT36/48ZWSRM-SLS02G
KT36 48 LOW SIDE.jpg
high side right, low side left KT36/48ZWSRM-SLS02G
KT36 48, righ HIGH, left LOW.jpg
HIGH SIDE KT60SVPRCKD-JLS01
KT60 HIGH SIDE.jpg
LOW SIDE KT60SVPRCKD-JLS01
KT60 LOW SIDE.jpg
HIGH SIDE left, Low side right KT60SVPRCKD-JLS01
KT60 righ LOW, left HIGH.jpg
KT60SVPRCKD-JLS01 & KT36/48ZWSRM-SLS02G
KT60 up, KT36 48 down.jpg