On Sunday 04 March 2012 20:29:02 Jon Elson wrote:
> >
> Do not try to control FET dead-time with software. Very simple
> RC circuits with an added diode to reduce the R in one direction
> have been used for years. The R delays turn-on, the diode
> causes fast turn-off.
>
> Jon
Thanks for the hint.
As an exercise I wrote this component.
Joachim
component delay_rising_edge "jf's delay for bldc outputs: delay rising edges";
//inputs
pin in bit inh;
pin in bit inl;
pin in bit pwml; //for pwm lower fet's
pin in bit pwmh; //for pwm upper fet's
//outputs
pin out bit outh "High-side driver for phase";
pin out bit outl "Low-side driver for phase";
param rw unsigned delaycount=3;
option data dre_data;
author "Joachim Franek";
function _ nofp "delays rising input edges to avoid cross current in the power
stage of a bldc/pmsm driver";
license "GPL";
variable int counth=0;
variable int countl=0;
;;
typedef struct {
int lasth;
int lastl;
} dre_data;
FUNCTION(_)
{
int newl;
int newh;
int temph=0,templ=0;
newl = inl;
newh = inh;
if ((newl == data.lastl) && (newh == data.lasth)) //low and high the
same as last cycle
{
temph = newh; //do nothing
templ = newl;
}
else //low or high uneven
{
if ((newl == 1) || (newh == 1)) //rising edge low or
high: delay the rising edge
{
if (newl == 1) //rising edge low: delay low
{
temph = newh;
countl=delaycount;
}
if (newh == 1) //rising edge high: delay high
{
templ = newl;
counth=delaycount;
}
}
else
//falling edge low or high
{
temph = newh; //do nothing
templ = newl;
}
}
if (counth>0)
{
temph = 0;
counth--;
}
if (countl>0)
{
templ = 0;
countl--;
}
if ((temph!=0) && (templ!=0)) //check min one is low
{
temph=0; templ=0;
}
if (pwml == 0) //pwm for lower fet's
{
templ=0;
}
if (pwmh == 0) //pwm for upper fet's
{
temph=0;
}
outh=temph;
outl=templ;
data.lasth = newh;
data.lastl = newl;
}
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users