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

My Duinomite Mega Canview V4 equivalent Project

Discussion in 'Prius PHEV Plug-In Modifications' started by lopezjm2001, Jul 19, 2012.

?
  1. Yes

    11 vote(s)
    100.0%
  2. Prefer to use Android Torque device

    0 vote(s)
    0.0%
  3. Prefer to use Scangauge

    0 vote(s)
    0.0%
  1. SynEco@eVehicle.co.nz

    Joined:
    Jan 9, 2007
    139
    19
    0
    Vehicle:
    2004 Prius
    Model:
    II
    Made update to check for Forced EV codes : F11() If codes detected & Forced EV=1 then then F12() automagically.
    Combined with wireless remote ICE kill switch now even the wife can use Forced EV mode ;)

    sequence is

    1. Driver : press Prius.ON => ( Ready)
    2. Driver : press Wireless remote Forced.EV request => (sets Forced EV codes )
    3. At 1. Duino Canview begins boot up, inits CAN then checks for Forced EV DTC and clears codes automagically if 2. was actioned by Driver

    This is added to initialisation section of Main ..also issued a F(9) and set LOG=1 as default so logging always on unless USER issues F9 and "esc" sequence.
    Can send you code snipets for next release ...

    Next : Add check for SOC below 74% and in FORCED EV ... issue **WARNING** to Driver to EXIT FORCED EV mode
    as PHEV battery depleted ( Detected by BMS+2 which the drops SOC to intiate ICE and battery sustain mode)
    May also consider connecting wireless OOG remote to a Canview outout PIN/relay. Then driver only required to push ON.
    Duino canview will activate Forced EV request if configured for FORCED EV mode and then reset associated codes as above.
     
    jdh2550 likes this.
  2. lopezjm2001

    lopezjm2001 Senior Member

    Joined:
    Apr 14, 2009
    1,146
    407
    5
    Location:
    Sydney Australia
    Vehicle:
    Other Electric Vehicle
    Model:
    N/A
     
    jdh2550 likes this.
  3. SynEco@eVehicle.co.nz

    Joined:
    Jan 9, 2007
    139
    19
    0
    Vehicle:
    2004 Prius
    Model:
    II
    It will take YEARS to full up my 4G SD card :)
     
  4. lopezjm2001

    lopezjm2001 Senior Member

    Joined:
    Apr 14, 2009
    1,146
    407
    5
    Location:
    Sydney Australia
    Vehicle:
    Other Electric Vehicle
    Model:
    N/A
    OK, it is just a matter of adding one line before the main program loop. Then you have to remove the comment mark to enable it.

    ' Gosub F9() : log=1 'Remove ' at start of line to activate automatic starting of data logging.
     
  5. SynEco@eVehicle.co.nz

    Joined:
    Jan 9, 2007
    139
    19
    0
    Vehicle:
    2004 Prius
    Model:
    II
    Already implemented :) with above changes mesntioned...

    Should soon add a new LOG file just for the DTC logging ... to ensure we know all DTC issued even if cleared automagically at Main Init .. ..
    Have noticed sometimes it requires two passes at F(12) to clear the
    DTC ... ( Only when my wife is driving due to Murphy's Law of course) So will add a retry loop if DTC not cleared.

    Thinking about a rewrite of the code so it is NOT so keyboard orientated .. and more Object.function oriented ...
    At the moment most subroutines are named after key press ( F1 ..F12) rather than the subroutines actual function.
    Need to replace this keyboard /User interface as NEXT priority.
    The keyboard is a lot MORE UnSafe than using ForcedEV. :)
     
  6. lopezjm2001

    lopezjm2001 Senior Member

    Joined:
    Apr 14, 2009
    1,146
    407
    5
    Location:
    Sydney Australia
    Vehicle:
    Other Electric Vehicle
    Model:
    N/A
    I will be adding a Amphour meter. Unlike the original Canview it will count upwards.
    If you log the current every second then the instant Amphours = amps / 3600 and keep adding the amphours value every second to give total AH. Add a AH reset button.
     
    dave77 likes this.
  7. lopezjm2001

    lopezjm2001 Senior Member

    Joined:
    Apr 14, 2009
    1,146
    407
    5
    Location:
    Sydney Australia
    Vehicle:
    Other Electric Vehicle
    Model:
    N/A
    I have got the amphour meter going as shown in the photo. The amperes value is updated at different time intervals depending on what page is being shown on the VGA screen and whether Datalogging is active.

    Because the change in update time of AHT the formula to calculate AHT has been changed as follows:

    AHT - amphour total as shown on Canview VGA screen. It is the AH value being discharged from the PHEV battery pack and OEM HV battery as they are connected in parallel.
    AHf - amperes update time (mS)
    AH - amphour measurement at update time

    AH = (amps x -1) / (3600/(1000/AHf)) : AHT = AHT + AH

    The AHT value is saved to a data file i.e. AHTMEM.TXT when Prius is shutdown. The saved AHT value is read from the same data file on powering up the Prius. The AHT value counts up. The AHT maximum value is 99.9 before it clocks over to 00.0.

    The AHT is reset to 00.0 when you press the ESC button three times consecutively in a short space of time.

    The amphour value is surprisingly accurate when compared to the amphour reading on my EV display unit from www.cleanpowerauto.com.

    The photo shows that on my drive to work in forcedEV mode I used 9.5 AH of my PHEV kits//OEM HV battery which is equal to 9.5ah x (70x3.30v) = 2.194 KWH.

    AH SCREEN.jpg
     
  8. lopezjm2001

    lopezjm2001 Senior Member

    Joined:
    Apr 14, 2009
    1,146
    407
    5
    Location:
    Sydney Australia
    Vehicle:
    Other Electric Vehicle
    Model:
    N/A
    I am trying to write basic code to do the "WARNING - Exit ForcedEV - battery packs have depleted"
    The problem is that the Prius still does EV mode whilst in ForcedEV mode and hence the SoC changes from 74% to 65% for EV mode. Have you managed to get this warning to work?

    So far I have added the following basic code:

    Code:
    ' MAIN PROGRAM LOOP
    If K$ = Chr$(27) Then
    	warn=0 : page=0 : GoSub printHeader : GoSub drawboxes : GoSub drawlabels_lhs : GoSub drawlabels_rhs : UpdateF4()
    	counter=counter+1
    	If counter=>3 then AHT=0
      Endif
    .
    .
    .
    If ForcedEV=1 And SoC=65 Then Pin(15) = 0 : Pause 10 : Pin(15) = 1  : Pause 500 ' Exit EVmode if ForcedEV is true
      If R4=0 and forcedEV=1 and SoC<74 then
    	page=25 : Gosub warningVGA : warn=1
      Endif
    .
    .
    WarningVGA:
      If warn=0 then
    	cls : Font 2,2,1 : Print @(80,150) "!! WARNING !!"
    	Font 2,1,0 : Print @(100,200) "Exit ForcedEV Mode now"
    	Print @(100,250) "PHEV battery pack depleted"
    	Print @(100,300) "Press F4 and then ESC to exit"
      Endif
    Return
     
     
    
     
  9. SynEco@eVehicle.co.nz

    Joined:
    Jan 9, 2007
    139
    19
    0
    Vehicle:
    2004 Prius
    Model:
    II
    We dont use EV Mode (or AUTO EV mode) and Forced EV mode together normally ... Our BMS+2 is in standalone mode and I dont believe the SOC reported is any different from BMS+2 if EV mode is ON ( will check and confirm this later) . BMS+2 in standalone mode only responds to PHEV/ORIG switch toggle OR if it detects that the battery voltage is below the cuttoff setpoint ( ours is manually set via the the BMS+2 configuration switches and NOT controlled by CANVIEW or OEM EV Mode ) So SOC should only go below 74% if the battery cutoff or the drive exits to ORIG mode ( we always stay in PHEV mode) both of which the driver should be made aware and WARNED.
    If EV mode is manually entered while in FORCED EV this should not change the SOC and FORCED EV should remain the CANVIEW mode reported state of Vehicle operation untill a Vehicle restart is performed ?
    When I have used EV mode (rarely ) while in forced EV mode there has been no change to vehicle operation except the normal drop out from EV mode indicator on the Vehicle console and its beep at 42 km/hr is reached.
    At the moment we are relying on the OEM SOC display which remain green while in PHEV mode AND equal or greater than 74% SOC ( ie Voltage is above BMS+2 configured PHEV cutoff voltage)If the SOC green bars start to drop or go blue then BMS+2 has detected the battery is below the pre configured cutoff point) and reduced SOC in order for the ICE to kick in and keep the batteires and steady state cuttoff point voltage. But its easy to not notice this so i think ideally we need CanView Duino to give an audible Warning as well as flash display message.
     
  10. SynEco@eVehicle.co.nz

    Joined:
    Jan 9, 2007
    139
    19
    0
    Vehicle:
    2004 Prius
    Model:
    II
    This looks AWESOME and was our NEXT "Must Have" .... cant wait to test out and feedback ..

    We can use this figure to produce PHEV SOC % and/or km's remaining figure. :)

    Have you released / uploaded the code with you Amp/hr update ?
    Last one can see in this thread is 16/01 ?
    really like to test this SOON ! :) if possible
     
  11. SynEco@eVehicle.co.nz

    Joined:
    Jan 9, 2007
    139
    19
    0
    Vehicle:
    2004 Prius
    Model:
    II
  12. lopezjm2001

    lopezjm2001 Senior Member

    Joined:
    Apr 14, 2009
    1,146
    407
    5
    Location:
    Sydney Australia
    Vehicle:
    Other Electric Vehicle
    Model:
    N/A
    I have just uploaded my latest Update of my BASIC program to my first post of this thread.

    The AH reading can be converted to show KWH or SOC%. Will work on toggling between these different formats by pressing a key later on.

    Showing how many kilometres are left in the pack takes a few more calculations. During the counting up of the AHs we need to:

    1. Calculate the average current which will become more accurate as the AH reading increases. Then use the average current to calculate the time left in the PHEV pack.

    THEN

    2. Calculate the average speed (KPH) which will also become more accurate as the AH reading increases. Then use this value to calculate the number of kilometers left in the pack.
     
  13. lopezjm2001

    lopezjm2001 Senior Member

    Joined:
    Apr 14, 2009
    1,146
    407
    5
    Location:
    Sydney Australia
    Vehicle:
    Other Electric Vehicle
    Model:
    N/A
     
  14. SynEco@eVehicle.co.nz

    Joined:
    Jan 9, 2007
    139
    19
    0
    Vehicle:
    2004 Prius
    Model:
    II
    Tried this yesterday and my BMS+2 does NOT drop SOC when in vehicle in EV mode AND PHEV mode...
    ( Will double check again today but am sure would have noticed long before now if the SOC
    dropped below 74% while it in PHEV mode and EV mode ON. IT does drop if the cuttoff volatage is reached
    on the battery)
    Maybe you are on different level of BMS+2 firmware ??? ..
    Or its different code if operated in CANveiw mode
    as opposed to Standalone Mode?
    What version of BMS+2 code are you on ??
    Do you use Standalone mode or Canview Mode ??
    ( I assume you are on Canview mode ?? where as
    we are running BMS+2 standalone mode and parallel pack
    NOT enginer mode )
    Our SOC only drops below 74% if we exit PHEV mode to ORIG mode
    or the pack is determined to be below cuttoff Voltage settings.

    Im not sure we have same definition of EV mode ?
    What you say above is TRUE if you actually mean BMS2 ORIG mode.
    Are you referring to the BMS+2 modes of operation
    or the EV button on the PRIUS hECU?
    cause the BMS+2 has two modes PHEV mode and ORIG Mode ..
    IF you are in ORIG mode AND Forced EV .... yes the SOC drops and WARNING should be issued
    regardless if vehicle is in EV mode ( PRIUS hECU button) or not.
    Forced EV should NOT be used if BMS+2 is in ORIG mode so warning should be issued
    if that state is detected.
     
  15. SynEco@eVehicle.co.nz

    Joined:
    Jan 9, 2007
    139
    19
    0
    Vehicle:
    2004 Prius
    Model:
    II
    First AH test : AH seems to be calculating OK BUT the Data is NOT persisting over restart of Vehicle
    so is going back to zero AH each time the Prius is restarted.

    Looking at the code I think maybe the data need to be persistent after each calculation of AHT.


    I suspect this could be because my Duino unit is powered differently from yours or you are
    running on a back-up battery ?? My power on Duino would drop before or sametime as READY.
    It seems you are only persisting the AH figure if PRIUS NOT READY but your DUINO is still running ??
     
  16. lopezjm2001

    lopezjm2001 Senior Member

    Joined:
    Apr 14, 2009
    1,146
    407
    5
    Location:
    Sydney Australia
    Vehicle:
    Other Electric Vehicle
    Model:
    N/A
    Yeap,

    If you have a look at a photo in my first post of this thread you can see how my Duinomite mega gets the power from the 12V of the OBD2 plug. So my Duinomite never powers down unless I unplug the power jack.
     
  17. lopezjm2001

    lopezjm2001 Senior Member

    Joined:
    Apr 14, 2009
    1,146
    407
    5
    Location:
    Sydney Australia
    Vehicle:
    Other Electric Vehicle
    Model:
    N/A
    I am using the OLD BMS+ which is different from the BMS2 which you are using. Norm stop making the BMS+ and now only sells the new improved design of the BMS2.

    When I was referring to EV mode I was referring to the Prius EV mode you get when you press the EV button and the ICE stops running. When I press the EV button, my Prius goes into EV mode and the modified SOC drops to 65%. I think it is a bit odd that your modified SOC does not drop to 65% when in PHEV mode (not ORIG) if you press the EV button.
    I am not familiar with BMS2 so it probably works differently to the BMS+.

    If my Prius stops using the ICE but it is not in EV mode then I call it stealth mode.
     
  18. SynEco@eVehicle.co.nz

    Joined:
    Jan 9, 2007
    139
    19
    0
    Vehicle:
    2004 Prius
    Model:
    II
    Oky Dokies :)
     
  19. SynEco@eVehicle.co.nz

    Joined:
    Jan 9, 2007
    139
    19
    0
    Vehicle:
    2004 Prius
    Model:
    II
    OK, repowered Duino from OBD so AHT is kept in memory ...
    But AHT was still not persisted across power removal from DuinoCANview...

    Seems the file was in a "left open" state at next start up ...

    Fixed by shifting the Open for output from Main to the Sub .... so file not left open at power off to duino

    Firstscanready:
    If running=1 and ready=0 then
    Open "b:AHTMEM.TXT" For output As #10
    ' SynECO OPEN moved from MAIN to only have file open when ready for write and then close
    write #10, AHT : close #10
    running=0
    Endif
    If ready=1 Then
    running=1 : Exit Sub
    Endif
    GoSub waitforCanData
    R1=0 : Cls : Run "autorun.bas"
    Return
     
  20. SynEco@eVehicle.co.nz

    Joined:
    Jan 9, 2007
    139
    19
    0
    Vehicle:
    2004 Prius
    Model:
    II

    Also added my previous change to Main after your AHT OPEN for INPUT

    F9() : Log=1 ' SynECO Initiate logging and Default Logging ON
    F11() : Pause 50 ' SynECO F11 checks for DTC and set forced EV if DTC found
    If forcedev=1 Then F12() : Pause 250 : F12() ' SynECO If forced EV now set then USER intiated "ICE Kill" so clear DTC (issue twice as intermitent get DTC not cleared fully)
    EndIf
    F7() : page=7 ' SynECO Default to volts/Current graph

    Logging of DTC codes

    Sub F11
    open "b:DTClog.csv" For append As #6 ' SynECO logging of DTC before cleared
    Write #6, Date$, Time$ ' SynECO logging of DTC before cleared
    Write #6,"TIME secs","ECUadd","rxData(0)","rxData(1)", "rxData(2)", "rxData(3)", "rxData(4)", "rxData(5)","rxData(6)", "rxData(7)" ' SynECO logging of DTC before cleared
    GoSub printheader : GoSub drawboxes : GoSub drawlabels_RHS
    Font 2 : Print @(10,90) "DTC CHECK";
    Font 1 : Print @(10,330) "Press Esc button to return";
    Local rxData(8) : Local rxOk : Local txData(8) : Local txOk : Local looper
    rxData(0) = 0: rxData(1) = 0 : rxData(2) = 0 : rxData(3) = 0
    rxData(4) = 0: rxdata(5) = 0 : rxData(6) = 0 : rxData(7) = 0 : looper = 0
    Do
    txData(0) = &H2 : txData(1) = &H13 : txData(2) = &HB0
    CAN TX 0,&H7E0,0,8,txData(0),txOk : ' CHECK ICE ECU DTC
    If txOk = 1 Then CAN RX 19,rxData(0),rxOk 'CHANNEL 19 - tx&H7E0 to rx&H7E8
    If (rxOK = 1) Then
    If (rxData(0) = &H4) And (rxData(1) = &H53) Then
    Font 2 : Print @(10,110) "ICE ECU: ";
    Print @(10,130) rxData(0) " "; rxData(1) " ";
    Print rxData(2) " "; rxData(3) " ";
    Print rxData(4) " "; rxData(5) " ";
    Print rxData(6) " "; rxData(7) " ";
    Write #6,Timer/1000,7E0,Hex$(rxData(0)), Hex$(rxData(1)), Hex$(rxData(2)), Hex$(rxData(3)), Hex$(rxData(4)), Hex$(rxData(5)), Hex$(rxData(6)), Hex$(rxData(7))
    ' SynECO logging of DTC before cleared
    If rxData(2) = &h1 And rxData(3) = &Hc1 And rxData(4) = &H0 Then forcedev = 1
    EndIf
    EndIf
    rxData(0) = 0: rxData(1) = 0 : rxData(2) = 0 : rxData(3) = 0
    rxData(4) = 0: rxdata(5) = 0 : rxData(6) = 0 : rxData(7) = 0 : txData(2) = &HB0
    CAN TX 0,&H7E2,0,8,txData(0),txOk : ' CHECK HYBRID ECU DTC
    If txOk = 1 Then CAN RX 21,rxData(0),rxOk 'CHANNEL 21 - tx&H7E2 to rx&H7EA
    If (rxOK = 1) Then
    If (rxData(0) = &H4) And (rxdata(1) = &H53) Then
    Font 2 : Print @(10,150) "Hybrid ECU: ";
    Print @(10,170) Hex$(rxData(0)) " "; Hex$(rxData(1)) " ";
    Print Hex$(rxData(2)) " "; Hex$(rxData(3)) " ";
    Print Hex$(rxData(4)) " "; Hex$(rxData(5)) " ";
    Print Hex$(rxData(6)) " "; Hex$(rxData(7)) " ";
    Write #6,Timer/1000,7E2,Hex$(rxData(0)), Hex$(rxData(1)), Hex$(rxData(2)), Hex$(rxData(3)), Hex$(rxData(4)), Hex$(rxData(5)), Hex$(rxData(6)), Hex$(rxData(7))
    ' SynECO logging of DTC before cleared
    If rxData(2) = &h1 And rxData(3) = &Hc1 And rxData(4) = &H0 Then forcedev = 1
    EndIf
    EndIf
    rxData(0) = 0: rxData(1) = 0 : rxData(2) = 0 : rxData(3) = 0
    rxData(4) = 0: rxdata(5) = 0 : rxData(6) = 0 : rxData(7) = 0 : txData(2) = &H80
    CAN TX 0,&H7E2,0,8,txData(0),txOk : ' CHECK CRUISE CONTROL ECU DTC
    If txOk = 1 Then CAN RX 21,rxData(0),rxOk 'CHANNEL 21 - tx&H7E2 to rx&H7EA
    If (rxOK = 1) Then
    If (rxData(0) = &H4) And (rxData(1) = &H53) Then
    Font 2 : Print @(10,190) "Cruise ECU: ";
    Print @(10,210) Hex$(rxData(0)) " "; Hex$(rxData(1)) " ";
    Print Hex$(rxData(2)) " "; Hex$(rxData(3)) " ";
    Print Hex$(rxData(4)) " "; Hex$(rxData(5)) " ";
    Print Hex$(rxData(6)) " "; Hex$(rxData(7)) " ";
    Write #6,Timer/1000,7E2,Hex$(rxData(0)), Hex$(rxData(1)), Hex$(rxData(2)), Hex$(rxData(3)), Hex$(rxData(4)), Hex$(rxData(5)), Hex$(rxData(6)), Hex$(rxData(7))
    ' SynECO logging of DTC before cleared
    If rxData(2) = &h1 And rxData(3) = &Hc1 And rxData(4) = &H0 Then forcedev = 1
    EndIf
    EndIf
    rxData(0) = 0: rxData(1) = 0 : rxData(2) = 0 : rxData(3) = 0
    rxData(4) = 0: rxdata(5) = 0 : rxData(6) = 0 : rxData(7) = 0 : txData(2) = &H80
    CAN TX 0,&H7E3,0,8,txData(0),txOk : ' CHECK HV BATTERY ECU DTC
    If txOk = 1 Then CAN RX 22, rxData(0), rxOk 'CHANNEL 22 - tx&H7E3 to rx&H7EB
    If (rxOK = 1) Then
    If (rxData(0) = &H4) And (rxData(1) = &H53) Then
    Font 2 : Print @(10,230) "Battery ECU: ";
    Print @(10,250) Hex$(rxData(0)) " "; Hex$(rxData(1)) " ";
    Print Hex$(rxData(2)) " "; Hex$(rxData(3)) " ";
    Print Hex$(rxData(4)) " "; Hex$(rxData(5)) " ";
    Print Hex$(rxData(6)) " "; Hex$(rxData(7)) " ";
    Write #6,Timer/1000,7E3,Hex$(rxData(0)), Hex$(rxData(1)), Hex$(rxData(2)), Hex$(rxData(3)), Hex$(rxData(4)), Hex$(rxData(5)), Hex$(rxData(6)), Hex$(rxData(7))
    ' SynECO logging of DTC before cleared
    If rxData(2) = &h1 And rxData(3) = &Hc1 And rxData(4) = &H0 Then forcedev = 1
    EndIf
    EndIf
    looper = looper + 1 : If looper > 10 Then Close #6 : Exit Sub
    Loop
    End Sub