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. planetaire

    planetaire Plug in 20 kWh 85 km/h or > 208km range

    Joined:
    Aug 11, 2009
    190
    139
    15
    Location:
    France
    Vehicle:
    2007 Prius
    Model:
    II
    MG2 Temp is received on the "24" frame
    In this frame you have :
    byte 1 = 24
    byte 2 = MG2 inverter temp
    byte 3 = MG2 temp
    byte 4 = MG1 temp. What I know is that MG1 temp is computed. I believe that there is no temp sensor in MG1 unlike MG2.

    All temp in celcius and with 50 (décimal) ofset value, so min value is -50°C.

    Did you received all the frames :
    7EA 10...
    7EA 21...
    7EA 22...
    7EA 23...
    7EA 24... ?

    :)
     
  2. lopezjm2001

    lopezjm2001 Senior Member

    Joined:
    Apr 14, 2009
    1,146
    407
    5
    Location:
    Sydney Australia
    Vehicle:
    Other Electric Vehicle
    Model:
    N/A
    Still writing the code for this part. I already got a email from Norm about this.
    Thanks.
     
  3. lopezjm2001

    lopezjm2001 Senior Member

    Joined:
    Apr 14, 2009
    1,146
    407
    5
    Location:
    Sydney Australia
    Vehicle:
    Other Electric Vehicle
    Model:
    N/A
    Just got the whole PID 21C3 request working but due to timing/speed issues it takes a while during looping until it happens.

    This is the code:

    I hope that JDH2550 can sort out the timing issue. Sometimes the function works on first loop and sometimes it may take 10 loops. since that are just temperature readings I can live with it. The F11 page is still work in progress.
     

    Attached Files:

    NortTexSalv04Prius likes this.
  4. planetaire

    planetaire Plug in 20 kWh 85 km/h or > 208km range

    Joined:
    Aug 11, 2009
    190
    139
    15
    Location:
    France
    Vehicle:
    2007 Prius
    Model:
    II
    Lopezjim.

    You send 7E2 30 between each frame received (frames 10 21 22 23 24). It seems that canview do this.
    I don't do this, just send this one time after the 10 frame and it work fine.
    Usually there is some delay between the first frame received, the 10 one, and then usually come 3 frames 21 22 23 close each other. During this delay passive pid are received. After the 23 is received some passives pid come also then the frame 24 is received.

    Maybe you lose some time using this non necessary Cansend. You could try and see.

    Using different dongles (elm cansub tactrix) I never have timing problem with active pid, except when talking to nimh_ecu.
    :)
     
  5. lopezjm2001

    lopezjm2001 Senior Member

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

    I suspected that the timing issues had to do with the Canbus being busy which you have also agreed with .Not sure if the Duinomite is fast enough to pick up all the frames from just one "give me more" command. While my Duinomite program is printing or busy it probably misses a frame here or there. The 07xx PIDs has lower priority than the ECU passive PIDs so my Duinomite has to wait. Anyhow it proves that you can use basic. I guess if the Duinomite could multitask then it could receive all messages. But it cannot run more than one program at the same time like windows.
     
  6. Flying White Dutchman

    Flying White Dutchman Senior Member

    Joined:
    Dec 29, 2007
    4,374
    313
    0
    Vehicle:
    Other Non-Hybrid
    Model:
    N/A
    Dit multi tasking you need more processor power and this is something you dont have in the mega right?
    So would multi tasking solve this?

    -Htc Tapatalk ( sorry for auto spell correct )
     
  7. lopezjm2001

    lopezjm2001 Senior Member

    Joined:
    Apr 14, 2009
    1,146
    407
    5
    Location:
    Sydney Australia
    Vehicle:
    Other Electric Vehicle
    Model:
    N/A
    You are only monitoring temperature readings so it is not a big deal. You can fine tune it, take stuff out that you do not need and the program would probably run faster. But I am happy with the updating speed overall. Still a lot of room for improvement.
     
  8. Flying White Dutchman

    Flying White Dutchman Senior Member

    Joined:
    Dec 29, 2007
    4,374
    313
    0
    Vehicle:
    Other Non-Hybrid
    Model:
    N/A
    i am looking into using one of the inputs on the board to connect a switch
    what this switch you then tell the Mega that you want ORG or PHEV mode.
    this way you dont need a screen anymore
    also use the SOUND 500, 2000 command ( 500= sound tone and 2000 = time to sound it ) to send out a warning sound when for some reason something is wrong like a to low voltage or DCL or DTC or! to high temp of anything

    just my googling at the moment finding how to connect a switch to the board is not yet successful.

    the relay board is on its way just like the odb2 splitter cable

    i am goging to use relay 1 2 for EV, and PHEV like you are doing and planning to use relay 3 for ICE temp spoofing!

    i think i discovered that when you send a HIGH ice temp ( lets say 80celsius ) at startup ( before ice start ) it will go into EV faster and not do al the working cycle like normal.

    so prius start and Mega start = relay 3 close ( when ice not running ) for 2 sec ( = high temp ice ) and then off again.
    just not sure when in wintertime this is going to work because maybe the ice will start at startup?!
    then i geuss low temp and or ice running wil ofcourse need to be a NO close relay 3 state.

    EDIT
    here is something with a arduino board and a pushbutton
    Arduino - Button

    EDIT
    there is ofcourse the USER BUTTON than can be used for testing without the need for wire anything..

    EDIT
    here is some example use of that button
    DuinoMite controls MP3 player – Add voice and music to your embedded projects « olimex

    10 OPEN “COM3:9600″ AS #1 ‘open UEXT RS232 port
    20 PRINT “PRESS THE USER BUTTON TO PLAY DUHAST.MP3″
    30 DO: PAUSE 100: LOOP UNTIL PIN(0)=1 ‘wait button to be pressed
    40 PRINT #1, “PSONGNAME DUHAST.MP3″ ‘start playing the song
    50 PAUSE 1000 ‘wait 1 second
    60 PRINT “PRESS THE USER BUTTON AGAIN TO STOP THE SONG”
    70 DO: PAUSE 100: LOOP UNTIL PIN(0)=1 ‘wait button to be pressed
    80 PRINT #1, “C” ‘stop playing the song
    90 CLOSE #1

    EDIT
    adding this to the code ( add part in bold and undelined )

    '''''''''''''
    ' MAIN Starts here
    printHeader()
    drawBoxes()
    CANOPEN 500000
    ' waitForCanData()
    drawlabels()
    findBMS()
    ' priusreadysignal()
    setrelays()
    looper = 0
    bmsvolts = 210 : inversebyte()
    Do
    K$ = Inkey$
    If pin(0) = 1 Then F4() // use user button to switch phev and org mode
    If K$ = "q" Then CANCLOSE : Cls : Print " CANPORT CLOSED" : End
    If K$ = "Q" Then CANCLOSE : Cls : Print " CANPORT CLOSED" : End
    If K$ = Chr$(145) Then F1()
    If K$ = Chr$(146) Then F2()
    If K$ = Chr$(147) Then F3()
    If K$ = Chr$(148) Then F4()
    If K$ = Chr$(156) Then F12()
    If K$ = Chr$(128) Then bmsvoltsup() : updateBMS()
    If K$ = Chr$(129) Then bmsvoltsdown() : updateBMS()
    If (getCanData()=1) Then updateVGA()
    priusreadysignal()
    updateEVtry()
    If (R4 = 0) And (C1 = 0) And (looper => 1) Then updateBMS() : C1 = 1
    If (looper > 5) And (C3 = 0) Then
    If (pidrequest21C3()=1) Then updateVGATemp() : C3 = 1
    EndIf
    If (looper > 3) And (C4 = 0) Then
    If (pidrequest21C4()=1) Then updateVGATemp() : C4 = 1
    EndIf
    If (looper > 4) And (C5 = 0) Then
    If (getCanDataTemp()=1) Then updateVGATemp() : C5 = 1
    EndIf
    If looper => 6 Then looper = 0 : C1 = 0 : C2 = 0 : C3 = 0 : C4 = 0 : C5 = 0
    looper = looper + 1
    Locate 212,404
    Font 2
    Print looper;
    Loop

    NO more need for keyboard in basic PHEV on and off control ;-)

    EDIT
    tested it and it works
    so next up sometime wil be to connect a switch (with resistor? ) connected to one of the digital inputs.
    so i can make a external dasboard mounted ohev switch.
     
  9. Flying White Dutchman

    Flying White Dutchman Senior Member

    Joined:
    Dec 29, 2007
    4,374
    313
    0
    Vehicle:
    Other Non-Hybrid
    Model:
    N/A
    here is a small video
    i played around with the GPIO20 connector to see if i can drive a digital output that can be used to switch a relay
    i am using the digital output config 8 and not config 9 ( open collector ) used with the relay board lopez got and i hope to recieve also.
     
  10. lopezjm2001

    lopezjm2001 Senior Member

    Joined:
    Apr 14, 2009
    1,146
    407
    5
    Location:
    Sydney Australia
    Vehicle:
    Other Electric Vehicle
    Model:
    N/A
    You are correct I tried just sending 7E2 30 just once and it worked. Still have timing issues so I still need to loop until it works. Thanks.
     
  11. Flying White Dutchman

    Flying White Dutchman Senior Member

    Joined:
    Dec 29, 2007
    4,374
    313
    0
    Vehicle:
    Other Non-Hybrid
    Model:
    N/A
    lopez did you use the 5 volt from the board to power the VCC on the relay board from ebay? or external?
     
  12. lopezjm2001

    lopezjm2001 Senior Member

    Joined:
    Apr 14, 2009
    1,146
    407
    5
    Location:
    Sydney Australia
    Vehicle:
    Other Electric Vehicle
    Model:
    N/A
    Only connected to ground and 5V on the relay board.

    Maybe this FET shield would have been a better option. An FET can drive a relay directly up to 8 amps. More compact.

    Arduino FET shield | eBay
     
  13. Flying White Dutchman

    Flying White Dutchman Senior Member

    Joined:
    Dec 29, 2007
    4,374
    313
    0
    Vehicle:
    Other Non-Hybrid
    Model:
    N/A
    sorry not yet claer to me so ok gr0und and 5 volts from the duinomite board or ground from the duinomite and 5 volt external?
    i geuss the first one

    the fet is also 3 x more!
     
  14. lopezjm2001

    lopezjm2001 Senior Member

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

    lopezjm2001 Senior Member

    Joined:
    Apr 14, 2009
    1,146
    407
    5
    Location:
    Sydney Australia
    Vehicle:
    Other Electric Vehicle
    Model:
    N/A
    Just got my HV battery fan speed working with my Dionomite Mega. It was not quite the same as shown by RobH above. Using the above info I could not get it to work. So I used my Duinomite Mega to spy on my miniVCI chinese clone mongoose cable using Techstream software. See photos.

    The PID I found to work is

    7E3 04 30 81 06 0n ...................... n - 1 to 6 (fan speed setting)

    The return frame is

    7EB 02 70 81

    The interesting part is when using this PID is that if you stop sending the PID the HV battery fan turns off regardless. So if you assume that you only have to send the PID once you are wrong. It has to be sent periodically about every half second (timing guestimation).
     

    Attached Files:

    jdh2550 and dave77 like this.
  16. lopezjm2001

    lopezjm2001 Senior Member

    Joined:
    Apr 14, 2009
    1,146
    407
    5
    Location:
    Sydney Australia
    Vehicle:
    Other Electric Vehicle
    Model:
    N/A
    Does anybody know the address for the converter temperature using a CANUSB or an ELM, (not ScangaugeII). I know it is in the 07EA 21C4 memory block. Just do not know which byte.
     
    dave77 likes this.
  17. lopezjm2001

    lopezjm2001 Senior Member

    Joined:
    Apr 14, 2009
    1,146
    407
    5
    Location:
    Sydney Australia
    Vehicle:
    Other Electric Vehicle
    Model:
    N/A
    I have made up an adaptor so I can do a clean swap between my Duinomite Mega and my Canview V4 if needed to. See photos.
     

    Attached Files:

    jdh2550 and dave77 like this.
  18. jdh2550

    jdh2550 Co-Founder, Current Motor Company

    Joined:
    Nov 16, 2010
    317
    249
    0
    Location:
    Ann Arbor
    Vehicle:
    2005 Prius
    Model:
    N/A
    From USBSeawolf2000's Torque files:

    Converter Temperature Conv Temp 21C4 1.8 * F - 58

    I've attached a copy - it's my go to resource for all the PID values.
     

    Attached Files:

    lopezjm2001 likes this.
  19. jdh2550

    jdh2550 Co-Founder, Current Motor Company

    Joined:
    Nov 16, 2010
    317
    249
    0
    Location:
    Ann Arbor
    Vehicle:
    2005 Prius
    Model:
    N/A
    Well I got my DM Mega bootloader working. It was never broken - it turns out it was a faulty USB cable. The DM won't go into the bootloader unless there's an active USB connection.

    I spent a couple of hours or so on the CAN updates last night. It's a first pass at putting all the code in place. I also transitioned to MPLAB X for an IDE - although final compile still needs to be done in the V8 IDE. It's nice to have a good toolchain in place at last!

    The first thing I'm working on is adding two commands to Frank's implementation (with a slightly different approach than first envisioned):

    Code:
    CANADDCHNL chnl, id, type, buffsize, ok
    chnl - channel number between 2 and 31 (channels 0 and 1 are already in use by Frank's code)
    id - CAN id of message of interest
    type - 0 for standard ID, 1 for extended ID
    buffsize - number of messages to buffer
    ok - 1 if successful, 0 otherwise
     
    Adds a CAN channel set up to filter the provided ID.  For an unsolicited value buffer size will
    normally be 1 - i.e. you're just interested in the most recent value.  For a requested PID with
    a multi-frame response then buffsize should probably be set to number of expected frames *
    2 (some experimentation still required to see if it can just be number of expected frames)
     
     
    CANRCVCHNL chnl, data(8), ok
    chnl - channel number of previously added channel
    data(8) - 8 element array to receive data
    ok - 1 if successful, 0 otherwise
     
    Retrieves one message worth of data from the FIFO buffer associated with the channel that
    was configured with the CANADDCHNL command.
    
    I hope to get these working in the next couple of days.
     
  20. Flying White Dutchman

    Flying White Dutchman Senior Member

    Joined:
    Dec 29, 2007
    4,374
    313
    0
    Vehicle:
    Other Non-Hybrid
    Model:
    N/A
    Nice work both of you
    I am trying to use the Duinomite to control my charger
    Waiting for the relays board still

    U dont have canbus but i can now have a central device that will shutdown charger when one of the cellogs is triggered and also a temp sensor and to long charging time in one nice box that can even Send me a text message when charing us compleet with the modgsm module

    -Htc Tapatalk ( sorry for auto spell correct )