DIY Electric Car Forums banner

[EVDL] Bi-stable flip flop advice

1058 Views 8 Replies 1 Participant Last post by  EVDL List
I'm building a simple bi-stable flip-flop as part of a heater control
circuit for my '66 Datsun EV conversion. The basic circuit is at:
<http://ourworld.compuserve.com/homepages/Bill_Bowden/page9.htm>
Its about 1/2 way down the page called, "Single MOSFET Relay Toggle
Circuit."

I have most of the parts available to me and will be able to fit it
into a small (1" x 2" x 3") project box. I have some questions about
part selection.

I have an IRF510A FET. A quick reading of the specs (and Bill's page)
seem to indicate that will work fine to control the relay I need to
pull this off. The relay I found is a 4PDT relay with a 400 ohm coil
(inexpensive and built on 0.1 inch centers to build the circuit on
simple prefboard.) 1 set of contacts is for the flip flop (as shown),
another is for the output that will control a KUEP relay (with a 24v
Transorb on the board to control its kick.) The other 2 sets of relay
contacts are to control the lighting in the pushbutton switch that
turns the heater on and off (bi-color LED.) The voltage ratings of
the relay are quite suitable for automotive applications with a rated
pull in voltage of 8.5 volts and able to operate continuously at up
to 18 volts.

To insure that the circuit works as designed with the variable 12v
supply (usually higher) of a automobile it appears to me that I need
to reduce the value of the 2, 3k3 ohm resistors to around 2k4 ohms.
The reason being that after I push the button to turn it off the
voltage across the 2, 15k ohm resistors needs to stay under 2 volts
even if the button is held down to long (so the FET doesn't try to
turn back on.)

The 100uf cap limits how quickly the button can be pushed after
changing states. I've considered reducing its value some because the
relay has a 7ms max pull in but I am also aware that my planned
resistor change also reduces the pull in time.

Any suggestions? I am all ears for input!

Thanx,
Paul "neon" Gooch

_______________________________________________
For subscription options, see
http://lists.sjsu.edu/mailman/listinfo/ev
See less See more
1 - 9 of 9 Posts
FYI,
a very stable variant of the bi-stable flipflip can be
built with a single D-flipflop and bringing the negative
output back to the D-input.
Everytime you toggle the clock line (push-button and
debounce capacitor) you will see the output switch state.

The HEF 4013 flip flop has up to 15V power supply.

Success,

Cor van de Water
Systems Architect
Proxim Wireless Corporation http://www.proxim.com
Email: [email protected] Private: http://www.cvandewater.com
Skype: cor_van_de_water IM: [email protected]
Tel: +1 408 542 5225 VoIP: +31 20 3987567 FWD# 25925
Fax: +1 408 731 3675 eFAX: +31-87-784-1130
Second Life: www.secondlife.com/?u=3b42cb3f4ae249319edb487991c30acb

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Paul
Sent: Monday, September 10, 2007 3:57 PM
To: Electric Vehicle Discussion List
Subject: [EVDL] Bi-stable flip flop advice

I'm building a simple bi-stable flip-flop as part of a heater control circuit for my '66 Datsun EV conversion. The basic circuit is at:
<http://ourworld.compuserve.com/homepages/Bill_Bowden/page9.htm>
Its about 1/2 way down the page called, "Single MOSFET Relay Toggle Circuit."

I have most of the parts available to me and will be able to fit it into a small (1" x 2" x 3") project box. I have some questions about part selection.

I have an IRF510A FET. A quick reading of the specs (and Bill's page) seem to indicate that will work fine to control the relay I need to pull this off. The relay I found is a 4PDT relay with a 400 ohm coil (inexpensive and built on 0.1 inch centers to build the circuit on simple prefboard.) 1 set of contacts is for the flip flop (as shown), another is for the output that will control a KUEP relay (with a 24v Transorb on the board to control its kick.) The other 2 sets of relay contacts are to control the lighting in the pushbutton switch that turns the heater on and off (bi-color LED.) The voltage ratings of the relay are quite suitable for automotive applications with a rated pull in voltage of 8.5 volts and able to operate continuously at up to 18 volts.

To insure that the circuit works as designed with the variable 12v supply (usually higher) of a automobile it appears to me that I need to reduce the value of the 2, 3k3 ohm resistors to around 2k4 ohms.
The reason being that after I push the button to turn it off the voltage across the 2, 15k ohm resistors needs to stay under 2 volts even if the button is held down to long (so the FET doesn't try to turn back on.)

The 100uf cap limits how quickly the button can be pushed after changing states. I've considered reducing its value some because the relay has a 7ms max pull in but I am also aware that my planned resistor change also reduces the pull in time.

Any suggestions? I am all ears for input!

Thanx,
Paul "neon" Gooch

_______________________________________________
For subscription options, see
http://lists.sjsu.edu/mailman/listinfo/ev

_______________________________________________
For subscription options, see
http://lists.sjsu.edu/mailman/listinfo/ev
See less See more
A quick review of the specs indicate the voltage range is right (15v
recommended but some will take 18 or even 20 peak power supply
volts.) The problem is the current they can provide won't drive a
KUEP relay (at least 100ma required.) So, I would still need an
output transistor or small relay. My flip flop also has to start in
the off state (that is usually a couple of extra parts for an all
solid state solution.) Plus I still need to drive the bidirectional
LED (red/green) built into the heater switch. I would end up with the
HEF 4013 plus some external parts. The basic flip flop on Bill's web
page requires only 8 components (and by making one of them a 4PDT
relay that includes the ability to drive the bidirectional LED.)

Its an interesting part. I had completely forgotten about flip flops
on a chip. I just don't see the integrated approach helping in this
situation.

Thanx,
Paul Gooch

The circuit (from my earlier post):
>> <http://ourworld.compuserve.com/homepages/Bill_Bowden/page9.htm>
>> Its about 1/2 way down the page called, "Single MOSFET Relay Toggle
>> Circuit."

Cor van de Water wrote:

> a very stable variant of the bi-stable flipflip can be
> built with a single D-flipflop and bringing the negative
> output back to the D-input.
> Everytime you toggle the clock line (push-button and
> debounce capacitor) you will see the output switch state.
>
> The HEF 4013 flip flop has up to 15V power supply.

_______________________________________________
For subscription options, see
http://lists.sjsu.edu/mailman/listinfo/ev
See less See more
I agree that the physical relay works well for you because of your
requirement to start powered down.

To re-value the parts for higher voltage operation, it's not too hard.
Here's what I'd do:

Assume a new voltage range, say 12V to 17V

Choose resistor values so it stays in the right range. With your
suggestion of 2k4, running at 20V, the gate is held at:

17V*(15k||2k4)/(15k||2k4+15k)=2V

This is the minimum Vgs(to) of your transistor, so as long as your
battery is under 17V (any time besides equalization charging), holding
the button down as long as you want won't toggle the circuit twice.
Your resistor choice works fine.

Then all that's left is adjusting the capacitor time to make it
faster. Your relay has a 7ms max pull, but let's go a bit bigger and
shoot for 50ms. This is still fast enough to be unnoticeable to a
person, but it gives us some breathing room.

We are discharging the capacitor through some resistors, and we want
to know how long it takes to discharge from 6V to 3V. We can ignore
the gate of the MOSFET because its input capacitance is measured in
picofarads, roughly 6 orders of magnitude smaller than the discrete
capacitor.

Vs=12V to 17V
Rs=15k
Rp=2069 (15k||2k4)
C=???
Vt=4V

The capacitor starts out charged to half the supply voltage through
the two 15k resistors.
Vc(t=0)=0.5Vs

Ic=C*dVc/dt=(Vs-Vc)/15000-Vc/2069=Vs/15000-Vc/(2069||15000)

This differential equation starts at 0.5Vs, decays to 2069/17069*Vs,
and has time constant C*(2069||15000); we can write an equation for Vs
as a function of t.

Vc(t)=2069/17069*Vs+(0.5-2069/17069)*Vs*exp(-t/(1818*C))

Vc(t=50ms)=Vs*(0.121+0.379*exp(-1/(36364C)))

We're more pressed for time at lower supply voltages, so say Vs=12V
and Vc(t=50ms)=4V; then solve the equation.

4=12*(0.121+0.379*exp(-1/(36364C)))
ln((4/12-0.121)/0.379)=-1/(36364C)
-0.579=-1/(36364C)
C=1/(36364*0.579)=47uF

You can clearly see from the equation for Vc(t) that at higher Vs,
Vc(t=50ms) is higher, so you'll be farther above the cutoff voltage.

If you plug the original numbers into my equation, the voltage falls
to 3.76V after 200ms, which fits quite well. Our capacitance number
also makes sense because we are multiplying the time by 0.25, but we
are also using a smaller resistor (2k4 instead of 3k3), which requires
more current from the capacitor. We are also settling to a higher
voltage, 4V instead of 3.76V.

The value 47uF isn't exact; you'd be fine with a decent range of capacitances.

-Morgan LaMoore

_______________________________________________
For subscription options, see
http://lists.sjsu.edu/mailman/listinfo/ev
See less See more
Morgan LaMoore wrote:

> I agree that the physical relay works well for you because of your
> requirement to start powered down.
>
> To re-value the parts for higher voltage operation, it's not too hard.
> Here's what I'd do:
>
> Assume a new voltage range, say 12V to 17V
>
> Choose resistor values so it stays in the right range. With your
> suggestion of 2k4, running at 20V, the gate is held at:
>
> 17V*(15k||2k4)/(15k||2k4+15k)=2V
>
> This is the minimum Vgs(to) of your transistor, so as long as your
> battery is under 17V (any time besides equalization charging), holding
> the button down as long as you want won't toggle the circuit twice.
> Your resistor choice works fine.

That is exactly how I chose the 2k4 ohm value.

> Then all that's left is adjusting the capacitor time to make it
> faster. Your relay has a 7ms max pull, but let's go a bit bigger and
> shoot for 50ms. This is still fast enough to be unnoticeable to a
> person, but it gives us some breathing room.
>
> We are discharging the capacitor through some resistors, and we want
> to know how long it takes to discharge from 6V to 3V. We can ignore
> the gate of the MOSFET because its input capacitance is measured in
> picofarads, roughly 6 orders of magnitude smaller than the discrete
> capacitor.
>
> Vs=12V to 17V
> Rs=15k
> Rp=2069 (15k||2k4)
> C=???
> Vt=4V
>
> The capacitor starts out charged to half the supply voltage through
> the two 15k resistors.
> Vc(t=0)=0.5Vs
>
> Ic=C*dVc/dt=(Vs-Vc)/15000-Vc/2069=Vs/15000-Vc/(2069||15000)
>
> This differential equation starts at 0.5Vs, decays to 2069/17069*Vs,
> and has time constant C*(2069||15000); we can write an equation for Vs
> as a function of t.

I'm starting to loose you here. It appears that you are figuring on
the closed contacts of the relay continuing to provide power (through
a 15k resistor) until the relay is committed to switching (relay arm
is in motion.)

I had run some numbers based on only the capacitor voltage decay if
charged to 5.5v. That is 1/2 of 11v - just shy of a completely
crashing 12v system with a DC to DC converter and around 20ah AGM 12v
battery. I used a cutoff of 4v because it appears that would would
pull the IRF510A full on in a worst case scenario. So I was looking
at a 27% discharge and 30ms to pull the relay in.

All this looked good to me but I was a bit concerned about reducing
the resistance and capacitance so much. I'm no EE - I can miss
things! I had come to the conclusion that 47uF would be fine too.

> Vc(t)=2069/17069*Vs+(0.5-2069/17069)*Vs*exp(-t/(1818*C))
>
> Vc(t=50ms)=Vs*(0.121+0.379*exp(-1/(36364C)))
>
> We're more pressed for time at lower supply voltages, so say Vs=12V
> and Vc(t=50ms)=4V; then solve the equation.
>
> 4=12*(0.121+0.379*exp(-1/(36364C)))
> ln((4/12-0.121)/0.379)=-1/(36364C)
> -0.579=-1/(36364C)
> C=1/(36364*0.579)=47uF
>
> You can clearly see from the equation for Vc(t) that at higher Vs,
> Vc(t=50ms) is higher, so you'll be farther above the cutoff voltage.

I can clearly see that by using a basic RC time calculation with the
variable input voltage and fixed minimum voltage. But sadly, I've
gotten lost on the math (there are a few nice RC time calculators
online that I plug numbers into.) There appears to be some formulas I
need to learn.

> If you plug the original numbers into my equation, the voltage falls
> to 3.76V after 200ms, which fits quite well. Our capacitance number
> also makes sense because we are multiplying the time by 0.25, but we
> are also using a smaller resistor (2k4 instead of 3k3), which requires
> more current from the capacitor. We are also settling to a higher
> voltage, 4V instead of 3.76V.
>
> The value 47uF isn't exact; you'd be fine with a decent range of
> capacitances.

And as luck would have it I was looking at a nice 47uF cap with a
105C rating that I happen to have
several of in my parts collection.

Thank you,
Paul "neon" Gooch

_______________________________________________
For subscription options, see
http://lists.sjsu.edu/mailman/listinfo/ev
Paul <[email protected]> wrote:
> That is exactly how I chose the 2k4 ohm value.

Yeah, that's what I was guessing.

> > ...
>
> I'm starting to loose you here. It appears that you are figuring on
> the closed contacts of the relay continuing to provide power (through
> a 15k resistor) until the relay is committed to switching (relay arm
> is in motion.)
>
> I had run some numbers based on only the capacitor voltage decay if
> charged to 5.5v. That is 1/2 of 11v - just shy of a completely
> crashing 12v system with a DC to DC converter and around 20ah AGM 12v
> battery. I used a cutoff of 4v because it appears that would would
> pull the IRF510A full on in a worst case scenario. So I was looking
> at a 27% discharge and 30ms to pull the relay in.

You're right, I did my calculations based on continuous current
through the 15k resistor. That's the best case scenario; the worst
case is an immediate disconnect, what is what you calculated.

It sounds like you did all the necessary math on this one too; a quick
check with 47uF:
4/5.5=exp(-t/(47*10^-6*(15000||2400)))
t=-ln(4/5.5)*47uF*2.07kOhm=31ms

That's just the equation for RC exponential decay. The other math I
did was a slightly more complicated version I figured out to account
for charging through the 15k resistor while discharging through the
others. It was overkill, though; assuming the relay immediately
disconnects is more useful for finding component values and is much
easier.

> All this looked good to me but I was a bit concerned about reducing
> the resistance and capacitance so much. I'm no EE - I can miss
> things! I had come to the conclusion that 47uF would be fine too.

I'm only half-way through college, but I think it's fine. You're not
decreasing either one that much - only by about a factor of 2. In
general, reducing resistances can cause problems, but in this circuit,
you're not reducing the resistance very much, and the impedances are
high to begin with. There will be a slight increase in power required
by the circuit, but the relay still accounts for well over 90% of the
circuit's power draw.

> > ...
>
> I can clearly see that by using a basic RC time calculation with the
> variable input voltage and fixed minimum voltage. But sadly, I've
> gotten lost on the math (there are a few nice RC time calculators
> online that I plug numbers into.) There appears to be some formulas I
> need to learn.

That's not a formula that you would memorize; it's the solution to a
differential equation that I wrote to describe the problem. And this
is the hard way of doing things; you shouldn't need to go into so much
detail, a simple RC time constant works fine (as long as you know to
put the15k and 2.4k resistors in parallel to get the R).

You don't need a college degree to modify values in a circuit like
that; you chose values that work just fine.

-Morgan LaMoore

_______________________________________________
For subscription options, see
http://lists.sjsu.edu/mailman/listinfo/ev
I finally got around to finishing up the heater flip flop circuit.
Its not one of the major parts of the conversion after all. The basic
circuit is at: <http://ourworld.compuserve.com/homepages/Bill_Bowden/
page9.htm> Its about 1/2 way down the page called, "Single MOSFET
Relay Toggle Circuit." The 3.3 k resistors where replaced with 2.4 k
ones and the capacitor was reduced to 47 uF. The relay was replaced
with a 4PDT PC board relay with a 400 ohm coil.

A 24v snubber was included on the board so switching the KUEP heater
relay off wouldn't exceed the 30 VDC rating of the little relay. The
other 2 sets of contacts control the heater button lights (green when
the dash lights are on except red any time the heater is on.) In all
there are 11 .11 inch faston connectors on the board. With some care
on parts placement it all fits on a 1.9 inch by 1.5 inch piece of
pref board that will in turn go into a 1 by 2 by 3 inch project box
to be mounted near the heater relay.

Morgan LaMoore wrote:

> You don't need a college degree to modify values in a circuit like
> that; you chose values that work just fine.

Thanks - it works good.

Paul Gooch

_______________________________________________
For subscription options, see
http://lists.sjsu.edu/mailman/listinfo/ev
See less See more
On 6 Oct 2007 at 15:49, Paul wrote:

> green when
> the dash lights are on except red any time the heater is on.

You probably know this, but FWIW the use of a red light for anything but an
urgent warning in a car is generally verboten. I'd use yellow instead. Of
course it's not like you're selling the conversion and have to meet FMVSS
... but still ...

David Roden - Akron, Ohio, USA
EVDL Administrator

= = = = = = = = = = = = = = = = = = = = = = = = = = = = =
EVDL Information: http://www.evdl.org/help/
= = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Note: mail sent to "evpost" or "etpost" addresses will not
reach me. To send a private message, please obtain my
email address from the webpage http://www.evdl.org/help/ .
= = = = = = = = = = = = = = = = = = = = = = = = = = = = =


_______________________________________________
For subscription options, see
http://lists.sjsu.edu/mailman/listinfo/ev
Uh sure, try to find a momentary on pushbutton switch with a yellow
LED and green LED for internal lighting. Anyway, the car is a '66 -
the high beam indicator is red! (that was the case on my '65 Dodge too)

The heater switch isn't on the dash anyway. This is '66 Datsun
technology and the pushbutton switch is replacing the temperature
control knob. Its on the heater box itself, under the dash.

David Roden wrote:

> On 6 Oct 2007 at 15:49, Paul wrote:
>
>> green when
>> the dash lights are on except red any time the heater is on.
>
> You probably know this, but FWIW the use of a red light for
> anything but an
> urgent warning in a car is generally verboten. I'd use yellow
> instead. Of
> course it's not like you're selling the conversion and have to meet
> FMVSS
> ... but still ...

I didn't realize a loose gas cap was urgent :p

Paul Gooch

_______________________________________________
For subscription options, see
http://lists.sjsu.edu/mailman/listinfo/ev
1 - 9 of 9 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top