Shop OBEX P1 Docs P2 Docs Learn Events
Fuel Injection - Page 2 — Parallax Forums

Fuel Injection

245

Comments

  • markistuffmarkistuff Posts: 20
    edited 2007-05-26 17:49
    Well Great news, i solved the backfireing problem.· The first few times i had the engine running it was really really rich,· so i fowled up the O2 sensors and it would over compensate and make the mixutre really lean.· i ended up disableing it temperaraly and set the ratio manual.· i connected some POTs to the unused analoge inputs on the board and·used that to·set the ratio.· and also i had to calcualte out the VE.· i would run the engine steddy at a certain RPM and adjust another POT that would control the VE%, and graphed it all out and made an equation for rpm vs VE.· the engine is only supost to rev to 3600 rmp, but i take it to 4500.· .· today im going to program that into the code.· the VE would be diferent for·every engine i belive.· but now i can rev it at any rpm steady and as long as i have the VE set right it runs perfect. no backfireing.· oh i checked the ignition and it was out a tiny bit.··another thing i forgot to compensate for is the time it takes for the injectors to open up, so i programed that in as well.· ill upload the newer version of the code once i get it finished and tested.

    So for my setup i think the mosfet drivers im useing will be allright.··the engine is a·industiral aircooled 842 cc engine.· but for any bigger aplication it would be a good idea to switch it to the IRL510's.··Im useing High Resistance Fuel Injectors so i dont have to run PWM,· i just used the pulse out command and it gives it full power for the entire pulse width.· but yes if i·knew more·before i started the project i would have gotten alot of differnt parts.· especialy the sx48,··but its a learning prosses.

    William asked what the SR8 port is for.· well when i have time and have figured out all the programing exquations for the fuel injection. i plan on using that as a seiral input output to the computer so i can send and read what is going on inside the engine while its running.



    I need to find a really fast and effective way to get the engine RPM.· i cant use the count option as it will take to long.· i was thinking· of using PULSEIN, and have it only time the amount of time that the Hall sensor is reading 0.· i think its for only like 20degrees of each revolution.· but if i can get that time then multiply it by the correct constent, the i will beable to get the rpm value.· thats the only way i could figure. unless i have the rpm somehow going into a anloge input and just read that. but im not sure how to do that.· ill give the pulsin a try but any sugestions would be apreciated.

    Thanks everyone for your input into this project
  • Capt. QuirkCapt. Quirk Posts: 872
    edited 2007-05-26 18:26
    Your making your own ECU, your not bound to·restrictions the OEM's use·in their own units

    Fuel ratios very from about 10 to 16:1 depending on the situation and the rpm.

    I believe Mega Squirt has downloads for adjusting their maps. It's a usefull example.



    (edit)5/28/07

    There are 2 books written by Bosch and sold by SAE that may also be of help
    (Automotive electric/electronic systems) *(Automotive Handbook) both are very detailed

    Also: SAE papers, mainly papers before 1985 or so, that are rich in information. You can buy them online or better yet, If you live close to a University that has a Technical wing. University Librarys are open to the public to use. Get yourself a copy card and you can spend a whole day reading and coping SAE papers and Mech_E papers.




    Post Edited (Capt. Quirk) : 5/28/2007 7:07:58 PM GMT
  • bennettdanbennettdan Posts: 614
    edited 2007-05-26 18:32
    I agree with you on that Capt. Quirk its that most motors with a 14.7 to 1 AFR tends to have the best fuel economy but most high power vehicles run around 12.5 to 1 its just depends on the motor and combo of parts on it..

    The standard o2 sensor outputs a very small voltage change between 12 to 1 up to 15.1 so the tunning is not as accurate with a standard o2 sensor the standard one use .45vdc output when it is at 14.7 to 1 and the wideband o2 sensors put out 2.5vdc at 14.7 to 1 and have a much wider reading range this makes tuneing with them a more accurate situation..
  • Shawn LoweShawn Lowe Posts: 635
    edited 2007-05-28 06:31
    Sorry-
    I couldn't get megasquirt to pull up. Is it www.megasquirt.com?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Shawn Lowe


    My last words shall be - "NOT YET!!!"
  • william chanwilliam chan Posts: 1,326
    edited 2007-05-28 12:56
    Mark,

    I think you need to use assembly language.
    You haven't started talking to the PC yet but you are already facing timing problems with pulsein and pulseout.
    If you use assembly, 20Mhz would be more than fast enough to do everything required.
    I will help you with the assembly language if you need my help.

    Another thing, I always use 1K resistors between the SX and the PC or notebooks and never had a problem.
    I never needed the 8v supply for serial communications.
    If you trust me on this, then the new board design need only one 5v regulator.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.fd.com.my
    www.mercedes.com.my
  • bennettdanbennettdan Posts: 614
    edited 2007-05-29 03:43
    William,
    I have one question for you why are you so set on mark having to run this project on 20mhz? The megasqurit and alot of the OEM ECU units use 50mhz and if he make the fuel control run on the 50mhz clock speed now when he gets into controlling his timming or controlling a tranny or anything else as it progresses the code will not have to be modified.
  • John CoutureJohn Couture Posts: 370
    edited 2007-05-29 06:06
    Bennettdan,

    William had indicated that it may be possible to lower the amount of current that the board draws.· He indicated that by lowering the mhz to 20mhz along with some other tweaks it would reduce·current consumption, eliminate the need for two regulators and lower the heat signature of the board.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    John J. Couture

    San Diego Miramar College

    Post Edited (John Couture) : 5/29/2007 6:10:59 AM GMT
  • bennettdanbennettdan Posts: 614
    edited 2007-05-29 16:57
    John,
    I see what you are talking about but his is using the two regulators because one is for the 8v for his comm to his PC circuit but the 1 amp regulator he has should provide plenty of current. Someone suggested using a Max232 chip so he could use on 5v regulator so he wont have to piggyback the regulators.
    Mark needs to add some mosfets to feed the current to the Injectors so he can cool them with a heatsink, I believe the drivers he is using will overheat and cause problems later on... when he starts driving the unit on his ride he will need to install this in a weathertight container of some kind and thats when the electronics will start getting hot.

    Mark,
    ···· I have used this cheap trick on some other outside projects and it will get you by until you get a good box, just use a cheap ziplock box or any other container with an airtight lid that comes off easy if you need it to untill you get the bugs out.

    Post Edited (bennettdan) : 5/29/2007 5:07:31 PM GMT
  • John CoutureJohn Couture Posts: 370
    edited 2007-05-29 20:55
    To all, the recommendations to date:

    1) change MOSFET MIC4422 to IRL510 (IC4,5,6,7) to handle larger load and eliminate 8.5 voltage requirement
    2) swap out A1015 for a Max232 to eliminate 12V requirement and allow communication with laptop via standard RS232
    3) provide easy (and small) connector for RS232
    4) use one 5V regulator
    5) reduce MCU mHz if possible to reduce heat and power consumption

    Mark,

    What sensors are you using? i.e. datasheets URL's on hall effect sensors?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    John J. Couture

    San Diego Miramar College
  • bennettdanbennettdan Posts: 614
    edited 2007-05-29 21:07
    John,
    Myself and Bean think that you would have a better PWM signal if you used the internal timer on the SX48 also...
  • IbsenIbsen Posts: 68
    edited 2007-05-29 23:46
    I think I read on the MegaSquirt site, that you need to monitor the battery voltage and compensate the injectors on time...
    I think that the injector open and close slower if the voltage is low...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    *.*

    Ibsen

    " It's nice to be important, but
    ·· more important to be nice... "
  • william chanwilliam chan Posts: 1,326
    edited 2007-05-30 01:24
    I went to megasuirt.com and saw the Megasquirt II ECU running at 24Mhz.
    Why don't we decide on a 3 pin thru hole resonator, so we can use 20 or 50Mhz later depending on personal preferences.

    Are the injectors common positive ( common anode )?
    If it is, then the IRL510 is beautiful, b'cos it pulls the other injector pin to ground.
    If they are floating, the IRL510 will also do.
    If they are common ground, we need to change to a p-type mosfet.

    BennettDan,

    Even though the 7805 regulator can handle up to 1 amp, it needs plenty of heat sink.
    To handle even 500mA, dropping 13v to 5v, it will heat at 4 watts !
    From my experience, it can only handle up to 150mA without heat sink in tropical countries.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.fd.com.my
    www.mercedes.com.my
  • Capt. QuirkCapt. Quirk Posts: 872
    edited 2007-05-30 05:50
    I checked out their mpu chip specs, it runs at 40ns/cycle
  • william chanwilliam chan Posts: 1,326
    edited 2007-05-30 07:11
    40ns / cycle means about 25Mhz right?
    How many cycles per instruction can be MPU execute?
    If it executes at 4 cycles per instruction, the SX is already 4 times faster at the same frequency.

    Bean,

    Do you recommend SX/B be used for ECUs?
    Tell us your opinion.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.fd.com.my
    www.mercedes.com.my
  • IbsenIbsen Posts: 68
    edited 2007-05-30 16:21
    How about using this 5V 1A Switching voltage regulator ? (http://www.dimensionengineering.com/DE-SW050.htm)
    It has it's own heat sink....



    Model: DE-SW050

    Performance: Up to 30V input range
    83% typical efficiency, up to 87%
    <2% ripple
    1A output (continuous)
    1.25A peak output (1 min)
    1.3V typical dropout voltage at full load
    Can be put in parallel

    Applications: Battery powered applications
    Robots
    Point of load voltage regulation
    Any application where a linear or LDO regulator is dissipating too much heat or a large heatsink is undesirable

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    *.*

    Ibsen

    " It's nice to be important, but
    ·· more important to be nice... "
  • BeanBean Posts: 8,129
    edited 2007-05-30 16:53
    william chan said...
    40ns / cycle means about 25Mhz right?
    How many cycles per instruction can be MPU execute?
    If it executes at 4 cycles per instruction, the SX is already 4 times faster at the same frequency.

    Bean,

    Do you recommend SX/B be used for ECUs?
    Tell us your opinion.

    I'm not familiar with ECUs, but looking at the fuel1.sxb file it looks like the main program loop is I/O bound by the I2C commands reading the sensors.

    I don't see any reason why SX/B wouldn't work. There are very few program that SX/B or SX/B with a bit of assembler won't accomplish.

    Any project that requires PWM would greatly benefit from the SX48. Using an interrupt to generate PWM on the SX28 is a great waste of processing power (though it is useful to be able to do it).

    Bean.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    “The United States is a nation of laws -· poorly written and randomly enforced.” - Frank Zappa

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    www.hittconsulting.com
    ·
  • william chanwilliam chan Posts: 1,326
    edited 2007-05-31 02:47
    Bean,

    I am also not very well versed with SX/B.
    I need to ask you a question.

    If a main loop of a SX/B program is busy with the I2C communications, how can we ensure that incoming serial
    bytes from a PC won't be lost?

    Thanks.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.fd.com.my
    www.mercedes.com.my
  • ChrisPChrisP Posts: 136
    edited 2007-05-31 17:06
    Being involved in building some hotter motorcycles etc for a while I'll just toss in my 2 cents on A/F ratio's. First part being, that varies drastically by engine design, most of the bikes I deal with would melt holes in things anywhere close to 14.7:1 so thats something to keep in mind, most 2 strokes are considerably richer than that as well as most cars at any kind of load at all.

    The 12.5:1 number that John threw out is a good full throttle starting point, and be very very careful taking any gasoline engine above about 13.5 at any condition other than idle. There are a tremendous amount of calculations and variables to deal with to attempt to run something at a stoic ratio. First being what was the original engine designed for?

    The project is awsome Marki, keep it going.

    My 2 cents on the clock speed thing?· If the chip is stable at 75 I'd go for it. For my own applications I've stopped at 50mhz strictly due to environmental concerns. Sealed enclosure, heat build up etc etc. Keeping in mind Marki's very realistic 14,000 RPM goal... The more clock the better I say, at 20 there's a very sneaky suspicion that·its going to run out of power fast trying to do real time processing..

    14,000 RPM is 233 rev per second, or 4.29ms per revolution, in end result on each revolution on a 2 cylinder, you need to fire the ignition, control dwell, timing advance, and fire the fuel injector as well as control injector duty cycle. Maybe everything doesnt have to be recalculated for every revolution but odds are the full sensor array will have to be read, stored, and values redone more often than most people think. Under full accel any delay in doing true real time calculations will result in a drift in the air fuel at minimum. So what is acceptable drift? How fast will it drift? What is the rate of accelleration?

    Marki, huge props on this one. Its always been beyond my level of bravery and yours is already up and running!
  • BeanBean Posts: 8,129
    edited 2007-05-31 17:44
    william chan said...
    If a main loop of a SX/B program is busy with the I2C communications, how can we ensure that incoming serial
    bytes from a PC won't be lost?
    William,
    · You cannot. Just like the BS2 the program must either wait at the serin command, or impose a timeout. Either way the code must be executing the SERIN command of the data will be missed. Unlike on the BS2 it's not too much trouble to use interrupt driven serial input using SX/B. I believe Jon Williams has posted several programs that do this.

    Bean.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    “The United States is a nation of laws -· poorly written and randomly enforced.” - Frank Zappa

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    www.hittconsulting.com
    ·
  • GAFGAF Posts: 25
    edited 2007-05-31 19:39
    Hi,· I am an engineer·and have been involved in Engine Performance Development at both Ford and Chrysler Corp for more years than I care to mention.· This work has keep me involved with many different type of engine·controllers and strategys.· I·think your project will be awsome, making a controller from the SX chip, great project.· Certianly, using a·Speed-Density·system approach will be the most stable.·

    MFR air = Density * (Volume Flow Rate)* VE

    MFR fuel= MFR air/(A/F)

    Volume Flow Rate can be calculated from the engine displacement and the RPM.

    So, the requred PW is determined from the fuel mass.

    Remember, the MAP sensor requires a small orfice (~0.020" to 0.035") to damp out the dynamic pulsations that are present in any intake system, especially at higher loads and RPM's. Also VE (Volumetric Efficiency) can be estimated, for a first cut try 0.90.· The only other thing I would mention here is that to drive a ignition coil primary voltages can be very high ~ 500 V and we usually use a IGBT to handle this.··
  • IbsenIbsen Posts: 68
    edited 2007-05-31 22:03
    Would it be feasible to use the Multi Threaded SX/B, discussed in a previous thread ?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    *.*

    Ibsen

    " It's nice to be important, but
    ·· more important to be nice... "
  • Sparks-R-FunSparks-R-Fun Posts: 388
    edited 2007-05-31 23:56
    It is not terribly difficult to add a background UART to handle serial communication under SX/B. While it is true that you can not use the built-in SERIN and SEROUT commands to do so it takes only a little more effort to learn to use subroutines written by Bean, JonnyMac or others. In fact, the one I use the most is written entirely in SX/B. It simply handles the bits directly instead of using the built in commands to do it!

    - Sparks
  • bennettdanbennettdan Posts: 614
    edited 2007-05-31 23:57
    GAF,
    I though the primary voltage on the ignition coil was still just 12vdc then is raised that is what the coil is for so you just switch the 12vdc with a PWM signal and the ignition coil will fire? Can you explain the 500v you are talking about in more detail?

    Does anyone know if instead of using a A/D converter to read the O2 sensor why not use a Opamp configured as a comparator and then set the Voltage reference to .45v? Normal O2 sensors readout .45v when it = 14.7 that way you will deal with just a high or low signal instead of extra code to read the O2 sensor.

    Post Edited (bennettdan) : 6/1/2007 12:11:33 AM GMT
  • GAFGAF Posts: 25
    edited 2007-06-01 00:42
    Bennettdan,

    Yes, you are correct in that we supply 12V DC to the primay side if the ignition coil.· When the magnetic field collaspes·it induces a voltage into the primary somewhere between 200 and 500 V, depending on the type of ignition coil.· The purpose of the condenser on the old "points" system was to prevent arcing at the contacts as a result of·this voltage.· Hope this helps


    O2 sensors usually read between 0.7 to 0 volts:· or High when when it·the A/F is·Rich and Low when it is Lean of stoichiometric.· A comparator should work fine.
  • bennettdanbennettdan Posts: 614
    edited 2007-06-01 01:28
    GAF,
    Do they use some type of flyback circuit to route the power back into the battery or do they rely on the diode in the IGBT to handle the spikes?
    You are right about the .7 or .8 on the O2 sensor and also the speed density do not use the O2 sensors if they above 70% duty cycle right because the motors may lean out?

    Post Edited (bennettdan) : 6/1/2007 1:42:19 AM GMT
  • markistuffmarkistuff Posts: 20
    edited 2007-06-01 05:25
    I have been busy the last few days working on other projects that have higher prioity, like reroofing, and building a fence, etc.·· All the input and comments·everyone·has·are great.· hope all this info that has all been bought together can helpout others oneday who want to tackle a·simlare project.··

    i took the buddie out for a little test drive up and down the block.·· thier are a few things that·i have to work out.··i·found out that the VE is alot differnt when the engine is under load verses no load.·· so i need to reprogram that.··and my throttle body really·didnt work to well. tryed to build one but it lets it idle way to high,·so i got a good throttle body and need to hook it up.· then thier are a few things i need to program into the code.·

    GAF - im not sure if im doing the right equations to calculate out the pulse width.· when i was writing them up i noticed that the rpm was cancled out, so i just left it out.· hopefully that dosnt cause to many problems.

    Air Density·(kg/m³)·= 1000 * MAP(KPA) / 287 * TEMP(K)

    Pulse Width (ms) = AirDensity(Kg/m³) * Displacment(m³)/2 * Ratio(fuel / air) * InjectorFlowRate(ms/Kg) * VE· + Injector Opening Time(1 ms) + Accelorator Enriching.
    for the accelorator enriching.· i have the sx read the value of the tps and store it.· then next time round it reads the new tps value and tackes the differnece, only for opening, and mulitplys it by a constent to give me how many ms pulse width to add to make it have no hesitation.

    I'll try restricting the opening to the MAP sensor see if that helps smooth things out.
    I've been trying to write an equation to figure out the VE.· i wrote one but it applies to when the engine has no load on it.· when a load is attached·it requiires alot more fuel.· before i had the VE porportate only to the RPM,· but when i get some time ill do some testing and figure one out to give me the VE in relation to the MAP reading and RPM.·· the engin is very inefficent. its a old flat head horizontaly opposed kohler.· its only supost to run to 3600 but it runs safe up to 4000 rpm.· but the reason for such high MHz is i want this project to beable to be used on a motocycle engin eventualy that goes up to 14000 rpm.· the buggie is·my testing grounds for projects.

    i attached the last version i made of the program. its very messy and i havent done any of the fixes i mentioned earlyer.· probable wont get around to it for a few days.· going camping this weekend.· but·the engine sure starts up great.· before i used to have to crank the engine for about 30 seconds with the choke on before it would fire up and stay running. now just·bairly·hit the starter and it fires right up.
    ··
    BTW, i havent started school yet.· i plan on going to a tech school in september for electrical engineering.· i figured this project would get my "feet wet" in what i want to be doing.
  • william chanwilliam chan Posts: 1,326
    edited 2007-06-01 09:28
    What is a MAP sensor?

    John,

    How about drawing another board in Eagle using the SX48 and a 3 pin resonator for bennetdan and me.
    We can draw from Mark's experiences and then implement improvements on a board that is more targeted towards 4 cylinder cars.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.fd.com.my
    www.mercedes.com.my

    Post Edited (william chan) : 6/1/2007 9:49:06 AM GMT
  • GAFGAF Posts: 25
    edited 2007-06-01 10:42
    Markistuff,

    When you developed your equation for mass flow and the engine RPM cancelled out, then something went wrong.· Without engine speed your·Speed-Density system·degrades to just a·Density system.

    MFR air = Density * (Volume flow Rate) * VE

    Density= MAP/(R*T)·· where: MAP = manifold absolute pressure

    ············································R=gas constant

    ··········································· T = inet air temperature

    Volume Flow Rate =Displacement * RPM

    Therefore:

    MFR air = (Disp * RPM * MAP)/(K *T) * VE··· where: K=const to make the units work

    MFR fuel = MFR air/(A/F)

    for most fuels and·MAP levels 75% of max MAP you can run stoichiometric ie. 14.6 lbm air/1 lbm fuel and stay closed loop with the O2 sensor.· Beyond that·you shoud be in open loop and run richer 12.5:1 is fine.· I do not know what kind of engine you are using be generally a lean A/F at high speed and load will result in a·piston with a large hole in it.
  • IbsenIbsen Posts: 68
    edited 2007-06-01 17:18
    If you are going to design another board using the SX48, why not update it to be able to run a 4 cyl, V6 or V8 engine.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    *.*

    Ibsen

    " It's nice to be important, but
    ·· more important to be nice... "
  • GAFGAF Posts: 25
    edited 2007-06-01 19:56
    Bennettdan,

    For the ignition drivers they use a IGBT with an internal diode to handle the voltage spikes.· I was just looking in the Digi-Key catalog and they have some manufactured by International Rectifier in a·TO220 case for around $3.50·each.
Sign In or Register to comment.