1. Attachments are working again! Check out this thread for more details and to report any other bugs.

hacking the computer?

Discussion in 'Generation 1 Prius Discussion' started by adric22, Jan 25, 2010.

  1. adric22

    adric22 Ev and Hybrid Enthusiast

    Joined:
    Apr 6, 2009
    642
    144
    2
    Location:
    Fort Worth, TX
    Vehicle:
    2018 Chevy Volt
    Model:
    Plug-in Advanced
    Anyone tackled trying to hack the 1st Gen Prius computer?

    In order to better take advantage of a plug-in kit, it would be nice if the computer could be reprogrammed to enter into an EV mode. based on my recent experiment of pulling the fuel-pump relay, I found the car to have plenty of power as an EV.

    I have had some experience with microcontrollers and programming embedded devices. I'm tempted to go to a junk yard or ebay or something and try to buy all of the Prius computers and assemble them in my home as a laboratory experiment. (vs trying to do it in the garage while still in the car!)

    From what I gather, the only computer that would need to be hacked is the Hybrid computer, I don't believe anything is necessary on the engine computer, battery computer, airbags, abs, immobilizer, etc.

    Has anyone disassembled one of those before? Is there an EPROM that can be pulled? Anyone know what CPU type is used? Is it ARM, MIPS, PowerPC, etc?

    The goal would be to re-write some of the software, and replace the ROM chip with something more suitable for turning the vehicle into a Plug-in.

    But before I get into that, I thought I'd see if anyone else has experimented with this.
     
  2. bwilson4web

    bwilson4web BMW i3 and Model 3

    Joined:
    Nov 25, 2005
    27,067
    15,372
    0
    Location:
    Huntsville AL
    Vehicle:
    2017 Prius Prime
    Model:
    Prime Plus
    Prius Hybrid Vehicle EUC

    Personally, I think a better approach is to spoof various signals to trick the car into doing what we want. But there is one hack I've been thinking about for a couple of years:
    reverse EV - simply invert the drive signals and lines so when the car thinks it is in "R", it is actually in "D" as far as timing and power is concerned.
    Bob Wilson
     
  3. adric22

    adric22 Ev and Hybrid Enthusiast

    Joined:
    Apr 6, 2009
    642
    144
    2
    Location:
    Fort Worth, TX
    Vehicle:
    2018 Chevy Volt
    Model:
    Plug-in Advanced
    Thank you for the link. That gives me somewhere to start. As for spoofing signals, that appears to be the easy route, but so far hasn't proved very effective and is certainly not the best route.

    In fact, I've wondered if it might be easier to simply learn the communications protocols with the various computers and actually just build a replacement computer from off-the-shelf microcontrollers. Perhaps that is what the author of that website you linked to intended to do? (I don't see any information there explaining what the goal was)
     
  4. bwilson4web

    bwilson4web BMW i3 and Model 3

    Joined:
    Nov 25, 2005
    27,067
    15,372
    0
    Location:
    Huntsville AL
    Vehicle:
    2017 Prius Prime
    Model:
    Prime Plus
    <AHEM!>I'm the author.

    Actually I put that page together to share as a reference. I agree that replacing the computer would be ideal but we don't have enough information. Rather, I think it makes sense to start with an inverter and master the signals that operate either of the MGs as a motor or generator. Of course it would help to have a transaxle handy. This gives an EV controller for the Prius.

    Bob Wilson
     
  5. hobbit

    hobbit Senior Member

    Joined:
    Mar 23, 2005
    4,089
    468
    0
    Location:
    Bahstahn
    Vehicle:
    2004 Prius
    Model:
    N/A
    The ECUs are *very* specialized, and have a lot of related analog
    and hardware-handoff control circuits to support the various
    sensors and operational bits they deal with. For example, your
    generic micro isn't going to have the specialized functionality
    of the AU6802 position resolver interface, or the circuits that
    filter go-pedal input or a whole batch of sensors without a lot
    of outboard help. As far as lying to the car, well, it's not
    that hard for someone who groks CAN to do, but as far as I know
    nobody has actually done it right yet by physically separating
    the bus between the battery ECU and the hybrid controller and
    actually gatewaying data back and forth with suitable changes.
    There are enough dual-CAN interface MCUs out there now that work
    with minimal outboard hardware it's beyond me why someone who's
    more into it hasn't actually done this yet.
    .
    _H*
     
  6. bwilson4web

    bwilson4web BMW i3 and Model 3

    Joined:
    Nov 25, 2005
    27,067
    15,372
    0
    Location:
    Huntsville AL
    Vehicle:
    2017 Prius Prime
    Model:
    Prime Plus
    I figured it was like eating an elephant ... one bite at a time.
    Like this?
    [​IMG]
    Agreed:
    [​IMG]

    CAN-bus looks like a Tower of Babble to me. Every Prius has all but redefined the previous, upper layers or in the case of the ZVW30, Toyota has added proprietary data busses. But thermistors, resistors, Hall effect, and other basic sensors and motors are pretty much the same.

    It would be great if Toyota released the full design specs for the NHW11 ... of course we'd have to master Japanese ... <grins>

    Bob Wilson
     
  7. gene23

    gene23 New Member

    Joined:
    Jan 30, 2010
    12
    0
    0
    Location:
    Portland, Oregon
    Vehicle:
    2002 Prius
    Model:
    N/A
    I have a 4kwh Enginer kit on order and was wondering about things to do to help getting 100+ mpg.

    One thing I was considering was using the accelerator pedal input to cycle the enginer on/off. No pedal=enginer off, regen to stock batt, preventing the enginer from overcharging the stock batt/wasting regen if SOC is high. Pedal=enginer On to supplement stock batt.

    Of course one would retain the original switch if the stock batt is still low even when regenerating.

    But this could "automate" the functioning??

    Any and all thoughts welcome
     
  8. bwilson4web

    bwilson4web BMW i3 and Model 3

    Joined:
    Nov 25, 2005
    27,067
    15,372
    0
    Location:
    Huntsville AL
    Vehicle:
    2017 Prius Prime
    Model:
    Prime Plus
    This may be a bit beyond what the NHW11 can achieve even with the 4kwh Enginer kit. We really need to understand your current driving profile. For example, if you drive 100 miles every day, getting 100+ mpg is not really in the cards.

    Perhaps the first step is to get the NHW11 maintenance manuals. These will be your reference for system modifications.

    Let's start with the maintenance manuals and then we will have a common reference to work from.

    Bob Wilson
     
  9. dan2l

    dan2l 2014 Prius v wagon

    Joined:
    Nov 26, 2009
    654
    263
    5
    Location:
    Vancouver Wasington
    Vehicle:
    2014 Prius v wagon
    Model:
    Five
    Hi Gene,
    I think you are not understanding the Enginer system. I suggest that you read the PHEV threads in the Gen2 section and Also the Enginer web site.

    The Enginer system should stay on all the time. It slowly recharges the Prius HV battery. It will not keep up with your driving needs. So you need to leave it on to catch up while you are not using power.

    This thread is about Hacking EV into a Gen1. So if you have further questions about the Enginer system it is best to do that in a separate thread about the Enginer System capability.

    Thanks,
    Dan
     
  10. gene23

    gene23 New Member

    Joined:
    Jan 30, 2010
    12
    0
    0
    Location:
    Portland, Oregon
    Vehicle:
    2002 Prius
    Model:
    N/A
    So I guess I need to address both these posts. But both are correct in that maybe I have jumped in a bit too soon. I am trying to catch up with the Enginer threads, and anything else I can find.

    1st: I typically drive 2mi to a park and ride and 2mi back on a typical workday. It would be nice to do it all electric, and I believe that is within the capabilities of a 4kwh battery. But perhaps not with a gen1 prius...

    That's why the EV mode for a gen 1 is relevant here, regardless of what system you are using to augment the stock battery, since the main reason for EV mode in a gen 1 is the capability of going futher than originally the car was capable. Essentially, I dont want the ICE running execpt the minimum required for other auxiliary functions (ac when required, lubrication, etc). Perhaps this info is germain to both threads, and I will let people know what I have done with my Enginer system in that thread. But first I got to figure out what to do and how to do it...

    And once again thanks for the input. It is very helpful.

    Gene
     
  11. adric22

    adric22 Ev and Hybrid Enthusiast

    Joined:
    Apr 6, 2009
    642
    144
    2
    Location:
    Fort Worth, TX
    Vehicle:
    2018 Chevy Volt
    Model:
    Plug-in Advanced
    I am still skeptical of going even 4 miles with enginer in EV mode. If I understand correctly, the DC-DC can only handle a constant 8 KW which is about 1/4 of what you really need for EV. But perhaps since most of the time we aren't giving constant throttle (ex, when going downhill) then maybe that would work out to an equivalent 16 KW when actually applying power since the other 50% of the time, it should be charging the stock battery?

    Anyway, I received the first of 3 boxes of my enginer kit yesterday. In fact, it is the DC-DC converter. One thing I'm curious about is it has big letters stamped on the top that says 48-240V converter. But since the gen-1 is actually a 273V battery pack, I wonder how well that will work, exactly.

    Hopefully I'll have the batteries and main box here in a few days.
     
  12. bwilson4web

    bwilson4web BMW i3 and Model 3

    Joined:
    Nov 25, 2005
    27,067
    15,372
    0
    Location:
    Huntsville AL
    Vehicle:
    2017 Prius Prime
    Model:
    Prime Plus
    In my fuel exhaustion experiences, I've typically only gone up to 1/4 mile just to reach a safe place to refuel. I kept the speed under 40 mph, actually closer to 20 mph. My goal was to reach a safe place to add the spare gallon, not an EV stress test. Others have reported longer, fuel-out, EV distance at higher speeds but with the NHW20.

    Still I've not seen the 8 kW sustained limit for the NHW11 inverter before. Any pointers to the source? The only way I know to replicate this result would be to run the car with the engine disabled for a long enough period of time and see the inverter temperatures plateau.

    That will be a challenge in part because there is a wide variation in traction battery voltages. I don't know enough about the Enginer package beyond one thread over in Ecomodder going into an NHW20. I get the impression the Enginer kit was designed for the 201V, NHW20 traction battery.

    GOOD LUCK!
    Bob Wilson
     
  13. bwilson4web

    bwilson4web BMW i3 and Model 3

    Joined:
    Nov 25, 2005
    27,067
    15,372
    0
    Location:
    Huntsville AL
    Vehicle:
    2017 Prius Prime
    Model:
    Prime Plus
    Research is good and I would recommend:

    • YahooGroup "Prius Technical Stuff" - started in 2000, it has a wealth of engineering data about the 1.5L NHW11 and NHW20 Prius. There isn't much about the ZVW30, yet.
    • "Development of the Hybrid Vehicle and its Future Expectation", Shinichi Abe, Toyota Motor Corp., SAE 2000-01-C042 - this paper is specific to the NHW11.
    • "Battery Usage and Thermal Performance of the Toyota Prius and Honda Insight for Various Chassis Dynamometer Test Procedures" Kelly, K.J., Mihalic, M., Zolot, M., NREL/CP-540-31306 - a study of the NHW11 traction battery in a compare and contrast to the original Honda Insight.
    • "Report on Toyota/Prius Motor Design and Manufacturing Assessment" Hsu, J.S., Ayers, C.W., Coomer, C.L., Oak Ridge National Laboratory, ORNL/TM-2004/137 - a compare and contrast report between the NHW11 and NHW20 motors.
    • "Report on Toyota/Prius Motor Torque Capability, Torque Property, No-Load Back EMF, and Mechanical Losses" Hsu, J.S., Ayers, C.W., Coomer, C.L., Wiles, R. H., Oak Ridge National Laboratory, Campbell, S.L., Lowe, K.T., Michelhaugh, R.T., Oak Ridge Institute for Science and Education, ORNL/TM-2004/185 - a detailed analysis of the NHW20 motors and transaxle which provides insights about the NHW11.
    • "Evaluation of 2004 Toyota Prius Hybrid Electric Drive System" Staunton, R.H., Ayers, C.W., Marlino, L.D., Chiasson, J.N., Burress, T.A., Oak Ridge National Laboratory, ORNL/TM-2006/423 - a full description of the NHW20 system which provides some insights to the differences with the NHW11.

    I agree:

    • NHW11 lacks EV mode - it was never designed to have an EV mode like the NHW20. The Japanese and European NHW20s could be ordered with an EV button and some North American NHW20s were field modified with the button. In contrast, the NHW11 never had an EV mode although there are some pretty ugly hacks.
    • Fuel-out, ICE EV - if the ICE is disabled by running out of fuel, possibly simulated by disabling the fuel pump, the car will run on traction battery. I have not read of any studies about the speed and range in this mode. I've used it to up to 1/4 mile at speeds around 20 mph to reach a safe place to add a spare gallon.
    • Reverse - turns off the ICE but is not a normal way to drive down a road with considerable safety risks. I've speculated about shifting the encoder signals to cause "R" to move forward instead of reverse. This remains an untested hypothesis.

    I have thought about what it would take to convert an NHW11 into an EV:

    1. Remove the ICE - it is dead weight and the space is needed for additional batteries.
    2. Weld-up Power Split Device - this couples the 18 kW and 33 kW motors, 51 kW (68 hp) combined.
    3. Add second inverter or custom motor controller - the normal traction battery is power limited to ~20 kW and potentially 51 kW is needed. This is one of two hard design decisions.
    4. Traction battery - it takes 38, NHW11 modules to make the 273 V. DC needed and the stock unit provides only 20 kW of peak power. To reach 51 kW, at least three would be needed and paralleling risks a battery balancing problem. Then there is the center of gravity problem.
    5. Removal of the ICE and stuffing the trunk with traction batteries moves the center of gravity to the rear - the car may go from neutral stability, the case today, to unstable.
    I think the NHW11 is an excellent experimenter's car because we have so much engineering data available and they are affordable. If you 'blow it up,' not a whole lot of money is lost. But in 2-3 years, the NHW20 will be the experimental vehicle of choice.

    Bob Wilson
     
    1 person likes this.
  14. ken1784

    ken1784 SuperMID designer

    Joined:
    Dec 18, 2003
    2,940
    1,359
    67
    Location:
    Yokohama, JAPAN
    Vehicle:
    2010 Prius
    Model:
    N/A
    If I were you, I'll try to think about an electric vehicle conversion based on a low cost used car.
    [ame="http://en.wikipedia.org/wiki/Electric_vehicle_conversion"]Electric vehicle conversion - Wikipedia, the free encyclopedia[/ame]


    Ken@Japan
     
  15. dan2l

    dan2l 2014 Prius v wagon

    Joined:
    Nov 26, 2009
    654
    263
    5
    Location:
    Vancouver Wasington
    Vehicle:
    2014 Prius v wagon
    Model:
    Five
    Hi Adric22,
    Why don't you start your own thread on putting together your Engineer Kit and getting it into your Gen1. I would like to be able to follow your progress.

    I also will be doing a Gen1 shortly.

    I would shoot an Email to jack asking him about the converter. Jack is very responsive.

    When you get your system together, but before you plug the converter into the Car, Test the output voltage from your converter. Connect your DVM to the blue connectors. Turn the system on and you should get 320v with no load. If you get 240, then you have a Gen2/Gen3 converter. You can not use the Gen2/Gen3 converter in the Gen1. There is an adjustment for this voltage but I do not know if it will go up that far. My guess is probably not. And I do not know if it is something that you can adjust. Again, if you verify that you have 240v, Call Jack.

    Thanks,
    Dan
     
  16. dan2l

    dan2l 2014 Prius v wagon

    Joined:
    Nov 26, 2009
    654
    263
    5
    Location:
    Vancouver Wasington
    Vehicle:
    2014 Prius v wagon
    Model:
    Five
    Hi Gene,
    I am sure that the Enginer system would do the 2mi there and 2mi back in a Gen2. I have done 5 miles or so.

    Your problem is that you have no easy way to keep the ICE from coming on.

    First, the car is cold. The ICE will want to come on to do a warm-up cycle.

    Next, you will need to be very light on the gas peddle. This will make you feel like a snail. With the Gen2/Gen3 EV button you get to have more normal like accelerations.

    Finally you need to start each of your runs with a full Prius battery. I normally will turn on the car, and as soon as I get the ready, I hit the EV button to prevent starting th ICE. Then I turn on the Enginer system to charge the Prius HV battery. I get about 1 bar in 6 minutes. I do this in the garage before driving. Many times I have done this the night before. By starting with a full Prius battery, the Prius can run off of the electric motors and while that is depleting the Prius battery the Enginer system is continuing to supplement. Then after 5 miles or so the Prius HV battery will be depleted and you will need to fire the ICE to keep going.

    Warning: In "out of gas EV", the Gen1 can run the Prius HV down low enough to damage it. Gen2/Gen3 have software safety's in place to prevent this. If you force EV in a Gen1 you need the Safety's put in place so that you do not damage the Prius HV Batteries.

    Thanks,
    Dan
     
    1 person likes this.
  17. Mike Dimmick

    Mike Dimmick Active Member

    Joined:
    Aug 8, 2008
    963
    247
    0
    Location:
    Reading, UK
    Vehicle:
    Other Hybrid
    Model:
    N/A
    TechOnline | Prius's controllers keep dual motors humming

    That article is for the Gen 2 Prius. The NEC microcontroller mentioned is a custom part for Toyota but based on the part number it appears to be a member of the V850E/IA family. The ROM and RAM are included in the processor chip package (making it a microcontroller rather than just a microprocessor).The 'F' in the name (µPD70F3155) seems to indicate Flash ROM rather than it being write-once.

    If I were going to criticise the design a little I would say that having a vast array of different microcontrollers with different processor architectures was a little risky, as you're likely to have a range of compilers with different bugs in - assuming that the software is written in a medium-to-high-level language rather than directly in machine code, in which case the programmer needs to understand several different 'languages' for the different families of processor used. On the other hand, the control software is probably well understood, thoroughly debugged and tested and switching to another architecture would likely introduce bugs.

    From the architectural point of view, it appears that the NEC microcontroller in the HV ECU is the 'master' controller, reading the speeds and torques of the two motors and the engine, sending requests to the two Mitsubishi processors to control the speed and torque of MG1 and MG2, and to the engine ECU (via CAN) to control the engine's speed and torque - I don't know if it simulates a throttle input or just gives the desired speed and torque.

    The processor is obviously soldered onto the circuit board so you may find it very difficult to change the software in it, even if you could download the current code and modify it suitably.
     
  18. gene23

    gene23 New Member

    Joined:
    Jan 30, 2010
    12
    0
    0
    Location:
    Portland, Oregon
    Vehicle:
    2002 Prius
    Model:
    N/A
    Thanks all for the info.

    Thus far, the most tests I have done are by interrupting the close signal to the OPN CIR relay which kills the fuel pump. I have also simulated empty gas tank signals and even "bad" fuel level signals (flashing bars), but the difference in the way the computers react is subtle if at all.

    The engine spatters and clunks and eventually dies, with warning lights and a couple of HV codes ("possible out of fuel problem"). The car goes into an all electric mode.

    I do watch the battery level indicator closely, and drive very carefully with minimal accelerator pressure. What kind of safety's do you think I could implement?

    On flat and slower speed areas, the 3kW converter seems to keep up just fine with the demands. I haven't done any rigorous data keeping since I am still figuring out how to force the EV mode.

    On hills, the prius battery empties quickly. The 3kw seems not to be enough to keep up, even with short downhills, stops and minimal speeds. I have yet seen my Enginer cut off on low battery.

    But the biggest problem is that to get the ICE to come back on, I have to stop, turn off ignition (loose my converter charging) and hope there is enough juice left to re-start the ICE. Not an ideal situation. Haven't had a problem yet, just very inconvenient and not too safe.

    It would be better to have a way to fool the ICE to shutdown and then have it decide to restart once the "error" was removed.

    Of course, its been hard getting much "research" done when there is a job in the way...
     
  19. linuxpenguin

    linuxpenguin Active Member

    Joined:
    Mar 6, 2007
    352
    182
    4
    Vehicle:
    2005 Prius
    Hi Bob,

    You're probably already aware of this, but I thought I might point out that the Gen1 Prius doesn't use CANBUS--probably why it hasn't received very much attention (that, and there simply aren't that many of them on the roads). It uses some non-standardized, proprietary serial format to communicate between the various ECUs with all of them reporting directly to the main Hybrid ECU. This makes things much more difficult because you can't even be certain you are dealing with real data (it could be little endian, big endian, 12 bits, 64 bits, skip every 3rd bit, encrypted, backwards, upside down, cursive, Swahili...etc).

    If your heart is dead-set on hacking the Prius (as I know it is :)), you're probably best off influencing the actual sensors as you said--though of course remember from my previous posts that even changing the smallest, most unsuspecting thing /can/ impact things you never intended to (EG: tinkering with a thermistor could cause the engine to run hotter--or not hot enough--and result in decreased lifespan).

    PS Adric: Redesigning the Hybrid ECU would, in short, be redesigning the vehicle and goes far /far/ beyond simply understanding the data that goes between the ECUs. Sorry to burst your bubble, but it is an /extremely/ complex piece of hardware and is very specifically designed for this application. I agree fully with Hobbit on that.

    The Gen1 Prius simply wasn't designed with PHEVs in mind.

    Andrew