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

PriusPlus History-PseudoCode

From My wiki
Revision as of 07:53, 20 March 2006 by Rjf (talk | contribs) (changed 82% SOC target to 78%)
Jump to navigation Jump to search

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

CAN Parameters

Thess 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 it's puckert 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 nesicarily to implement this type of SOC indication, however it may not be a bad idea 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