Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

need help making a duel signal generator

Status
Not open for further replies.

ramadiaz

New Member
Ok this may be easy or very complex. First up go easy on the tech stuff as i only have a basic understanding of circuit function but im capable of making most things and have no problem understanding components etc.

what i need is a simple square wave generator and i have found many using 555 gate etc or even 2 transistors, but what i also need is a separate secondary wave that is set at a multiple frequency of the primary, none of the circuits i found have component values and i dont know how to calculate the exact signals i require

ok here are the specs: primary signal (a) wants to be about 16Hz and very short duty cycle like 2% and the secondary signal (b) needs to be exactly 24x(a)Hz with duty cycle around 30% and about 6-9v for both would be fine and the wave shape is not critical

I know the counting thing will be the killer and ideally they would be stable and accurately counted but not synchronised. i know this is asking a lot so if its too complex we can compromise and just make the secondary signal tuneable with strategically placed variable resistor and I can set it up with a 2 channel scope etc.

Ok explanation WHY!

i play with aftermarket ECU's and i often need dummy engine signals to simulate the engine running while i scope the ECU outputs and set up and zero in multi coil ignitions etc. most engines have a multi tooth trigger on the crank and a single tooth trigger on the camshaft, so this will simulate these signals, if i have a 24&1 signal i can set up the ECU for any 4, 6 or 8cyl engine
 
the easiest for me would be use PIC device (12F675 for example) driving a couple opto coupler to output the signal. But that requires a little bit upfront investment / learning curve.

otherwise, try 555's. they are pretty reliable and it shouldn't be that difficult to wire them up.
 
Set the 1st 555 to run at the frequency you need, the use that to trigger a 2nd 555 running at the frequency you need and adjust the timing components for the duty cycle..

Attached is a zipped spreadsheet that may help
 

Attachments

  • 555 calcs.zip
    68.9 KB · Views: 171
The best way to do this is to make the 384Hz oscillator first (probably using a 555), and then use a divide-by-24 digital counter using CMOS logic to create the 16Hz signal. I dont have time right now, but later today I will come up with a schematic if this will work for you.
 
I'm with Mike. The divide-by-24 digital counter is the way to go. It's stable and no tweaking required except, perhaps, to adjust the 384Hz frequency.
 
How accurate?

For 16Hz a 32768Hz watch crystal oscillator followed by a 2^11 divider.
 
Set the 1st 555 to run at the frequency you need, the use that to trigger a 2nd 555 running at the frequency you need and adjust the timing components for the duty cycle..

Attached is a zipped spreadsheet that may help


cheers, this looks looks the most simple and capable for me. can you help me with a little more plain detail.... ie exact circuit sketches with component values :) i know your zip file has most of the information but like i say im a bit sketchy on the technical stuff

the fast signal needs to stay reasonably consistant, will i just need to finely adjust the frequency with a scope to phase them corectly so the trigger point wont upset the signal at every reset.

We can bring the low frequency down to 6-8hz this will be better anyway, like the engine is idling and make it less sensitive to set up
 
The best way to do this is to make the 384Hz oscillator first (probably using a 555), and then use a divide-by-24 digital counter using CMOS logic to create the 16Hz signal. I dont have time right now, but later today I will come up with a schematic if this will work for you.

this does sound interesting but sounds complex, will it be difficult to design and build??? i need exact circuit diagrams with all component values to build anything
 
this does sound interesting but sounds complex, will it be difficult to design and build??? i need exact circuit diagrams with all component values to build anything

Stare at this. 555s and 4017 counters are readily available.
 

Attachments

  • 384-16gen.jpg
    384-16gen.jpg
    128.7 KB · Views: 227
  • 384-16genPlot.jpg
    384-16genPlot.jpg
    165.7 KB · Views: 171
Stare at this. 555s and 4017 counters are readily available.

hey thanks this looks awsome! and i recon i can build it no problem, will it run on 12v?

thinking further about it, the whole thing needs to be slowed down to about half or even less 160 - 190Hz is perfect, the camshaft turns at half engine speed so the syncronising puls is only read at every second engine rev

what variations will this require and can we make it adjustable with a variable resistor without upsetting anything?

lastly can i get different divider intervals by simply using different pins from the 4017 counters? again without upsetting anything, this would be handy for engines with different numbers of trigger teeth.

