Newbie making an ignition timer


Closed Thread
Results 1 to 18 of 18

Hybrid View

  1. #1
    Join Date
    Jul 2006
    Posts
    36


    Did you find this post helpful? Yes | No

    Default

    The engine that I am currently working on for this project is a simple, one cylinder Briggs and Stratton based generator. SO, it is a constant RPM motor at 3600RPM. Therefore, I don't think I need anything really in the way of lookup tables, etc. It is statically timed now, so that's all I need for electronic control. I just want to be able to adjust the delay manually. I'll handle idle control mechanically.

    The reason for using software instead of physically moving the position of the sensor is really just one of flexibility. When I get it working on this, then it will work on ANY motor with a static timing by simply mounting the Hall effect sensor on the leading edge of the magneto.

    As for Hydrogen: Compared to fossil fuels it's heaven BECAUSE it burns so fast and in such a wide range of ratios (07%-74% Air to fuel.) In an internal combustion engine, that fact makes it more efficient because it doesn't need time to "get going" like petrol. It should be ignited at almost top dead center and will have done it's work and completed combustion before the valve opens. Additionally, and this is huge, we don't need to throttle the AIR intake. It always runs "lean," wide open air intake! We simply meter the amount of fuel. That fact itself has great consequences on efficiency. Furthermore, since there is no time for heat to transfer to the surrounding cylinder head, etc BEFORE TDC, the engine runs very cool, for zero Oxides of Nitrogen emmissions - the exhaust is cleaner than the air that went in to it (the stuff we breathe.)

    I'm sure I could make a solid state ignition circuit to replace the magneto, but I would like to do it with software to reduce hassles with positioning the sensor.

    As you can see, I Love talking about this stuff. Don't EVEN get me started about what Hydrogen can do mixed WITH fossil fuels. Gas, diesel, veggie oil, propane, turpines, all run in a standard engine with Hydrogen injection. It's true.

  2. #2
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    969


    Did you find this post helpful? Yes | No

    Default

    I am glad to hear experts talk. I do not have much knowledge about engines except how the IC engine works; but 2 stroke/4 stroke is going a little deep for me. However, I like to hear you folks talk about alternate fuels and TDC and BDC concepts. I had to work on a CNG timing kit a while back, though this was totally in hardware; no microcontroller.

    From your concept Chris, I think Bill has suggested right. You need to use the PICs interrupt capability to get it to respond to the magneto pulses reliably. If you sense in a loop (Polling) you may miss pulses now and then and lead to major knocks in the engine (perhaps, since you are talking H2)

    As for catching the 2.5V on signal, it will be a bit out of spec for the PIC if it drifts up / down. I suggest you to level shift the signal if you can before giving it to the PIC.

    Off hand I do not have any snippets / links to offer, but I know every bit / byte matters.

    Cheers
    Jerson

  3. #3
    Join Date
    Jul 2006
    Posts
    36


    Did you find this post helpful? Yes | No

    Default My first code

    Thanks for the encouragement. Here's my first attempt at making something other than just thinking about it. I realize there is a lot wrong with this. Just please be gentle with me. I know I don't have a clue what I'm doing, but I want to try. Assume a 16f877 for now.
    (And how do I put it in a scrollable window like I see in other posts?)

    DEFINE ADC_BITS 8 'Number of bits in ADCIN result
    DEFINE ADC_CLOCK 3 'ADC clock source (rc = 3) ***WHAT IS THIS?
    Define CLOCK_FREQUENCY = 20
    DEFINE ADC_SAMPLEUS 50 'ADC sampling time in microseconds
    DEFINE OSC 20 'Oscillator speed in MHz

    TRISA = %11111111 ' Set PORTA to all input
    TRISB = %00000000 'Set Port B to all outputs
    ADCON1 = 2 ' PORTA is analog '****Is this necessary?

    sensor var porta.0
    coil var portb.0
    delay var byte 'Set variable "delay" as one byte

    ON INTERRUPT GOTO spark: ' When hall effect is sensed, go make a spark
    INTCON = %10010000 ' Enable RB0 interrupt ***I don't know what value goes here to make it listen to porta.0..???**

    loop:
    ADCIN 0, delay ' Read channel 0 to the variable "delay"
    ADCON ?? 'Convert it to decimal???
    delay = delay * 2 'A multiplier to make the ADC input result in
    'something meaningful in microseconds(2-510us)
    coil=0
    goto loop:

    spark:
    DISABLE ' Disable interrupts in handler

    pauseus delay ' This delay retards the spark
    while dwell=1 coil=1 ' This turns on current to the coil while the
    ' hall effect is sensed
    RESUME ' Return to main program
    ENABLE ' Enable interrupts after handler
    Goto loop: 'I don't know why I put this here - not needed right?
    end


    I'm embarrased to even post this considering the expertise here, but I want to learn and most importantly, I want it to work.
    Thanks,

  4. #4
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Hi ChrisHelvey,
    The Briggs magneto has both a moving magnet and under the flywheel you have a set of conventional contact points. When the points open the magneto fires.

    Automotive computer ignition systems typicaly have 2 input sensors to detect crankshaft position, one provides a TDC reference signal and the other is ofset so as to provide the signal to fire. The second signal actually is several degrees in advance of tdc and is the signal which gets delayed, but never later than the tdc signal.

    I think a good approach would to be to follow that example. You could build a lookup table to provide an advance curve, based upon RPM.

    A small disc with 1 or 2 holes could be used to trigger 1 or 2 photo transistor sensors, installed in place of the contact points. I say 1 or 2 because you could use 2 sensors and 1 hole or 1 sensor and 2 holes to get 2 distinct signal pulses.

    Home Machinest Magazine had an pic controlled gasoline engine featured a few months back which had solinoid valves instead of a camshaft and was equipped with electronic ignition. Here is a website featuring the authors engine: http://rbowes1.11net.com/dbowes/
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  5. #5
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Wink Real time and PbP ... take care !!!

    [QUOTE=ChrisHelvey;35917]

    ON INTERRUPT GOTO spark: ' When hall effect is sensed, go make a spark


    Hi, Chris

    That single line hurts me as a "BASIC" interrupt ...

    This means the program ALWAYS will complete the task ( Statement) it is currently doing ... before entering the interrupt stubb.

    You Have to use Assembler interrupts if you want precise and repetitive timing ...

    Now, you want to use 12F683 ... why not !!! have a look to what the CAPTURE module of the PIC can do for you ...

    generate the detect interruption ... Measure the rotation period ( TMR 1 ) ... and also measure the real computing time ... for example !!!

    a second 16 bits timer will be necessary ... if spark has to occur AFTER the hall effect is detected ( TMR1 cleared !!!) ... so you'll have to build it "manually" !!! 12F683 only has one ( 16F877 ... too ) !!!


    Alain
    Last edited by Acetronics2; - 8th April 2007 at 15:36.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  6. #6
    Join Date
    Jul 2006
    Posts
    36


    Did you find this post helpful? Yes | No

    Default Time to give up

    OK. This thread has been very useful to me, because I have to know when I am in over my head on something and this is it. You have saved me a lot of time failing. (It is clear that it CAN be done, just not by me.) Thank you.
    There are pleanty of ways to time ignition using Electronic Ignition modules and clever placement of the sensor (which is really all I was trying to avoid.)
    So, I think I'm going to scrap this idea and approach it more mechanically (precise PLACEMENT) instead of with software. (It'll be easier for me to fabricate metal than to write this program.)

    As for your questions on Hydrogen...there is no free lunch unless you make Hydrogen using Solar...and that isn't free either. BUT, we make up a lot in EFFICIENCY as a product of our efforts. And figuring gas engines are VERY wasteful, there is a lot to be gained even though we have to make it (Hydrogen.)

    I'll try to keep in touch. I'm sure I will have plenty of other practical or hair-brained ideas for a PIC to do...I think they are so cool!
    Thanks again,

    Chris

  7. #7
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Talking The third Thermodynamics Law ....

    Quote Originally Posted by ChrisHelvey View Post
    OK.

    And figuring gas engines are VERY wasteful,

    Chris
    Hi, Chris

    THE one and only question ...

    IS our giant waste of time an energy really necessary ???

    ( being here and there at the speed of light, use electric tools when not really needed, use computers to add 2 and 2 ... ( LOL !!! ) ... and so on ... )

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  8. #8
    Join Date
    Jul 2006
    Posts
    36


    Did you find this post helpful? Yes | No

    Default The FOURTH law of thermodynamics

    Although it was asked with humor...it's a great question.
    After this, I think they'll shut us down because it's off-topic, but...

    It has been suggested by many that the survival of a species or social organization will depend on its ability to most efficiently direct available energy into channels favorable to the preservation of the species.

    So, this becomes about USEFUL energy transformation.

    And then, in my opinion, we should be able to waste as much as we want as long as we don't trash our environment doing so.

    So, is ANYTHING really necessary?

    Hmmmm.....

Similar Threads

  1. Elapsed Timer Demo
    By Darrel Taylor in forum Code Examples
    Replies: 111
    Last Post: - 29th October 2012, 17:39
  2. High Resolution Timer & Speed Calculator
    By WOZZY-2010 in forum Code Examples
    Replies: 4
    Last Post: - 7th February 2010, 16:45
  3. Timer + rc5
    By naga in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 19th November 2009, 07:56
  4. Timer interrupt frequency
    By Samoele in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 17th January 2009, 23:49
  5. timer interupt help 16f73
    By EDWARD in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 3rd July 2005, 08:41

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts