Electronic ICE simulator to Fool Cars ECU - DIY Electric Car Forums
Go Back  

DIY Electric Car Forums > EV Conversions and Builds > Technical Discussion

Register Blogs FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
  #1  
Old 05-22-2012, 05:47 AM
Thaniel's Avatar
Thaniel Thaniel is offline
Senior Member
 
Join Date: May 2008
Location: Dublin, VA
Posts: 355
Thaniel is on a distinguished road
Default Electronic ICE simulator to Fool Cars ECU

Hello all,

I've been thinking about this for sometime. I've not read about anyone doing this so makes me think it is really difficult a stupid idea or something really clever. If I have missed a post or thread regarding this topic this please direct my attention there.

Some of the newer car's throw codes when the car's engine has been removed and replaced with an electric motor. Have been thinking what if a electronic device similuated the engine outputs (crank sensor, o2 sensors etc) based on some inputs (vehicle speed, pedal position, electric motor RPM) to make the car's ECU that the engine was still there. Might also solve some issues with auto trans computers.

I've purchased some microcontrollers have started learning and playing with those. (My electrical knowlege is novice level.) From what I've tried so far it seems that it should be possible to do. So makes me think that it must have been done already or there is a reason it hasn't been done.

So looking for your expert advice and direction. Is there something out there that would do this "off the shelf" If not what hardware would you recommend one should use? What I think I have might work but open to new (better) Ideas.

Oh bit more information for the curious. I will be changing my EV from a '93 BMW E36 to an '99+ E46 (probably next year). With the more complex electronics the tach and several other instruments are driven by Can bus signals from the ECU instead of engine signals. Seems converting my electric motors RPM signals to imitate the ICE RPM would be easier then trying to interface with the can bus system. Then if I could imitate a few more signals I could keep the check engine light off.
__________________
Converting a 3 series BMW to EV. Thread:
http://www.diyelectriccar.com/forums/showthread.php/and-so-begins-17727.html
Blog (has more part#'s): www.ev-36.blogspot.com

Previous Engine swap experience:
2002 LS1 V-8 (think corvette) and 6 spd manual into a '93 3-series BMW (daily driver) http://www.ls1bmw.blogspot.com/
2000 Nissan Maxima V-6 and 350z 6 spd manual into a '91 Rx-7 (sold) http://www.v6rx7.blogspot.com/
Reply With Quote
Sponsored Links
Advertisement
 
  #2  
Old 05-22-2012, 01:17 PM
DJBecker DJBecker is offline
Senior Member
 
Join Date: Nov 2010
Location: Annapolis MD
Posts: 230
DJBecker is an unknown quantity at this point
Default Re: Electronic ICE simulator to Fool Cars ECU

Quote:
Originally Posted by Thaniel View Post
Some of the newer car's throw codes when the car's engine has been removed and replaced with an electric motor. Have been thinking what if a electronic device similuated the engine outputs (crank sensor, o2 sensors etc) based on some inputs (vehicle speed, pedal position, electric motor RPM) to make the car's ECU that the engine was still there. Might also solve some issues with auto trans computers.
...
Oh bit more information for the curious. I will be changing my EV from a '93 BMW E36 to an '99+ E46 (probably next year). With the more complex electronics the tach and several other instruments are driven by Can bus signals from the ECU instead of engine signals. Seems converting my electric motors RPM signals to imitate the ICE RPM would be easier then trying to interface with the can bus system. Then if I could imitate a few more signals I could keep the check engine light off.
There is a lot more to simulating sensor signals than you expect. And if you don't do it perfectly, the engine computer will raise error codes and may switch into 'limp home' mode that might impact the transmission.

An E46 will have a dual-VANOS engine, knock sensors, and multiple oxygen sensors. M52tu and later engines will have an electrically controlled thermostat and a throttle position over-ride (partial throttle-by-wire).

Each of these systems will have to be simulated, and some can be quite complex.

VANOS is one of the easier ones to simulate. It is a system that adjusts the camshaft angle relative to the timing chain sprocket. Each cam has a solenoid valve controlled by a PWM input signal, and a camshaft position sensor. You might be able to get away with not precisely modeling how the slowly the actuator moves in response to the input pulse duty cycle, but you must generate the sensor signal or the ECU will go into limp-home mode. That involves figuring out the levels of the original actuator and sensor signals, measuring the timing relative to the crank position, designing the interface electronics, and writing the software.


In comparison, writing the software for a CAN bus message exchange is easy. Not trivial, but far easier than designing the interface electronics and firmware for an engine signal simulator. You could probably find a handful of people that would help with a firmware-only CAN bus project, while a engine simulator would be a multi-discipline project that would apply only to a single engine and would interest very few other people.
Reply With Quote
  #3  
Old 05-23-2012, 11:00 AM
Thaniel's Avatar
Thaniel Thaniel is offline
Senior Member
 
Join Date: May 2008
Location: Dublin, VA
Posts: 355
Thaniel is on a distinguished road
Default Re: Electronic ICE simulator to Fool Cars ECU

Hi, Thank you for your reply. It intriques me that you feel connecting with the canbus would be easier. You wouldn't happen to have some knowlege in that area? Ditching the orignial ECU would would be the "cleanest" solution but from the research I've done so far seems even more difficult than simulating the ICE. I had actually wanted to go that route and started reading about can bus. I couldn't find any real solutions. Let me share more of what I've found and feel free to poke holes in it.

The main issue I've read with integrating to the can bus is that the messages that are sent to and from the modules are not known or published. And trying to capture them by sampling the bus is next to impossible (I haven't tried this. Just going by what others have said). The ABS, Dynamic Stability Control and Transmission (if using an auto) I think would be the hardes ones to set up comunication with.

Fooling the ECU by simulating the engine on the other hand. The signals for each sensor can be found in the Factory repair and service manuals. And also the conditions which will trip a code. The ECU is not really that picky as the engine is not really that precise. Vanos for example is just a hall effect pulse that advances or retards when the vanos solenoid recieves a 100-220 hz signal. how much does it retard. The solenoid controls only oil flow which moves the cam position and so it varries with engine temperature. So the ECU just keeps varying the signal and checking the cam sensor till it gets what it wants. Seems simple enough for a micro controller to do.

Yah the ECU has a lot of wires in and out (108 aproximately) but half are grounds and most are just sending out signals that are not checked (Coils and injectors for example) Some others can be handled by just leaving the parts to do their thing even without the engine (throttle pedal sensor and throttle plate control) though similuating them could be done too. Most of the temperature sensors can be replaced by a fixed resistor for what would be operating temperature (car doesn't know how long the engine is off so will think it's just shut off and restarted) From what I've read the Crank sensor, Cam sensors, O2 sensors and a few others should keep the codes off. (o2 sensor simulators are already on the market with no ECU feedback so that can't be too hard)

Just so you don't think I'm all talk I've already spent around $400 on 2 micro controler kits and spent hours with my son learing how to program them. We can make LED's flash on and off with the best of them (it has been fun so money well spent). But definately would consider another product or controller if better suited.

Thaniel

Quote:
Originally Posted by DJBecker View Post
There is a lot more to simulating sensor signals than you expect. And if you don't do it perfectly, the engine computer will raise error codes and may switch into 'limp home' mode that might impact the transmission.

An E46 will have a dual-VANOS engine, knock sensors, and multiple oxygen sensors. M52tu and later engines will have an electrically controlled thermostat and a throttle position over-ride (partial throttle-by-wire).

Each of these systems will have to be simulated, and some can be quite complex.

VANOS is one of the easier ones to simulate. It is a system that adjusts the camshaft angle relative to the timing chain sprocket. Each cam has a solenoid valve controlled by a PWM input signal, and a camshaft position sensor. You might be able to get away with not precisely modeling how the slowly the actuator moves in response to the input pulse duty cycle, but you must generate the sensor signal or the ECU will go into limp-home mode. That involves figuring out the levels of the original actuator and sensor signals, measuring the timing relative to the crank position, designing the interface electronics, and writing the software.


