help needed for 50ms interrupt circuit

caleb7777

100 W
Joined
Apr 9, 2009
Messages
186
Location
Smithers, British Columbia, Canada
I need the help of some gurus here!

I want to make a small circuit or something that will interrupt the 5v+ on the throttle for 50 ms. (or whichever line will cause 0 throttle output)
I am designing my new ebike with the star delta switch which changes the phase motor winding configuration. see here:
http://endless-sphere.com/forums/viewtopic.php?f=2&t=9215&start=120#p149061

my Cycle Analyst will control when the relay switches to the higher speed delta config.
At a set speed the CA will send a ground signal to a 5v relay I have which will then power the larger relay that switches the phases over.
the relay switching is supposed to take 30 ms with these relays.

It would be desirable if the switch always took place while the throttle was at rest so that the phases were not under as much load which is the purpose of this circuit.

I want a circuit that disconnects the throttle for 50 ms when the CA first sends the ground signal and for another 50 ms when the ground signal ceases.
This will allow no load when the relays engage and disengage automatically.

Help please guys!!!!!

OK so I have 2 working units!
These are still beta as I have not actually used them on a bike yet but test out as they should. They run on a 12v supply when using the LM7805 because DC-DC converters of this voltage are easy to find and cheap.

RK done small.jpg
caleb circuit done small.jpg


Design recommended by Rick using a 556 timer is No. 1 and the second is a circuit using a 4098 IC as an edge trigger. The second does use less power and is simpler however I noticed that it does activate oddly in one direction and appears to fire twice rather than once. I actually saw the test LED fire twice with fast pause in between. This might be fixed by a dampener somewhere but I wouldn't know. But this doesn't really affect the operation as it will still take only up to half a second for throttle to re-engage. if it worked great in both directions one could expect 150 ms throttle cut off in each direction. But as it is it might be double that when shifting back down to WYE. Which is fine.

The 4098 instructions I found called for t=0.5RC on the timing circuit attached to the 4098 so I drew it up as 150nF and a 2Mohm resistor which should then give approx 150ms.
I don't have an oscilloscope or any way to test times this small so my beta rig used very high timing constants on the left relay x1000 to find the appropriate resistance and capacitance for that relay to get ~45ms open and close delay. These values only apply to this relay.

This is the relay I used there: Aleph SD1A05AWJ 5V DC 1A View attachment Aleph SD Series.pdf

Different relay would most likely require slightly different values which you would need to test for.


And most important is a big shout out to Rick (rkosiorek), fechter, and methods on Endless-Sphere.com, and bernard on allaboutcircuits.com for all the help and tips to help this circuit live. Thank you guys. Especially Rick.
 

Attachments

  • RK done.jpg
    324.4 KB · Views: 2,955
  • caleb circuit done.jpg
    285.1 KB · Views: 2,952
You will need a 555 timer and I think you could use a transistor in the 5 volt line to shut it off for 50ms.

The problem is you dont want to switch back unless you are going slower than the top speed at the slow winding... A massive voltage spike will be produced if the motor is switched back when it is turning much faster.

If you don't have a breadboard and have never made small circuits before you might get fechter to help.

I would try looking at http://www.arduino.cc/ It is easy to program and you can tell it to not switch back unless you are going under a certain speed. Also I saw a thread about someone using one inline with a throttle. http://endless-sphere.com/forums/viewtopic.php?f=6&t=6718&p=154391&hilit=arduino#p154391

It should be easy to program it to read the speed from the CA, interrupt the throttle, switch windings and only switch back when below a certain speed. This sounds like fun but I am months away from Trying anything like that.
 
I was thinking about the switching circuit and one thing you might want to do is somehow configure it so it would be delta by default and the computer once powered up would force it to wye for acceleration then when up to speed it would switch to delta for higher speed.

That way if the computer crashes it doesn't somehow flop back to wye while running high speed in delta but that also means you would want a manual over ride in case the computer was broken or in some wild loop and I would also do like Jason did and make a way to reboot the computer. There in lies the trouble, if the computer program gets in an ugly loop ;) Which way is the wiring set or is it turning the relay on and off really fast? So maybe another safety measure which could be a large capacitor and some resistor inline with the relay so it will take a few seconds charging the cap to turn on the relay. You could plan for that within the program but it would keep the relay from going on and off very quickly if for some reason the computer was telling it to.

Either way I would be very careful to make sure the circuit/program wouldn't destroy the controller by switching inadvertently while going top speed.
 
The switching system for star and delta is done. it will work fine shifting up after a certain speed by itself and going back to star after slowing down past a bottom speed again. No problem there.
I am looking for a circuit that will interrupt the throttle (probably by operating reed relay) for 50 ms when line 'a' goes to ground and then again when ground signal ceases on line 'a'

This would in effect be completely separate from shifting circuit except for sharing same trigger.
 
I think I am getting closer here. Just lots and lots of reading on my part. But I am impressed i got this far without help. I really have no idea what this would do. i do not know what the values for C2 and R2 should be to generate a 1-5 ms pulse. Also i still have the problem that i think this will only work when the speed switch either opens or closes, not both.

Oh by the way, this is the first circuit I have ever drawn.

PLEASE HELP!!!
 
