Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Page 15 of 46 FirstFirst ... 5131415161725 ... LastLast
Results 351 to 375 of 1127

  1. #351

    Join Date
    Aug 2011
    Location
    Moscow, ID
    Posts
    144
    Gallery
    My Gallery
    Models
    My Models
    Ratings
    My Feedback

    RE: CDI gr8flyer55

    It's easy enough to include inline assembly in your C code. Advanced programmers often check the assembly that is generated from the C code and redo any parts they don't like with an inline assembly routine.

    But the main issue is that Nyemi's code uses polling while mine uses interrupts. Polling repeatedly checks the pin to see if it's changed. With the interrupt it calls the interrupt service code when the hardware finds a falling edge. So I only get one interrupt.

    I added an if statement to check if GP2 is low when the interrupt is called. It seems to work fine in the simulator until 81 Hz (about 4800 RPM). I'm not sure what's going on here and will have to do some real world testing. I have no idea if this is just a simulator artifact or if it is a real world problem.
    -

    I did some more testing with a real spark plug and the CDI seems able to spark continuously at 63 uS between sparks. I used a trigger pulse of 3 uS, then a delay of 63 uS for each spark. That was the fastest it could spark reliably. So about 66 uS between sparks.

    So the unit can spark every 5 deg. up to 12,300 RPM!!!
    Or every degree up to 2,500 RPM!

    This is without the added resistance of cylinder compression, but it bodes well for the multispark idea!


    -Jake
    http://www.electrofunnel.com/CDI-2012/index.htm

  2. #352

    Join Date
    Mar 2009
    Location
    xnot applicable, AUSTRALIA
    Posts
    272
    Gallery
    My Gallery
    Models
    My Models
    Ratings
    My Feedback

    RE: CDI gr8flyer55

    So you are prepared to live with the fact that the hardware in present configuration and with the software switching off, will give a spark when the CDI powers up..?? Will not create problems further on with software..??

  3. #353

    Join Date
    Aug 2011
    Location
    Moscow, ID
    Posts
    144
    Gallery
    My Gallery
    Models
    My Models
    Ratings
    My Feedback

    RE: CDI gr8flyer55

    I'm not sure yet why it sometimes throws a spark a bit after you connect the power. It seems reasonable that since the hall input is normally high and the output is also normally high that either one could falsely trigger when powering up or powering down.

    When powering down, the output pin from the processor is going to drop off before the capacitors discharge. I don't see any way to prevent this. It will happen no matter what the software does.

    On power up I can add a delay before turning on interrupts. That should give the circuit time to stabilize. I'm not having much luck with checking the status in the interrupt. It seems like the interrupt gets triggered on the falling edge, but before the input actually goes to zero. That seems to be what the simulator thinks anyways.

    In any case, this really isn't much of a problem. I'm not worried about it.


    -Jake
    http://www.electrofunnel.com/CDI-2012/index.htm

  4. #354

    Join Date
    Feb 2010
    Location
    szarvas, HUNGARY
    Posts
    132
    Gallery
    My Gallery
    Models
    My Models
    Ratings
    My Feedback

    RE: CDI gr8flyer55

    Hi Jake
    My suggestion. Not unused pins. You are created to output. (Gp4-GP5).
    The GP3 Connect GND. (CONFIGURATION: MCLR = OFF)

    Multi-spark optimum.
    Minimum spark energy = 20 mJ
    1W = 1J / s
    10W power inverter. (6V * 1.7A = 10.2 watts)
    Energy is 10J per second (1000ms).
    10J/1000mS = 0.01J = 10mJ * 2ms!=20mJ

    Consequences: 10W inverter -20mJ sparks=2ms!
    Capacitor charging.
    The charging time is another approach.
    5T(Tau)=2mS=99,3%=~19,86mJ spark energy

    4T(Tau)=1,6mS=98%=~19,6mJ spark energy
    3
    T(Tau)=1,2mS=95%=~19mJ spark energy
    2T(Tau)=0,8mS=86%=~17,2mJ spark energy
    1
    T(Tau)=0,4mS=63%=~12,6mJ spark energy

    I hope so. I know.
    Regards nyemi.

  5. #355

    Join Date
    Mar 2009
    Location
    xnot applicable, AUSTRALIA
    Posts
    272
    Gallery
    My Gallery
    Models
    My Models
    Ratings
    My Feedback

    RE: CDI gr8flyer55

    One way would be to turn micro on first and off last with respect to CDI section.

    But as you say, not really a problem.

  6. #356

    Join Date
    Aug 2011
    Location
    Moscow, ID
    Posts
    144
    Gallery
    My Gallery
    Models
    My Models
    Ratings
    My Feedback

    RE: CDI gr8flyer55

    Major Release!!!

    I just released version 0.95 beta 5 on the website!

    New features...
    -Two tables!
    -Switching to table 2 via grounding GP5 (Pin #2)
    -New spreadsheet! Controls all user settings and contains/generates the code.
    -Kill switch. Grounding GP4 (Pin #3) turns off output and disables interrupts.
    -Added check in ISR to make sure GP2 has really been driven low. May prevent some high frequency noise problems.
    -Added 500ms startup delay to avoid bogus interrupts while the circuit powers up.
    -Added reverse calculation check and control point info on advance curve chart.
    -Turned on internal weak pull-up on GP2, may help avoid noise problems.

    As always, this code is pretty much untested, except for quick runs in the simulator. Run at your own risk.


    I reworked the spreadsheet quite a bit. I added macro buttons to easily copy the code, user settings, and tables to the clipboard. If you don't trust running macros in the spreadsheet you should only loose the button copy capability. There's now two curves to play with. Each curve now has more points to control AND you can move the points anywhere you want. I highly suggest not criss-crossing them though, as I haven't tried this and think it could cause problems. I've also added dots at the top and bottom showing where the actual table value control points are. I also added a back-calculated line based on converting the table values back into RPM and delay, this is the red line with little red X's. You can use this to see the maximum advance at any RPM and check your table numbers.

    Only change the values in green! I haven't protected anything yet, so if you edit a wrong value and get bunk numbers then just start over. The yellow sections in the code page are just for reference, do not edit the code in the spreadsheet.


    http://www.electrofunnel.com/CDI-2012/index.htm

  7. #357

    Join Date
    Aug 2011
    Location
    Moscow, ID
    Posts
    144
    Gallery
    My Gallery
    Models
    My Models
    Ratings
    My Feedback

    RE: CDI gr8flyer55

    The only thing I didn't get done that was suggested is make the program spark even if it doesn't have time to load the delay value. Sorry COM.

    But you can see from the red line in the curve graph if you're trying to exceed what the program can fire. I'll work on this for the next version.

    For using the two tables I suggest connecting a switch between ground and pin #2. You can use pin #1 for ground.


    Nyemi, I don't really understand the calculations involved. I wrote a little test program to see how fast I could continuously spark. Using a spark plug with 0.035" gap (~0.8mm) I was able to fire at 63 uS. With 3 uS trigger pulse + 63 uS delay = sparks every 66 uS. That seems very low, but that is what I found.

    Sparking at cylinder pressure will take more energy. If you know how to convert 66 uS at atmosphere pressure to the charge time at cylinder pressure, please share.
    Everyone may have slightly different units also.


    -Jake
    http://www.electrofunnel.com/CDI-2012/index.htm

  8. #358
    Gompy's Avatar
    Join Date
    Jul 2010
    Location
    Alkmaar, NETHERLANDS
    Posts
    404
    Gallery
    My Gallery
    Models
    My Models
    Ratings
    My Feedback

    RE: CDI gr8flyer55

    There is a turn-on time and a turn off time for the SRC.
    For a BT151 this times are 2 and 70 uS.
    So within the 63 uS the SCR didn't closed.
    No closing SCR, no building up power into the capacitor.

    Again, multi spark for this small engines are wast of energie.
    We use very small batteries and very small engines.....there is no reason to use it.
    The coils must be bigger, the batterie must be bigger and rpm goes down.

    BTW, you need atleast 20mJ (normal 50mJ) at 6 bar cilinder pressure to get a spark.
    Somewhere into the CDI topics I've calculate it.

    http://en.wikipedia.org/wiki/Capacit...harge_ignition
    CU, Rob
    http://www.electronics.gompy.net

  9. #359

    Join Date
    Nov 2005
    Location
    Hamburg, PA
    Posts
    806
    Gallery
    My Gallery
    Models
    My Models
    Ratings
    My Feedback

    RE: CDI gr8flyer55

    Hi Jake.
    This is all good news!
    Currently in the process of compiling a hex with two programmed curves. Testing them today. What I am doing is adding small .100 spacing headers to the timer board to accommodate the new switches, one for the kill button which is a N.O. Momentary switch, the other is a 2 position push on- push off for switching between the 2 available curves. I'll post a picture when I find out if it is working.

    The ignition boards I sent you as testing platforms will be used also with a wired socket to test 3 available scr's. I use either an EC103m, BT151, or a C106m. All three have a similar gate trigger voltage control turn on. All work as expected in my circuit. This enables me to test the small variances in the gates for proper control by the timer board. This test will point to the best one for the circuit. All three have the 600 volt ratings. The EC103M is only a 800 mah current rating but works great in the ignition circuit. Another choice would the X0405ME but is hard to find and costly if you do find them.
    There are 2 different pinouts between the EC103M and the larger to225 case style scr's though so some circuit modification is necessary if changing types. This is why I added a header to my test board for switching between them.

    Hopefully testing the resulting hex file today will work as planned. Results will be posted.

    John

  10. #360
    Gompy's Avatar
    Join Date
    Jul 2010
    Location
    Alkmaar, NETHERLANDS
    Posts
    404
    Gallery
    My Gallery
    Models
    My Models
    Ratings
    My Feedback

    RE: CDI gr8flyer55

    Lot of information about CDI and trigger with hallsensor
    http://www.molla.org/DIY-CDI/SC-DIY-...icle-hires.pdf
    CU, Rob
    http://www.electronics.gompy.net

  11. #361

    Join Date
    Nov 2005
    Location
    Hamburg, PA
    Posts
    806
    Gallery
    My Gallery
    Models
    My Models
    Ratings
    My Feedback

    RE: CDI gr8flyer55

    Jake, I looked over the source code and saw the changes.
    Loaded up the excel sheet and made my curves etc.
    Ran MPLAB x IDE and compiled the file, BUT I got 2 warnings about undeclared variables and an advisory of some feature it couldn't figure out. It gave no errors, build successful, but are the warnings something to be worried about since it was about the two tables of data in the source code?

    Here is what it gave me:

    LED MODE not used
    "I" not used
    "j" not used

    Advisory ccpri = *(table pointer + currentrev);

    It looks like it can't handle the statement.

    John

  12. #362

    Join Date
    Aug 2011
    Location
    Moscow, ID
    Posts
    144
    Gallery
    My Gallery
    Models
    My Models
    Ratings
    My Feedback

    RE: CDI gr8flyer55

    This is fine. Those are only warnings, not errors.
    The first three are because I have declared variables, but not actually used them in the code.

    The fourth warning tells me to check the code with their validation tool, and I don't know where it is or if I have it. Because I used a pointer to switch between the table it thinks I should use their tool to make sure that it can only get a value that will work. If my pointer took a wrong value it would read a wrong and unexpected memory location, which would give some random value in memory instead of the expected table value.

    Thanks for reminding me... I actually think there will be a problem with that pointer. When 255 is rounded up to 256 it will actually not roll over to 0 anymore. Then the pointer will be pointing at the 16-bits after the end of the table. Essentially, it will be loading a unknown value at 916 RPM.

    You can probably test the code as is, but I'll work on fixing that.


    -Jake
    http://www.electrofunnel.com/CDI-2012/index.htm

  13. #363

    Join Date
    Nov 2005
    Location
    Hamburg, PA
    Posts
    806
    Gallery
    My Gallery
    Models
    My Models
    Ratings
    My Feedback

    RE: CDI gr8flyer55

    Jake, the file has a few problems!!!
    First after inserting the newly programmed chip in a timer board, power it up, get one powerup spark which I get on all timers and chips. Then!!! As the magnet approaches the sensor (notice I said Approaches!!) you get a series of sparks, with my hearing it sounded like 4 or 5 sparks!!! If I had plugged it into my test engine first to try and start it, I'm sure it would have chopped off at least two of my fingers! Warning! Do not try this on an engine!

    After that series of sparks, it fires only as the magnet approaches the sensor, not after it leaves it. Not good!
    So I guess it's back to the drawing board for version 6 eh?

    John

  14. #364

    Join Date
    Aug 2011
    Location
    Moscow, ID
    Posts
    144
    Gallery
    My Gallery
    Models
    My Models
    Ratings
    My Feedback

    RE: CDI gr8flyer55

    Luckily, I was wrong about the above pointer problem. CurrentRev will roll over on the rounding up and that is what's actually added to the pointer. So it should work just the same.

    I look forward to hearing how the code works. I'd also like to hear how well the advance tracks on acceleration and deceleration. The way to see this would be with a flat curve and seeing how closely the advance stays the same.


    I think we're really close to a 1.0 version! If all goes well I'll probably do one more beta release, then the 1.0 version. I really can't think of that much more to add to the program. I think the accuracy is about as good as can be had, and I've used all the spare pins for features.

    -If someone has a good idea what to do with the LED I'd love to hear it. I figure that LEDmode could be another user setting. People could choose the current flash-on-spark mode, or use it to indicate sensor triggering, or use it to indicate which curve is on, etc..

    -I'll make sure the spark still fires even when it can't load a delay time.

    -I'd like to use the high (near start) values in the tables to store the user settings. The first 12 or so values are just wasting memory, and if I use them to store the settings then you can switch between two full sets of settings along with switching the tables. That should make figuring out settings easier.

    -I'd like to include some default curves with the spreadsheet. I'll add another sheet to store several curves values and buttons to load them into one of the two main tables.

    -A button to swap curves would also probably be nice.

    If there are any other ideas, now is the time to mention (or re-mention) them. I'll probably be switching to working on 12F1840 code fairly soon.


    -Jake








    http://www.electrofunnel.com/CDI-2012/index.htm

  15. #365

    Join Date
    Aug 2011
    Location
    Moscow, ID
    Posts
    144
    Gallery
    My Gallery
    Models
    My Models
    Ratings
    My Feedback

    RE: CDI gr8flyer55


    ORIGINAL: gr8flyer55
    As the magnet approaches the sensor (notice I said Approaches!!) you get a series of sparks, with my hearing it sounded like 4 or 5 sparks!!!

    After that series of sparks, it fires only as the magnet approaches the sensor, not after it leaves it. Not good!
    That is pretty much how I programmed it. If you used the default value for MSD_Start_Spark it would fire 5 sparks on the very first fire.

    I am also using the falling edge for the sensor interrupt. That means it will trigger as the magnet approaches. I figured that doing it this way would give a degree or so of extra time vs waiting for the magnet to leave. I also figured the hall trigger would be more reliable than the hall settling.

    If you want to change this then change...
    OPTION_REG = 0b00000000; // pullups on, falling edge, Tmr0
    to
    OPTION_REG = 0b01000000; // pullups on, rising edge, Tmr0

    Also change...
    else if(INTCONbits.INTF){ **** GP2 SENSOR INPUT *****/
    if(GPIObits.GP2 == 0){
    to
    else if(INTCONbits.INTF){ **** GP2 SENSOR INPUT *****/
    if(GPIObits.GP2 == 1){


    Remember that the hall switch is active low, so falling edge = magnet approaching and rising edge = magnet leaving. I don't really know enough to tell what difference this change will make. The way I understand, using the rising edge will work the same, except that it will be 1-2 degrees later.
    http://www.electrofunnel.com/CDI-2012/index.htm

  16. #366

    Join Date
    Nov 2005
    Location
    Hamburg, PA
    Posts
    806
    Gallery
    My Gallery
    Models
    My Models
    Ratings
    My Feedback

    RE: CDI gr8flyer55

    Jake, the configuration you changed to is actually backwards from the ignition mfg. standards. RCExl, and CH both top sellers in the field have it trigger as the magnet LEAVES the sensor. If this is reversed, there is no way on the engines using this program will be able to readjust the sensor mount to accommodate the way too early triggering!
    I tried this before, extremely difficult to accomplish when the screw mounting holes are predrilled on each engine for timing. I can reverse the statements in the lines for my tests, but the 5 or so sparks as it first triggers can definitely be counted by ear. It takes about 1 to 1-1/2 seconds to complete the sparks. You should physically only be able to discernibly hear what would sound like only one spark, not 5. Spacing is WAY too far apart. Might be on the order of 25 to 30 degrees apart if the crankshaft were rotating when triggered. Try it for yourself with a programmed chip, a sensor and a magnet.
    Any one else following this? I may have to just turn the feature off to eliminate the sparks if we can't figure it out. Wanted to do live engine testing today, now stuck in rewrite & program edit mode. Pooh !

    John

  17. #367

    Join Date
    Aug 2011
    Location
    Moscow, ID
    Posts
    144
    Gallery
    My Gallery
    Models
    My Models
    Ratings
    My Feedback

    RE: CDI gr8flyer55

    It can work either way I guess. I don't see any real disadvantage to getting your trigger a degree or two earlier. You won't have to adjust the sensor spacing because you just adjust it in the spreadsheet.

    This is one feature I did think of. There should be no sensor adjustments at all. You fix your sensor permanently, as close to where you want it as possible. Then adjust through the spreadsheet.

    I'm not sure about the spark issue. I believe I have the delay set for 1000 uS, so the sparks should be 1 ms apart or 1/1000th of a second. You shouldn't be able to hear then except as a buzz.

    http://www.electrofunnel.com/CDI-2012/index.htm

  18. #368

    Join Date
    Aug 2011
    Location
    Moscow, ID
    Posts
    144
    Gallery
    My Gallery
    Models
    My Models
    Ratings
    My Feedback

    RE: CDI gr8flyer55

    Seems I'm getting some questionable output also. Could be the interrupt pin state checking. I'll have it figured out shortly.
    http://www.electrofunnel.com/CDI-2012/index.htm

  19. #369

    Join Date
    Nov 2005
    Location
    Hamburg, PA
    Posts
    806
    Gallery
    My Gallery
    Models
    My Models
    Ratings
    My Feedback

    RE: CDI gr8flyer55

    Jake, got the two edits done and it worked. Now the next problem. As I start the engine everything works good. Advancing the throttle slowly is good, till I reach full throttle, then I can hear the ignition cycling on and off like an rpm limiter and the engine just acts like it needs more advance. My curve is set for 28 * at 6000 rpm till 8000 rpm, then it starts it's decline in degrees of advance. I have this same curve in the first test version and it worked just fine. Do you think I need to go past 28 to maybe 30 or more? Seems like something is really holding it back from revving up like I mentioned, an rpm limiter?
    Didn't see anything in the source code mentioning it or where it would cut off the ignition and cycle it back on. See what you can find out about this new quirk.

    John

  20. #370

    Join Date
    Aug 2011
    Location
    Moscow, ID
    Posts
    144
    Gallery
    My Gallery
    Models
    My Models
    Ratings
    My Feedback

    RE: CDI gr8flyer55

    Seems like things are working properly, just maybe bad settings.

    Try 4000 uS for MSD_Delay and 3 start sparks. If you assume that you're starting around 200 RPM then 4000 uS will fire the first spark at 5 deg. BTDC the next at TDC and the last at 5 deg ATDC.
    As for the rest, I don't know how much use the multispark is going to be.

    The values I got from my test code and the ones that seem to look right when testing the actual program code don't jive.
    Here's what I think is happening... In my test code it throws around a 1000 sparks, and I got sparks to work every 66 uS. That's about the max speed the SCR can switch. I think the fast switch times were not letting the capacitor charge up, thus making the SCR able to switch faster. But in the real application the capacitor is charged, so it takes longer to discharge, which keeps the SCR on longer, thus missing the fast rhythm of the firing.

    In any case, 66 uS seems to work for long bursts where the capacitor doesn't have time to fully charge, but not for short bursts where each firing may take more time to recycle.

    More testing to find the best settings is needed. I can't see individual sparks at these ultra fast speeds, so I can't really tell what's going on. 4000 uS seemed to produce a good spark where I could tell for sure it was firing right. But that's pretty slow and will only work at low starting RPMs.

    So for now, I would use 4000 uS for the delay, throw 3 start sparks, maybe 2 for MSD_Low_Spark, and just one for MSD_Spark.

    Anyone can help this project out and work on tuning these values. Right now I don't really have the test gear to figure out much more than I already have. Someone who has a spinning test wheel apparatus should try adjusting these settings and find the ranges that work!


    -Jake

    http://www.electrofunnel.com/CDI-2012/index.htm

  21. #371

    Join Date
    Aug 2011
    Location
    Moscow, ID
    Posts
    144
    Gallery
    My Gallery
    Models
    My Models
    Ratings
    My Feedback

    RE: CDI gr8flyer55

    Our posts keep crossing.

    You are running into the can't fire in time problem. If you look at the graph and see that the red line is below your curve. The red line is the max advance at a given RPM.

    Basically, about 51uS is burned by the time we get our delay value loaded. This is calculated out of the table values, but if you end up loading a 0 into the timer, the timer will be at 1-2 before it's turned back on.

    One quick fix might be to try this...
    Switch the order of these two lines...

    T1CONbits.TMR1ON = 1; // Turn on Timer1
    CCPR1 = *(TablePointer + CurrentRev); // Load delay table value


    There's no RPM limiter in the code yet. I tried to reproduce your problem in the simulator and couldn't find it. I know it used to drop every other sparks when the speed got too high or the delay too low.


    -Jake
    http://www.electrofunnel.com/CDI-2012/index.htm

  22. #372

    Join Date
    Nov 2005
    Location
    Hamburg, PA
    Posts
    806
    Gallery
    My Gallery
    Models
    My Models
    Ratings
    My Feedback

    RE: CDI gr8flyer55

    I'll edit and reverse the two lines and recompile. Also, in my curve, the red line IS below my curve at 6000 rpm where I am having the rev issue. Redraw and see if it corrects it I guess.

    Real time engine testing soon over for the day...getting dark shortly. I don't like working around spinning props in the dark with a flashlight. I want to follow developments while on my vacation so the tablet computer is going along. Maybe no edits or testing but can save files for later I guess.

    John

  23. #373
    Gompy's Avatar
    Join Date
    Jul 2010
    Location
    Alkmaar, NETHERLANDS
    Posts
    404
    Gallery
    My Gallery
    Models
    My Models
    Ratings
    My Feedback

    RE: CDI gr8flyer55

    28 degrees ignitiontime at high rpm, wat kind of engine is this.....4stroke ?
    If it isn't a 4stroke, please set the ignitiontime back to 15 degrees or maybe even 10 degrees at high rpm.
    If the ignition will be to early, you get to soon ignition and the engine get a flash back.
    The piston don't have enough energie to go TDC and push back.....there is your limiter !!
    CU, Rob
    http://www.electronics.gompy.net

  24. #374

    Join Date
    Jun 2009
    Location
    Ga, GA
    Posts
    396
    Gallery
    My Gallery
    Models
    My Models
    Ratings
    My Feedback

    RE: CDI gr8flyer55

    Hi Jake,

    I have tried the latest beta and I don't get any premature firing. I am still having some trouble getting a curve that works. It seems the I get 0 degrees at 200 rpm even though I have the curve set to 5 degrees in the table and then instead of advancing the curve with increased rpm it just jumps to max advance. even though my curve table shows a smooth transition.
    Regards
    Charlie M.

  25. #375

    Join Date
    Nov 2005
    Location
    Hamburg, PA
    Posts
    806
    Gallery
    My Gallery
    Models
    My Models
    Ratings
    My Feedback

    RE: CDI gr8flyer55

    Hi Rob, just tried your suggestion. This a 2 stroke engine. If I change the degrees to 10 or 15 the engine quits at that point, it has to be 28 degrees, working fine now. I will post my curves after the next engine run test. Everything else in the settings was redone and now is working good, getting good top rpms at 28 degrees at 6000 rpm to 7500, no misfires, just runs like a dream.
    I tried the 2 edits in the lines Jake suggested and that worked to switch the sensor problem. The rest was a set-point in startup settings. Curves now are all even with or below the redline for given rpm in the graph.

    John


Page 15 of 46 FirstFirst ... 5131415161725 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 10:33 PM.

SEO by vBSEO 3.6.1 ©2011, Crawlability, Inc.