In comparison, writing the software for a CAN bus message exchange is easy. Not trivial, but far easier than designing the interface electronics and firmware for an engine signal simulator. You could probably find a handful of people that would help with a firmware-only CAN bus project, while a engine simulator would be a multi-discipline project that would apply only to a single engine and would interest very few other people.
__________________
Converting a 3 series BMW to EV. Thread:
http://www.diyelectriccar.com/forums/showthread.php/and-so-begins-17727.html
Blog (has more part#'s): www.ev-36.blogspot.com

Previous Engine swap experience:
2002 LS1 V-8 (think corvette) and 6 spd manual into a '93 3-series BMW (daily driver) http://www.ls1bmw.blogspot.com/
2000 Nissan Maxima V-6 and 350z 6 spd manual into a '91 Rx-7 (sold) http://www.v6rx7.blogspot.com/
Reply With Quote
  #4  
Old 05-23-2012, 11:34 AM
bjfreeman bjfreeman is offline
Senior Member
 
Join Date: Dec 2011
Location: boondock around USA
Posts: 739
bjfreeman has a little shameless behaviour in the past
Send a message via Yahoo to bjfreeman
Default Re: Electronic ICE simulator to Fool Cars ECU

you instrument cluster is refereed as a instrument panel unit (IPU) BMW may call it something else.
The Can bus message have a format. The are chips that actually decode this. there are thread on This on the forum.
This one address what you are thinking about.
http://www.diyelectriccar.com/forums...&postcount=108
__________________
Men and their Toys.
http://roadwarrior.free-man.com/
Reply With Quote
  #5  
Old 05-23-2012, 07:08 PM
piotrsko piotrsko is offline
Senior Member
 
Join Date: Dec 2007
Posts: 1,004
piotrsko is on a distinguished road
Default Re: Electronic ICE simulator to Fool Cars ECU

My $.02: I agree that fooling the ECU won't be that hard, especially if the first experimental pass uses the original factory sensors / termination devices with a couple of discreet resistors. sine wave generator for the motor pulses, go until you get a error condition, back up a step. Figure about 20 devices total. If you can keep the ECU in open loop, the job is much easier, since the ECU ignores some sensors and uses a look-up table for others.

From what I've heard, CANbus is the automotive equivalent of Ethernet with addresses and interrupts, and data packets. That is what I've heard, no guarantee of truth there.

That is the "fun" of prototypical experimentation, no BTDT.
Reply With Quote
  #6  
Old 05-23-2012, 10:49 PM
DJBecker DJBecker is offline
Senior Member
 
Join Date: Nov 2010
Location: Annapolis MD
Posts: 230
DJBecker is an unknown quantity at this point
Default Re: Electronic ICE simulator to Fool Cars ECU

The ECU is pretty tolerant of the exact response to some signals, but it does want to see a response.

The VANOS system is a good example. It will adjust the solenoid PWM duty cycle until it gets the cam advance it wants. It doesn't care if it's 20% or 80% duty cycle. But it requires a pulse every cycle from the cam position sensor, and will eventually want to see the proper advance. So you have to monitor the PWM well enough to notice it changing, and adjust the phase delay for the cam position output to match.

I don't know if you can ignore the injector and ignition signals and just use an O2 "sensor simulator". Some ECUs measure the response time between deliberately enriching the mixture and when the lambda sensor reports decreased oxygen, and use this delay to monitor performance. Sensors typically go bad by becoming coated with impermeable gunk (notably lead and silica), which results in a slower response.

Anyway, back on point: you'll have to figure out the CAN bus messages, but that's not impossibly difficult. I'm sure there are people that have done the opposite side -- gotten an "OBD2" engine to run in a pre-OBD2 body.

Monitoring CAN bus messages isn't difficult. You can even use a cheap ELM327, just be certain to get a serial port version so that you can increase the baud rate to have a better chance of not dropping frame.

Once you have captured the frames, decoding the undocumented ones involves a bit of guessing. But the guys that designed the messages weren't out to make it difficult. The fields are usually one or two full bytes, with values matching the OBD2 parameter scaling.
Reply With Quote
  #7  
Old 05-23-2012, 11:00 PM
DJBecker DJBecker is offline
Senior Member
 
Join Date: Nov 2010
Location: Annapolis MD
Posts: 230
DJBecker is an unknown quantity at this point
Default Re: Electronic ICE simulator to Fool Cars ECU

Quote:
Originally Posted by piotrsko View Post
From what I've heard, CANbus is the automotive equivalent of Ethernet with addresses and interrupts, and data packets. That is what I've heard, no guarantee of truth there.
Only the same as Ethernet in that it's a network. If you "just like Ethernet", it will take longer to get your head around it. The IDs weren't designed as addresses, but they ended up being used as addresses. You often have devices listening for multiple IDs, or ID ranges, while multiple devices listen on the same ID.

The tiny frames mean that most messages only carry one or two fixed-format values. Longer messages require something like ISO-TP, which has high latency.
Reply With Quote
  #8  
Old 05-26-2012, 02:52 AM
Thaniel's Avatar
Thaniel Thaniel is offline
Senior Member
 
Join Date: May 2008
Location: Dublin, VA
Posts: 355
Thaniel is on a distinguished road
Default Re: Electronic ICE simulator to Fool Cars ECU

Thank you for your comments. Please continue to throw in your thoughts as it is very much appreciated. Sorry for the long post but want to ensure I'm conveying the right details.

So far my take aways are:
-Can bus might not be a bad as I've thought. But to progress much will need to have the car in hand to measure signals.

-While engine simulation may be possible most feel it's not worth the effort and why it hasn't been done (they may be right but I'm not ready to give up yet).

Here's a specific question I'm looking at. My EV motor will have an RPM sensor (Hall effect) on it that gives 4 pulses per rev (for RPM signal to the controller). What hardware/software would you suggest to translate that RPM signal to one like a 60-2 wheel hall effect signal? (doesn't have to be off the shelf. I'm willing to solder and program) I've used converters on other car projects to convert one RPM frequency to another. But so far haven't found anything pracitcal for converting to a RPM signal with 2 missng teeth. Yes I could mount a 60-2 tooth wheel on the EV motor and another sensor but I'd rather not do that if I can help it.

Quote:
Originally Posted by bjfreeman View Post
This one address what you are thinking about.
http://www.diyelectriccar.com/forums...&postcount=108
Thank you for the link. I need to read more but looks like you are successfully conecting into a vehicles Canbus? I started to read from the beginning of the tread your post is in and my head started to spin. (edit: reread the thread and halfway through realized I'd read it some time ago. Memory is the first thing to go. At this point I have no interest in hooking my EV's controller to the Vehicle's can bus. Just getting the vehicle happy to be without an ICE). I need to look more into what you've done as I like to read about sucesses. For awhile I can't do much sampling of the actual bus as my car is in the USA and I'm in Sweden.

Quote:
Originally Posted by piotrsko View Post
My $.02: I agree that fooling the ECU won't be that hard, especially if the first experimental pass uses the original factory sensors / termination devices with a couple of discreet resistors. sine wave generator for the motor pulses, go until you get a error condition, back up a step.
This is basically my plan. Building a circuit and the test it and compare to the few factory specs I have for the signals. Once I get it to meet the basic specs install in the car and adjust from there. Figured I'd need something that could do logic so got some controllers designed for controlling little robots and such (was an educational kits for beginners). That's when I got the bright idea to ask some experts what should I really be using. All the EV conversions I've read I've never read about anyone doing this. Though some make the controler for the EV motor from scratch. Obviously very smart folks so makes me second guess my plan a bit.

Quote:
Originally Posted by DJBecker View Post
The ECU is pretty tolerant of the exact response to some signals, but it does want to see a response.
Agreed

Quote:
Originally Posted by DJBecker View Post
I don't know if you can ignore the injector and ignition signals and just use an O2 "sensor simulator".
That could be true. The front o2 sensor may require some active adjustment. Or like you say keep it in open loop mode. Now that I think more about it the rear 02 sensor is where I've seen the simulators used (people removing the catylist).

Quote:
Originally Posted by DJBecker View Post
Anyway, back on point: you'll have to figure out the CAN bus messages, but that's not impossibly difficult.
Not sure I follow here. My thought is to simiulate the motor so I don't have to get into the can bus. The projects I've read about never got into the can bus but just let the check engine light be on (or removed it) and circumvented the systems that didn't work when the computer didn't recieve proper signals.
__________________
Converting a 3 series BMW to EV. Thread:
http://www.diyelectriccar.com/forums/showthread.php/and-so-begins-17727.html
Blog (has more part#'s): www.ev-36.blogspot.com

Previous Engine swap experience:
2002 LS1 V-8 (think corvette) and 6 spd manual into a '93 3-series BMW (daily driver) http://www.ls1bmw.blogspot.com/
2000 Nissan Maxima V-6 and 350z 6 spd manual into a '91 Rx-7 (sold) http://www.v6rx7.blogspot.com/

Last edited by Thaniel; 05-26-2012 at 04:10 AM. Reason: carity
Reply With Quote
  #9  
Old 05-26-2012, 08:40 AM
Zak650 Zak650 is offline
Senior Member
 
Join Date: Sep 2008
Posts: 263
Zak650 is on a distinguished road
Default Re: Electronic ICE simulator to Fool Cars ECU

Since there are companies and people interested in chipping ECUs for performance gains and smog bypass, maybe these same people are interested in Ev chips for our needs.
Reply With Quote
  #10  
Old 05-26-2012, 09:36 AM
piotrsko piotrsko is offline
Senior Member
 
Join Date: Dec 2007
Posts: 1,004
piotrsko is on a distinguished road
Default Re: Electronic ICE simulator to Fool Cars ECU

Quote:
Originally Posted by Thaniel View Post
While engine simulation may be possible most feel it's not worth the effort and why it hasn't been done (they may be right but I'm not ready to give up yet).

Here's a specific question I'm looking at. My EV motor will have an RPM sensor (Hall effect) on it that gives 4 pulses per rev (for RPM signal to the controller). What hardware/software would you suggest to translate that RPM signal to one like a 60-2 wheel hall effect signal? (doesn't have to be off the shelf. I'm willing to solder and program) I've used converters on other car projects to convert one RPM frequency to another. But so far haven't found anything pracitcal for converting to a RPM signal with 2 missng teeth. Yes I could mount a 60-2 tooth wheel on the EV motor and another sensor but I'd rather not do that if I can help it.

I'd suggest some sort of hex or decimal converter and the pin(s) that counts the missing pulse goes to 2 flip flops which cycle then resume the count. if you are good at programming the micro controllers, could be done as one step and output all the other "timed" pulses.

That could be true. The front o2 sensor may require some active adjustment. Or like you say keep it in open loop mode. Now that I think more about it the rear 02 sensor is where I've seen the simulators used (people removing the catylist).

The front 02 just reports the level, and doesn't have to really vary while the rear does double duty: snitching on the front, and if the front fails, taking over the mix control for that bank. A PWM made from a 555 timer would probably work for both.


The projects I've read about never got into the can bus but just let the check engine light be on (or removed it) and circumvented the systems that didn't work when the computer didn't recieve proper signals.
The Canbus hasn't been explored for the hobby level since it hasn't been out long enough to require backyard fixes on vehicles with no resale values. Most everybody gets to the "get it done" phase and since we aren't dealing with emissions any more on a fairly Neanderthal system, One tends to say "enough already". People are just now learning OBD2. I'm sure, however that this forum has the appropriate engineers familiar with the systems lurking just ready for comment and flaming.

Last edited by piotrsko; 05-26-2012 at 09:45 AM.
Reply With Quote
Reply

Share or Bookmark this

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

 
Support DIY Electric Car
Sponsors

All times are GMT -6. The time now is 08:09 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.

Ad Management by RedTyger