OK so that last circuit I posted is probably bogus. I looked at it again and the middle is wired wrong. Ignore the R2 and C2. the 555 timer is proper though i think. It operates by sending a brief (pulse) ground to pin 2. it won't work if ground goes straight to it and stays on. So what i need is a pulse generator from the trigger line 'a' that will send a 1-5 ms pulse to pin 2 when

a- the speed switch closes and
b- the speed switch opens.

i am sure that there is some great little IC that will do this for us but I don't know. Or something that will monitor current on the switch line and send a pulse when current changes (on/off).
 
You need a "One-Shot"'

A one shot will output a pulse of a pre-defined length on the leading edge of an input transition.
Tune the output pulse length to 50ms
Tie this active low pulse into your throttle line via a diode.
Current limit the throttle with a 2K - 5K resistor just like the CA does with its throttle control

If you want to interrupt on both the rising and falling edge of the relay swith then use two one-shots and diode couple them.

I have not tried it but that should work.
Radioshack + $5 + 20 minutes should prove it in.

-methods
 
You need two identical circuits.
One set up to trigger on 0-5
The other set up to trigger on 5-0

Tie the outputs of the two circuits together via diodes.
Aim the Cathode at the 555 so as to only sink current and not source voltage.
Tie the Anodes together and tie them into the throttle line at the controller.
On the throttle side of the throttle line put an inline resistor.
This will make it much easier for the one-shots to pull down the throttle line.

Look at the CA directions for how to tie into the Throttle line

Look at 555 tutorials for getting at the inverted output

You will learn more searching for it :)
If you get stuck I will draw it up.
It is a simple circuit, you will solve it quickly.

(No promises about it working. it ->"should"<- work but it is 12:39AM and I am laying in bed)

-methods
 
P.S. 50ms is not very long
 
Please help me fill in how I do the 2 separate triggers to 555

ms timing is easy to change once I figure this out.

Sometimes the obvious evades me... just have it ground the ebrake line on infineon....... :roll:
 

Attachments

  • cir3.jpg
    cir3.jpg
    20 KB · Views: 3,404
errrr..... Its already done.
Just wire trigger into pin 2
http://www.uoguelph.ca/~antoon/gadgets/555/555.html
(scroll down to monostable multivibrators)

When the speed switch hits that will put 5V on pin 2 which will send out a 50ms pulse on pin 3.
It really is that simple.

Perhaps you can find a discrete chip to do the same thing with less parts?
You may now want to consider BJT's instead of reed switches for reliability.

-methods
 
The trigger pulse must be of shorter duration than the time interval determined by the external R and C. If this pin is held low longer than that, the output will remain high until the trigger input is driven high again. One precaution that should be observed with the trigger input signal is that it must not remain lower than 1/3 V+ for a period of time longer than the timing cycle. If this is allowed to happen, the timer will re-trigger itself upon termination of the first output pulse. Thus, when the timer is driven in the monostable mode with input pulses longer than the desired output pulse width, the input trigger should effectively be shortened by differentiation.


This is from that site. If it is not true then great, but I thought this says that I can't have pin 2 go straight to ground. Also would this not only work when the switch closed? i need it to trigger also when switch opens.

Whats a BJT? I really don't know what I am doing here. The above were simply results of me reading a lot and thinking hard. :idea:
 
BJT = just about any old Bipolar Junction (regular) Transistor.

here is a circuit using a dual 555 timer (LM556) to trigger on both the opening and closing of the speed switch. Q1 - 2N3904 (a BJT) reverses the action of the speed switch and triggers a second pulse. the two pulses are OR'd together using the diodes and are used to drive a cheap opto-isolator. the opto isolator can be used to pull down the E-Brake line of the controller directly. this would also eliminate the switch bounce of the reed relay.

100MS DELAY.jpg

was also thing that you could build a simple circuit using an LM2917, a couple of BJT's and capacitors/resistors for under 10 bucks as the speed switch. it would read one of the motor hall sensors as an input and act as a speed switch.

i think that 50ms may be too fast so i set tis one for 100ms. but by changing the 1M resistors to 500k you can change that.

rick
 

Attachments

  • 100MS DELAY.pdf
    12.6 KB · Views: 59
caleb7777 said:
why is there 2 speed SW lines. Where are they going? one to either side of switch?

switch? what switch? i thought it was a flux capacitor. darn those pesky time and reality warps.

rick
 
now if you look very carefully you will notice that one of the switch wires is connected to 0V. this suggests that the switch is meant to function when shorted to 0V.

rick
 
first a lesson in Schematic conventions. that little arrow thingie pointing down is a reference symbol. it defines the 0V point for the entire circuit. it does not matter how many of those you have or where they are. ALL of then are connected together to 0V. that only leaves one wire as the actual input. but just in case it is not obvious....

cir4.jpg

the LM556 is just 2 of the LM555's put into a single case. so yes yoou can use a pair of LM555's.

the other circuit you got from the internet is almost functionally identical t the bottom half of the circuit i drew. the difference is the addition of C3, R2 and C4. C3 and R2 form a timing circuit that will delay the start of the 50mS pulse by 1mS or so.

but that circuit only does half of what you want. it only provides the delay when the speed switch opens. you need to combine it with your original circuit to get delays both when the switch opens or closes. that is what i did.

i would recommend adding some diodes across the relay coils to protect the electronics from inductive kickback.

rick
 
Back
Top