General Disclaimer:   (HV) (DC) injury or death hazard,   use at your own risk,   may void warranty.

PriusPlus History-PseudoCode

From My wiki
(Redirected from Prius PHEV Pseudo Code)
Jump to navigation Jump to search
Click show for a short list of the current PHEV conversion and kit options for the Toyota Prius.

For Prius conversion details see the Prius PHEV article and comparisons table.

  1. Ron's Original PriusPlus History and current Contactor Based PriusPlus documentation for DIY projects.
  2. Ryan's PriusBlue is the testbed for DC-DC PFC Based PiPrius kits and documentation for DIY projects.
  3. Toyota OEM Prius PHEV and Prime Could use some work on this page
  4. Enginer China. But the rest of these appear to all be defunct as of 2020?
  5. |~- Hybrids-Plus USA/Colorado/Li -~|~- EnergyCS USA -~|~- Hymotion USA/Canada -~|~- Amberjac UK. -~|~- EDrive USA -~| Peter mentioned Plug-In Conversions |~-

--={ Project Overview }={ 2007 Maker Faire }={ Theory }={ Instructions }={ Parts List }={ RawData }={ Latest News }=--
--={ Doc Process }={ Mechanical }={ Electrical }={ Electronic }={ Interest }={ Talk:PriusPlus Main Discussion }=--

--={ Historic }={ Battery }={ Schematics }={ PseudoCode }={ Photos }=--

Team Photo from the PriusPlus conversion of Sven's Prius from Nov 2006.

This is the home of the PRIUS+ PHEV DIY (Do-it-Yourself) documentation. These pages are currently anonymously editable, which may change in the future. Please feel free to use the Discussion page for general discussion and commentary on the main article. If you would like to add to an existing section use the "edit" link near that topic's heading. Don't forget to use the Summary field to describe your changes. While editing use the "Show Preview" button to make sure your changes look like you expect them to, before you click "Save Page".

  This item is out of date but kept for posterity sake,  
  please refer to the current PriusPlus project page.  

This is the Prius PHEV Pseudo Code which determines how the Prius PHEV#CalCars Method implementation functions. It may be incomplete and is intended to be general enough to be implemented with various Prius PHEV User Interfaces hardware and software. Its primary goal is to exploit State Of Charge Drift in order to accomplish State Of Charge Manipulation.

CAN Parameters

These are CAN Parameters of particular interest used in the pseudo code:

  • SOC - The reported SOC is used to determine when to enable the SOC Spoofing circuit which raises the perceived or reported SOC.
  • Speed - Used to determine when to re-enter EV-mode after leaving it due to high speed or power demand.
  • Voltage - The reported Voltage is that measured by the Prius which may or may not be the Real Voltage.
  • Amperage - The reported Amperage is the amount of current being removed from or added to the battery.
  • Temperature - Battery temp used for temperature conpensation.
  • Spoof Voltage - Determined by measuring the difference in reported Voltage which occurs when the SOC Spoofing circuit is enabled.
  • Real Voltage - Used to determine the replacement HV batteries real SOC.
    • Real Voltage is reported Voltage if the SOC Spoof circuit is disabled.
    • Real Voltage is Spoof Voltage subtracted from reported Voltage if SOC Spoof circuit is enabled.
  • Real SOC - Could be determined in a number of ways using Real Voltage and reported Amperage.
    This aspect had not been fully resolved, so more details are sure to come at a later time
    • Zero Crossing SOC - Used to determine the real SOC by measuring Real Voltage as Amperage crosses zero.
    • Under Load SOC - Used by combining Real Voltage and reported Amperage in a manner to determine the batteries internal resistance, which is an indication the batteries SOC.
    • Watt Hour SOC - By counting Watt Hours removed from and added to the battery one can determine how much energy is left in a battery given that you knew how much you had to begin with, the capacity of the battery, and its Peukert characteristics. Unfortunantly WH counting is unlikely to be accurate based on the amperage, voltage, and power levels reported on the CAN buss as these are pre-filtered. Additional hardware such as a dedicated WH meter would be necessary to implement this type of SOC indication. However it may not be a bad idea to use such a device even if not integrated as a control device.

User Settings

  • Note: Below within the code logic _XX_ are user settings, the listed value is a best guess default for that setting. These may need to be changed in order to allow for various battery chemestries and user preferances.
    • _30_seconds - Denied Timeout
    • _78_% - Spoof circuit enable SOC level
    • _20_% - Real SOC lower limit
    • _40_% - Real SOC PHEV entry lower limit
    • _33_MPH - EV-Mode re-entry speed

Pseudo Code Logic

  • Initialization and Discovery:
    • Upon startup the current state of the system is unknow, has the battery been left discharged or is it fully charged?
      • Determine current Real SOC, using Temperature compensated no-load or zero-crossing Real Voltage.
    • Depending on the user settings and the CAN management device PHEV mode might be entered immediatly given that Real SOC is high enough. Temperature might also be considered if it is very low, sub-freezing?. Defroster settings might also disable PHEV-Mode from the Prius side of the system.
      • Enter EV-Mode, Verify EV-Mode was entered
        • If EV-Mode denied, timeout re-attempts for _30_ seconds
    • If SOC < _78_%
      • Then enable SOC Spoof circuit
        • Measure voltage differance to aquire Spoof Voltage. Cycling of the SOC Spoofing circuit for multiple samples may provide more accurate readings. This setting might be saved by the CAN management device as it should rarely change and is manually set.
      • Else disable SOC Spoof circuit
        • still enable momentarily to determine Spoof Voltage.
  • PHEV-Mode Loop Start
    • If SOC < _78_%
      • Then enable SOC Spoof circuit
      • Else disable SOC Spoof circuit
    • If Speed < _33_ MPH and EV-Mode is not enabled
      • Re-enable EV-mode
        • If EV-mode denied, timeout re-attempts for _30_ seconds
    • If Real SOC < _30_%
      • Then leave PHEV mode and return to normal HEV mode, End PHEV-Mode Loop, Enter HEV-Mode Loop.
    • Return to PHEV-Mode Loop Start
  • HEV-Mode Loop Start
    • If Real SOC > _40_%
      • Then re-enter PHEV-Mode Loop
  • Return to HEV-Mode Loop Start