cheers
 
Just a further thought looking at how those counter/dividers work, can we do away with the second 555 circuit? the duty cycle is not critical so can we reduce the primary duty to about 20% and then just use that output straight from the counter for the secondary output?? and will it have the same duty time as the primary signal but every 24th puls as required??.... am i making sense???
 
hey thanks this looks awsome! and i recon i can build it no problem, will it run on 12v?

Yes, it will run on voltages up to 15V, but I would not go higher than the resting voltage of a lead acid battery, say 12.6V.

thinking further about it, the whole thing needs to be slowed down to about half or even less 160 - 190Hz is perfect, the camshaft turns at half engine speed so the syncronising puls is only read at every second engine rev

The left 555 determines the running rate. Making C2 47nF will slow it down by a factor of 22/47= 0.46, so you will get about 180 Hz, while still preserving the 30% duty cycle. If you vary only R1 or R3, the frequency will change, but so will the duty cycle. If you want to preserve the 30% duty cycle at each new frequency, either change the capacitor, or you will have to change R1 and R3 at the same time.

what variations will this require and can we make it adjustable with a variable resistor without upsetting anything?

Unfortunately, to get a 30% duty cycle out of a 555, you need the funky second resistor/diode in the 555 timing network, which means varying two resistors simultaneously. A ganged dual-pot would work, or adding a new divide by 3 counter (just to get a digitally derived 33% duty cycle) and running the 555 at 3X the frequency would work.

lastly can i get different divider intervals by simply using different pins from the 4017 counters? again without upsetting anything, this would be handy for engines with different numbers of trigger teeth.

Yes, the first divider can be strapped to divide by 1, 2, 3, 4, ..., 10, and so can the second divider, just by moving the feed back tap that goes to the R (reset) input. This means you can get any total divide ratio which can be expressed as the product of two integers from 1 to 10. For example it the first divided by 7 and the second by 5, you would get a total divide of 35...
 
Just a further thought looking at how those counter/dividers work, can we do away with the second 555 circuit? the duty cycle is not critical so can we reduce the primary duty to about 20% and then just use that output straight from the counter for the secondary output?? and will it have the same duty time as the primary signal but every 24th puls as required??.... am i making sense???

The natural output duty cycle of the divide by 6 counter is 1/6=16.6%. If that will work, you can eliminate the second 555. However, the CMOS output of the counter will not drive much of an external load, so depending on what the 16Hz pulse is connected to, you may need a "buffer" of some sort. The 555 as shown will drive ~ 200mA. The naked CMOS output will only drive ~ 2mA, which would be a 6KΩ resistance or higher.
 
cheers thats excelent explinations, i did a bit of research on the workings of both the 555 and the counters so understand and see what is happening a bit better, the counter stays high untill the next signal not for the duration if the initial input signal so that will bump my duty cycle way up as you say.

sorry for all the questions but i love finding out how things work and building stuff, this project is getting better all the time, ie rotery switch to change counting settings etc. and speed controll so i can also set up things like boost controllers and shift lights etc.

for speed controll 50% duty cycle is fine for the primary signal, so can i then use a single variable resistor for that? and lastly can we offset the signals slightly by driving the counters from the falling edge of the primary wave or from the inverse pin 5?? from the first 555, or is this just a low signal or -ve drive? this is because an ecu cant have the two 2 rising edges coinciding, or is there some other way to do this? i can adjust the settings in the ecu so one reads the rising and the other reads the falling to make it work but its much better if i dont have to

cheers
 
...for speed controll 50% duty cycle is fine for the primary signal, so can i then use a single variable resistor for that? and lastly can we offset the signals slightly by driving the counters from the falling edge of the primary wave or from the inverse pin 5?? from the first 555, or is this just a low signal or -ve drive? this is because an ecu cant have the two 2 rising edges coinciding, or is there some other way to do this? i can adjust the settings in the ecu so one reads the rising and the other reads the falling to make it work but its much better if i dont have to

cheers

Here is a modified circuit. I removed the 555 oscillator and replaced it with one that has a 50% duty cycle over a wide range of frequencies. See here for an explanation of how it works.

Since that left a couple of sections of the hex inverter/buffer, I added a pulse delay and a pulse width circuits to the final SingleTooth output so that its edges are not coincident with the MultiTooth signal and so that it was narrow. You can play with the R and C values in this section to move those edges around.

The 4049 has more output current than a standard CMOS output, so the two outputs should drive your ECU. New circuit and simulations attached, including the close-up of the relative timing between MultiTooth and SingleTooth.
 

Attachments

  • EnginePulseGen.jpg
    EnginePulseGen.jpg
    287.8 KB · Views: 188
  • EnginePulseGenDetail.jpg
    EnginePulseGenDetail.jpg
    139.1 KB · Views: 177
Wow! this is getting easier to build.... and harder to understand all the time :)

but i think i follow what youve done and its very cunning, much slicker than doing it with timers, looking at the 4049's they have 6 internal gates so i only neeed the one ic, then all i need to do is hook power to Vdd and earth to Vss on all three ic's and we are there?

i got some of the bits today i will pick up the rest tomorrow and get to work,
will keep you posted, love your work
 
...
but i think i follow what youve done and its very cunning, much slicker than doing it with timers, looking at the 4049's they have 6 internal gates so i only neeed the one ic, then all i need to do is hook power to Vdd and earth to Vss on all three ic's and we are there?...

Yes, print out the data sheets on the two types of CMOS ics. You will have to choose the pin numbers to go with the indicated pin function. Look up the Vdd and Vss pins. Connect Vdd to 12V; Vss to ground. Put a 100nF capacitor between Vdd and Vss in a copuple of places.
 
Single chip 4 freq output

I have a Quad Frequency Generator DDS chip. Settable from .001 Hz to 39,999.9 Hz. I burn the chip to any set freq, then you power the chip from a 9 volt battery and a lm7805 voltage regulator
Square wave output 50% dutycycle. To get a different dutycycle you could use a CD4017. The output uses 8 pins of the chip (2 each) for the 4 outputs as 1 pin goes high the other goes low (rail to rail)
It is based on the PIC chip with a 20MHZ xtl :D
 
Yes, print out the data sheets on the two types of CMOS ics. You will have to choose the pin numbers to go with the indicated pin function. Look up the Vdd and Vss pins. Connect Vdd to 12V; Vss to ground. Put a 100nF capacitor between Vdd and Vss in a copuple of places.

OK ... think we are gettign it near perfect. just a couple more little Q's

1) all we are concerned with is the rising edges so we might not need the delay, without it will the secondary puls have its rising edge aligned to the falling edge of the primary signal??... if so this is perfect as it is! they are all evenly spaced apart and remain constant at all speeds

2) lastly ...what couple of places should i put the little 100nf capacitors? across all three of the ic's?

cheers

ECU's 101 for anyone interested in following this
Are only concerned with the rising edges of the signals, typically from a pair of reluctors so the signals are quite small also. The ecu generates everything from the multi tooth signal straight off the crankshaft and all the second signal does is tell the ecu to reset and start counting again. If they coincide the ecu can get confused on whether or not to count the coinciding pulse. It resets to the same crankshaft position every second engine revolution (4 stroke eng) hence the single secondary signal is read from the camshaft to syncronise only, being subject to slight mechanical variations from things like belt stretch or timing chain wear etc. The only other major signal the ecu reads is engine is load, typically read directly as manifold vacume or a mass air flow meter on the intake (sometimes straight from throttle position mostly for racing applications) from there the ecu just calculates and applies delays to the ignition timing and duty cycles to the injectors for each cylinder from load/rpm tables adjusting with air and coolent temperatures etc..... engine runs!
 
...
1) all we are concerned with is the rising edges so we might not need the delay, without it will the secondary puls have its rising edge aligned to the falling edge of the primary signal??... if so this is perfect as it is! they are all evenly spaced apart and remain constant at all speeds

2) lastly ...what couple of places should i put the little 100nf capacitors? across all three of the ic's?
...

Here is another tweak. The rising edges are not coincident. I left the pulse width circuit to shorten the SingeTooth signal to less than one MultiTooth period. If you dont care about that, and you could use Fn as the output, you can eliminate D1, C2 & R2, but leave both inverters in the path from Fn to SingleTooth to buffer the signal.

Put the caps right across Vdd and Vss on each IC.

Send a picture when you get it running.
 

Attachments

  • EnginePulseGen.jpg
    EnginePulseGen.jpg
    305 KB · Views: 152
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top