Shop OBEX P1 Docs P2 Docs Learn Events
Propeller EFI — Parallax Forums

Propeller EFI

jaw0001jaw0001 Posts: 7
edited 2011-01-05 11:03 in Propeller 1
Am relatively new to microcontrollers. I have programming and industrial controls experience.

Was wanting to build an EFI and electronic governor controller for a small garden tractor engine. The unit would take the following analog·inputs (I think all 0-5v):
- Manifold Absolute Pressure
- Inlet air temp
- engine coolant temperature
- O2 sensing

would take the following on/off inputs:
- ignition event
- stepper motor end of stroke (qty 2)·or rotary encoder

and the following comms
- terminal support

would provide the following outputs:
- stepper motor control (unipolar)
- injector pulse width
- output to terminal

There maybe a PID algorithm to determine where to step the stepper motor to as it tries to maintain engine speed through variable loading, and maybe how fast. I would have a counter step the motor at regular intervals to control speed.

One cog (or more) would constantly update hub variables with voltages from the various inputs. One cog would control the motor. The main cog would calculate the pulse width based on engine rpm and analog inputs, then fire the injector for the calculated time.

Questions:
1) Is spin perceived fast enough to keep up with a 3600rpm max 4-stroke engine (1800 ignition, fuel events per minute)?
2) Which propeller object and ADC (or combo) would be fast enough to populate all the variables (to the hub?) a few hundred times a second?
3) I think this has been answered, but can 12v (probably more like 13.8v) be supplied to the prop demo board? Or can I just desolder the regulators and solder on some different ones to take the regulated alternator voltage from the engine.

Comments

  • Jack BuffingtonJack Buffington Posts: 115
    edited 2010-06-15 19:11
    This is an interesting project. I'm thinking of doing the same thing with a 350 engine sometime soon. That way I'll be able to dial between 'grandma/fuel economy mode' and 'I'm going to drive like an idiot' mode. The ultimate end goal would be to have electronic intake and exhaust valves too. I understand that such a thing is possible.

    As far as the speed of spin, I'm not sure as I have programmed only in assembly as speed has been my top priority. Spin is pretty easy to use though. You could probably mock up your code and then read cnt before and after your calculations to see how long they are taking. That would be a good way to test it before possibly screwing up an engine.

    My suspicion is that spin is fast enough especially if you work things out so that your spark timing and injector pulse timing are calculated in another cog and just read from HUB RAM when they are needed by the COGS that control them.
  • Mike GreenMike Green Posts: 23,101
    edited 2010-06-15 19:47
    2) Download and look at the ADC code in the application note on the cog counters (AN001). There's a table in the contents that gives the sample rate vs. number of bits of resolution. Given the number of analog inputs, you may want to use an external multi-channel ADC rather than tie up several cogs with the ADC. On the other hand, the inlet air temperature and coolant temperature will not change quickly and there are nice temperature sensors that do their own digitization and communicate via 1-wire protocol. These can all share the same I/O pin.

    3) The regulators on the Prop Demo Board are designed for automotive use, so they're fine with a 13.8V input voltage. The issue is how much power they have to dissipate and that depends on the current drawn. The 5V regulator sees the input voltage, so the power to be dissipated = (14V - 5V = 9V) x current. There are graphs in the Propeller datasheet that show the current drawn vs. clock frequency depending on the number of cogs active. Most of the current drain will depend on what's connected to the Demo Board.

    Seriously consider adding some external power filtering, at least a series choke designed for automotive electrical system filtering and a large electrolytic capacitor (1000uF 25V) across the input terminals.
  • jaw0001jaw0001 Posts: 7
    edited 2010-06-15 20:48
    Wow. Quick responses.

    The first reply is interesting to me too, as I am a hot-rodder. However, my goal is to have a stepper control the throttle, to replace a governor on a small 14hp engine. Notice there is no Throttle Position Switch. Whoops, I do need a TPS (linear or rotary pot). There is also no drive like an idiot mode (which I would want on my 68 Firebird!).
  • pmrobertpmrobert Posts: 677
    edited 2010-06-16 12:06
    A Mazda rotary has been run off a breadboarded 2 Prop design doing ignition and fuel control based on a similar list of params in top message. You really don't have to interrogate all the sensors at every ignition event - 50 Hz is just fine. One item that is critical is sampling the MAP sensor at at a specific, consistent time in relation to each spark event. If you scope the MAP sensor signal on a single cylinder engine you will see it wildly varies very rapidly in concert with valve opening/closing, etc. Also setting up a method to utilize fueling lookup tables without consuming too much memory space is important. I used a linear interpretation algorithm on a 12x12 table and that worked well, even in Spin. IIRC a fuel lookup would consume 6ms so that speed was fine. Oh, the reason I used 2 Props is that one was dedicated to ignition and the other to fuel. That was probably unnecessary but gave me plenty of space to experiment, get things functional, then optimize. The stepper throttle should be very doable - cool project idea! Hmmm, I have an old generator that would benefit from such an idea. I'm sure it would be much more fuel efficient - the current carburetor is pig rich at all times...
  • smbakersmbaker Posts: 164
    edited 2010-06-16 17:16
    I've had thoughts about doing something like this as well. The prop seems ideally suited to the task, and you could add features like SD card datalogging, running a status display, etc.

    You might want to have a look at the Megasquirt project (I currently running a Megasquirted VW engine in my sandrail). It's an opensource DIY EFI computer. It is not prop-based (in fact I have no idea what the CPU is), but there are schematics for all of the peripherals, such as the ignition coil drivers, hall-effect pickups for the rpm sensor, fuel injector drivers, steppers for idle air control, etc. I've thought about taking the megasquirt schematic, yanking the CPU out of of and substituting a prop. I think it'd be a fun project.

    You'll also probably want to get a wideband O2 sensor (narrowband O2 sensors are a pain to tune with), and those typically have their own embedded electronics as well. They can get a bit pricey, but really help with seeing what's actually going on with the mixture.
  • pmrobertpmrobert Posts: 677
    edited 2010-06-16 20:47
    @smbaker, if you're going to use B&G's designs, etc., you may want to touch base with them first. I believe they're pretty much OK with using their concepts, designs, etc., for personal experimentation - which I'm pretty sure that's what you're talking about - but the following is from msefi.com:
    B&G said...
    Please respect that MegaSquirt schematics and other layout info are provided for educational and troubleshooting purposes only. All MegaSquirt®-related circuit design and layouts are copyright protected, and cannot be copied, modified, or used in any other manner without the express written permission of Bowling and Grippo.

    Admins: I apologize if this is a bit OT!
  • jaw0001jaw0001 Posts: 7
    edited 2010-06-16 21:29
    I do not need to control ignition. I am running a transistorized ignition with the mechanical points as a relay only. The points should supply the timing event without the use of signal conditioning (Shmitt trigger, etc.).

    Since I also intend to govern the engine, I debate about how I want to measure engine RPM. I wouldn't want the propeller to get the wrong idea the engine is turning too slow.

    There is another guy on the propeller forums who built an efi controller for a chevy 350 tbi with an SX. He used an equation instead of lookup tables. I was thinking of doing that.

    I thought Megasquirt used logic compatible with narrowband O2 sensors (since the narrow band O2 is non-repeatable away from stoich, it would simply lean/richen the mixture by a small delta every cycle until it measured stoich, it would not try to calculate the correct delta). You would therefore waste your money on a wide band O2 sensor. As I would not have a performance engine, there would be little need to tune the engine away from 14.7. May need an O2 with a heater though.

    I focused in on the Propeller for a·few reasons. Raw speed, ready-made objects, no need for interupts (all of my variables are less than a long long), and a great forum. I am a little concerned with power up, power down and retaining stepper position.

    Ok, I am not going to post too much too soon as I don't want to be "one of those guys".

    ·
  • smbakersmbaker Posts: 164
    edited 2010-06-16 22:04
    pmrobert said...
    @smbaker, if you're going to use B&G's designs, etc., you may want to touch base with them first. I believe they're pretty much OK with using their concepts, designs, etc., for personal experimentation - which I'm pretty sure that's what you're talking about

    Yes, definitely. My interest is limited to tinkering around with the design, and a project that's relatively far down on my wish-list of propeller projects... [noparse]:)[/noparse]

    @jaw0001: I think you are right that the megasquirt does work with narrow band, although I thought there was some variant of the code that allowed for specific AFR targeting using wideband, even supporting automatic tuning of the fuel tables (it's been a few years and a few code versions back since I get mine up). Regardless, I did find the wideband to be a handy diagnostic tool in and of itself. It's nice when something isn't working right to be able to look at the fuel mixture and see just how rich or how lean you are. It's true the narrowband sensor can provide some of this information but its response curve is much more binary in nature. It was a bit of piece of mind that while in open loop mode under boost to know the engine was going excessively lean due to incorrect fuel table programming. Sounds like you'll mostly be running in closed loop with a closely governed rpm, so your application will be much simpler.

    I'm also a bit of a gauge-a-holic, and if I can justify having another gauge, I will do so!
  • bailoutbailout Posts: 4
    edited 2010-07-25 19:23
    I'm working on a Prop EFI system myself. I've sent a message over to thebigmacd at http://spindrive.sourceforge.net/ to work together. I'm confident this should be fairly easy, however i'm having a hell of a time finding information on sensors, expected voltages, schematics, etc. I'd love to get a bunch of people all working on this. It sounds like there is some serious interest. I'm designing a system that can be tuned with TunerPro RT so there is no need for writing the tuning software, its very customizable.

    My Project:
    83 Firebird
    350 TPI Chevy / TH350 Tranny
    Soon to be twin turbo
  • Capt. QuirkCapt. Quirk Posts: 872
    edited 2010-07-25 20:59
    Your application is much slower than Spin. In fact the Prop and Spin is well suited for this project. As an example, 1 revolution at 20,000 rpm is only .003 seconds. Plenty of·time to do more process on just one cog.

    Also, you could easily build an injection system based off a throttle position sensor, crank or cam gear sensor, and a cylinder head thermocouple. Covering just those 3 sensors, you could easily control an electronic injection system, or a simple or complex mechanical injection, or a carburated system.

    last time I looked, megaSquirt was using a Pic.
  • Capt. QuirkCapt. Quirk Posts: 872
    edited 2010-07-25 21:15
    .

    On second thought, a simple EFI would only need a TPS, and a CHT.
  • jaw0001jaw0001 Posts: 7
    edited 2010-07-25 21:16
    I have been experimenting with the prop protoboard USB and I think there is no need to extensively program in SPIN. Assembly is easy and faster.

    I find I like to use propbasic to spit out a few lines of assembly, then modify for my needs. It would be nice to be able to have one project with a mixed bag of assembly, SPIN and PropBasic, but the IDEs do not seem to fully accomodate.
  • Capt. QuirkCapt. Quirk Posts: 872
    edited 2010-07-25 22:06
    It would be nice if there was one IDE, and every language was just a simple plug-in.
  • Capt. QuirkCapt. Quirk Posts: 872
    edited 2010-07-26 23:53
    Most of what you want to do, is much more complicated than it needs to be. If you’re set on this I would recommend to work up to it. But in the meantime this is what I would recommend this as a starting point.


    1. Fuel Injector is toggled with a PWM throughout every 720' cycle. Basically the injector is always pumping in fuel, regardless of piston position or if the intake valve is open or not.

    2. Create a program that follows a very general map to control the fuel air mixture. The program only needs two basic sensors to modify the map; (1) a potentiometer to measure throttle valve opening,(2) a cylinder head temp sensor to sense if you are rich or lean, and to determine the load on the engine.

    With the addition of a hall sensor (like the one Parallax sells), the map can easily be derived by experimentation. That same "basic" map can be developed into a complex map as your data acquisition and external inputs improve.

    3. Initially any 10k pot will work for the tps, and the thermocouple needs to be a type K, that mounts under a spark plug (should use braided wire instead of solid wire). A more permanent solution can be installed later.

    4. If you want a coolant sensor, a type k thermocouple will work fine for that.

    5. Rev limiter; you can easily create a rev limiter with one of the Props counters and an inductive pickup (a wire wrapped around the spark plug lead). To be accurate, convert your desired rpm to one revolution (times 2 on 4-strokes). At 3600 rpm, you need to create or allow an event to occur at every .033ms. Then with a Fet or similar, just ground the kill switch wire every-other spark (1 spark every 1440 degrees).

    6. Most EFI's and I have worked with use 40+ psi. So if you plan to use off the shelf components, a fuel pump and pressure regulator for that range would be a good starting point. However, there is a workaround for everything.

    7. Spin or Prop Basic is well suited for this project


    Post Edited (Capt. Quirk) : 7/27/2010 12:17:21 AM GMT
    200 x 104 - 8K
  • smbakersmbaker Posts: 164
    edited 2010-07-27 00:11
    I thought you needed IAT/MAP (or MAF) to compute the amount of airflow to know how much fuel to inject? I thought TPS was primarily used for detection of acceleration, in order to burst a supply of fuel while waiting for the MAP to stabilize?
  • Capt. QuirkCapt. Quirk Posts: 872
    edited 2010-07-27 00:37
    I think the most common misconception, is that fuel injection systems wait and inject fuel at exactly the right time.·Of course direct injections systems operate that way, and·it is less common for EFI systems.

    The first fuel injection systems simply replaced the carb and just increased its pulse-width with rpm. Later they came out with "Bank Style", this configuration just turned on all the left bank cylinders on at the same time, then the right bank. This is a common configuration, and as you can imagine, they don't care to much about when they inject. Just how much fuel they inject at that moment.
  • jaw0001jaw0001 Posts: 7
    edited 2010-07-27 02:30
    Here is my reduced sensor scheme...

    A servomotor is used to control throttle opening and engine governance (milliseconds is proportional to throttle position). A linear pot controls desired engine speed. A coolant temp sensor or washer style CHT like above determines whether engine is warm. The desired engine rpm and servo position are the x and y of a fuel map. A wideband O2 sensor is used to populate the fuel table as the prop constantly learns the appropriate pulse width. Two target O2 voltages are set, one for warmup and one for running. Bingo, eliminate Idle air motor, inlet air temp sensor and MAP sensor. Servo motor eliminates throttle end position switches, and the transistorized ignition I already have eliminates a hall effect switch.
  • hinvhinv Posts: 1,255
    edited 2010-07-27 03:48
    These links may be helpful:

    http://sourceforge.net/projects/freeems/

  • magdropmagdrop Posts: 13
    edited 2010-07-28 18:17
    @jaw0001
    ·
    When I first read your proposal I was prepared to respond that you have to know MAP or MAF in order to set the fuel flow, but after reading your last post I think I am beginning to understand the complexity of what you are saying.· Knowing the MAP or MAF is the easy way to do this, you don’t need a propeller for that.·
    ·
    What I think you are saying is that you should be able to compute fuel requirements by calculating the operational mode of the engine from five specific inputs:
    ·
    1)· engine speed command (from a potentiometer)
    2) ·throttle position information (from a servo)
    3) ·engine RPM (from the ignition module)
    4)· fuel mixture (from EGT or O2 sensor)
    5)· engine temperature (from a thermocouple).··
    ·
    After a lot of mental calisthenics I am starting to believe that a highly functional and very robust (yet extremely simple from a hardware point of view) fuel injection system can be built around the propeller. ·
    ·
    For example, when the little engine is running properly on a level surface and then it begins to transition up a hill, ·I presume the propeller would sense the additional torque requirement somehow from the input data and that it would then reposition the throttle and the corresponding fuel map to maintain the desired engine speed. ··There will be a lot of simultaneous equations that have to be solved, involving the first, second, and third derivatives, and all of this math will have to remain time-aligned and be performed in real time, which is just the sort of thing the propeller should be very good at.· ·I think we’re talking about real parallel processing here.
    ·
    I don’t really have any of the math or programming chops to be of much use on a project like this one, but I would be really interested in any low-parts-count fuel injection system that can be developed using this scheme for small industrial engines.· I think Tillotson, Bing and a few others would also be very interested.
  • jaw0001jaw0001 Posts: 7
    edited 2010-07-28 18:30
    yes to above. The only thing I would add is I wanted it to be self tuning. Something like FAST's EZ-EFI.

    I was prepared to let this post die, and then resurrect it months from now when I've made progress on it. I am geographically separated from the donor tractor and I have 4 small children. I am an aerospace engineer. It's just a hobby. Nevertheless I have made substantial progress in understanding on the myriad aspects of this task.
  • HarrisracingHarrisracing Posts: 10
    edited 2011-01-05 11:03
    I too am working on simple EFI for my go kart engine. My intentions as of now are to ONLY control fuel since (as stated previously) my ignition circuit is pretty much optimized from the factory and is stand-alone. Definitely different than the OP setup, but I figured I'd tag mine on here as well.

    I am a mechanical engineer and am playing with Parallax units for hobby and to further my learning in the high-performance automotive field particularly with engine control system development and optimization. Ironically, I don't have difficulties with the code and programming philosophy, but I have had to do substantial learning on the Electronics side of things! Safely going from digital low voltage outs to actually powering an end-device accurately was far tougher than I initially thought! Anyway, forgive me if I make suggestions that may sound silly to EE's or CE's.

    What I can bring to the table, however, is a pretty vast knowledge of engines, responses to REAL WORLD tuning and what needs we will have for a system like this.

    I started this project with a BASIC stamp 2 (wow that thing was EASY to learn on and oh so powerful), but quickly learned the limits and then saw that I would definitely be moving to the propeller unit (cheaper, FAR superior speeds and capability, better timing control = no-brainer). So I am currently going through the tutorials and learning from there - I'm still in process here so again please bear with me.

    My thoughts on a single-cylinder EFI unit.

    Speed-Density based system, Using:
    a) Manifold pressure (few samples, quickly averaged)
    b) Engine cylinder head temperature (quick sample)
    c) Air intake temperature (quick sample)
    d) CAM trigger signal (from Hall trigger or magnetic proximity sensor on rocker arm of intake or exhaust valve?) in my application. As rocker rotates to open or close this signal will be high/low.
    e) RPM signal - Can be calculated by measuring time between CAM SIGNAL events and x 2, or can use signal from coil and reported as is.
    f) *TPS - throttle position sensor. You "can" add TPS to this and more easily tune tip-in for crisper throttle response as well as add decel fuel cut option to the system, but you "can" do it with a MAP if tuned very carefully on both the hardware and software sides of the problem - I'd probably opt for more sensors in this case and use decel and tip-in

    Output would be to control a Saturated type high-ohm fuel injector to reduce load (1A) and to simplify power consumption and the circuitry required to operate it. One injection event would happen PER cam angle signal (I would like to see effects of changing injector firing timing on power). This is nice because you could use the exhaust valve as a trigger and set a timed delay for when the injector should squirt as the intake valve opens (to promote atomization and efficiency). Also add a readout of RPMs, other sensors, and duty cycle to an LCD display.

    The whole system will probably be Battery run in a completely lost system. I plan to use some sort of rechargeable battery packs for cordless drills or something initially that way I can run my kart on one battery while charging another and switch them out.

    While not the "safest" solution, I would use an air-filled volume bottle that would be used to pressurize a fuel tank. The volume bottle could be pumped up to 100 or so psi and regulated down to hold 40 psi on the fuel tank bottle. Like I said, pressurized fuel tanks aren't the safest things, but could be designed to work in this case. It also eliminates all power consumption for a fuel pump on the system. Change battery, refuel the tank, and add air to the volume bottle.

    Ideas comments?

    Thanks,
    Patrick
Sign In or Register to comment.