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

    lopezjm2001 Senior Member

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

    It has just occured to me that you could use this developtment package to make your own BMSplus or BMS2 for your Generation 3 Prius. I am sure it can be easily done for a Gen 2 Prius. I think that you could be the ideal person for this project. But is it doable?

    Although it might be more effective and easier to spoof the ICE ECU. But will the Generation 3 ECU architecture allow you.
     
  2. Flying White Dutchman

    Flying White Dutchman Senior Member

    Joined:
    Dec 29, 2007
    4,374
    313
    0
    Vehicle:
    Other Non-Hybrid
    Model:
    N/A
    well i am kinda busy using the duinomite now as a charger controller
    only problem is if i open source the code and something go's wromng then somebodys cars is on fire or house
    so i am not going to open source it for that reason but i will open a topic in some time where i will explain what i have done
    no canbus control of charger because mine is only analog current control.
    and is sstill use the cellogs because monitoring 70 cells with 70 inputs al isolated is a bit expensif and a little to big i think
    so i keep the cellogs for cell monitoring and the duinomite with the cellogs relay to control the chager

    things like temp control ( high battery temp = charger off ) and with TO hihg temp a alarm and SMS to my phone ( already working )
    and keep the charger connected so in like 24 hours after a charge it wil auto topoff again and stuff like that

    i realy like this board.. if you did not started this canview i never would have got this board and look at what i am doing nnow ;_)
    also getting a arduino uno this wil replace the duinomite at charger control and so i have the duinemite again vor canview
     
  3. jdh2550

    jdh2550 Co-Founder, Current Motor Company

    Joined:
    Nov 16, 2010
    317
    249
    0
    Location:
    Ann Arbor
    Vehicle:
    2005 Prius
    Model:
    N/A
    There are probably 3,652.1 different solutions if we're going to look at different dev boards! ;)

    As JLo pointed out this is really about a board that supports MMBasic "out of the box" - it lowers the barrier for entry for the non-professional programmer. If they "outgrow" BASIC then they can add stuff to the interpreter - or at that stage just look for another board. I'm not confident enough with the entire interpreter to know how big a job it would be to use on the board you identified - there would certainly be a rewrite of the graphics subsystem. Would it be just different pin assignments for the SD Card? CAN? Oh, and BTW, I got bitten by the "it even has 10/100 Mbits ethernet" when I purchased the eMega DuinoMite (now sitting in it's box). Sure, the hardware is there - what about the software stack so I can make a TCP/IP connection with some other device?

    In my YaPIP project (with a thread on this forum) I'm actually using a similar board to the one you identified- but it's an Atmel dev board and it cost more :( . I wish I'd known about that one when I started - but I'm not going to switch horses at this point in the race. Oh, and the reason I went Atmel is because of getting started in micro-controller programming with an Arduino (a sw engineer with access to hw is a scary thing - just ask my business partner!!!)

    My involvement in this thread actually springs from JLo's involvement on YaPIP. That's the beauty of open source - it "cross-pollinates" and starts other interesting off shoots. I'm using my 'Mite as a useful "head unit" which is dirt simple to program and I can hook up to the CAN bus. The "heavy lifting" will be done with the Atmel.

    BTW, it literally took me about 1 hour to get a CAN data display working with the 'Mite. It took about a week to achieve the same thing with the Atmel board. That's the power of leveraging a high level language when it makes sense to...
     
    [email protected] likes this.
  4. jdh2550

    jdh2550 Co-Founder, Current Motor Company

    Joined:
    Nov 16, 2010
    317
    249
    0
    Location:
    Ann Arbor
    Vehicle:
    2005 Prius
    Model:
    N/A
    Ack, not this tired old argument again! ;)

    I would open source this but you might get carpal tunnel syndrome while you compile it and then I'll be screwed!

    Look at the top of almost any open source'd code and you'll see lots of valid disclaimers that have actually been reviewed by real lawyers. If you open source your code and use an appropriate license I believe you're safe. However, I ain't no lawyer - so it is of course up to you.

    You're simply letting them have a free copy of text documents that detail your algorithms codified in a particular programming language. But nothing that they take from you is actually *doing* anything. It's no different than taking a book on bomb making out of the library - the author of the book isn't liable for who you blow up, nor is the library. (yeah, for the 'Mericuns among us we have the whole "Patriot Act" debacle to deal with!)

    Now, if you were selling a completed charging control product then there's an implied requirement for safe and reliable operation for it's intended purpose when used in conjunction with the manufacturers instructions. At that point you need liability insurance in case someone does burn their house down and the major breadwinner goes up in the conflagration - then you'd better hire a good lawyer (actually the product liability carrier will hire a good lawyer for you!)
     
    [email protected] likes this.
  5. Flying White Dutchman

    Flying White Dutchman Senior Member

    Joined:
    Dec 29, 2007
    4,374
    313
    0
    Vehicle:
    Other Non-Hybrid
    Model:
    N/A
    Well i dont agree selling books that explain how to make bombs
    Just like you can find stuff online

    With canview nothing really can go wrong or can it but controlling a charge proces is something else

    Anyway even a 12 year old :p can write this code and relays on and off is easy
    So dont think there is any problem there.

    -Tapatalk
     
  6. jdh2550

    jdh2550 Co-Founder, Current Motor Company

    Joined:
    Nov 16, 2010
    317
    249
    0
    Location:
    Ann Arbor
    Vehicle:
    2005 Prius
    Model:
    N/A
    "With canview nothing really can go wrong or can it but controlling a charge proces is something else"

    Sure CANVIEW can cause damage - it's talking on the CAN bus (it sends as well as receives) - send the wrong messages at the wrong time and you could probably cause bad stuff to happen (and it indirectly can control the charge process with CCL/CDL messages). However, my YaPIP project would certainly fall into a similar category as your charge controller because it will also include charge control algorithms.

    So, how many cases of someone being sued for open source software causing physical damage have you heard of? Personally I haven't heard of any. The cases I've heard of are about people violating copyright - open sourcing something they have no right to.

    There are numerous reasons one may want to, or not want to, open source something. Some of those reasons are more valid than others. But this idea of exposing yourself to risk seems largely to be an urban myth. It's also a little frustrating to tell us on this thread which is fostering open source development and the exchange of ideas that you're happy to use our open source work but you're not going to reciprocate. Again, that's your choice but you may want to be a little more considerate in how you communicate it.

    BTW, I don't know if the 12 year old comment is meant to be funny but it's a joke that's passed it's prime (yes I know it comes from JLo's assertion but you keep using it out of context and it's just annoying now).

    You've asked me for specific help to get you up and running with CAN on MMBasic 3.2c. I gave you that assistance free of charge. Please don't ask me for more help unless you're willing to open source your results. Sorry if that seems harsh. Of course, the nature of open source is that you'll have access to all the code so you should be able to work it out yourself anyway.

    These are entirely my sentiments - I don't speak for anyone else on this thread.
     
  7. Flying White Dutchman

    Flying White Dutchman Senior Member

    Joined:
    Dec 29, 2007
    4,374
    313
    0
    Vehicle:
    Other Non-Hybrid
    Model:
    N/A
    If i would not have sad anything about that charger control i was working on, you would have not made the post you just did .
    And did not feel that way about it/me

    I just am a person that would not feel greet if Someone would burn there car down after reading my work.
    Not just Because of legal reasons your talking about.
    I just wurrie more about those kind off things.

    I wanted to open a topic Buth then i started to think about it and changed my mind. Thats not a bad thing.

    I did deside and thats Wy i was open about it that i would like to tell poeple it was easy to do and so on
    Others would also Maybe go that road after reading it

    But now i think i compleetly leave it after reading these comments



    -Tapatalk

    -Tapatalk
     
  8. jdh2550

    jdh2550 Co-Founder, Current Motor Company

    Joined:
    Nov 16, 2010
    317
    249
    0
    Location:
    Ann Arbor
    Vehicle:
    2005 Prius
    Model:
    N/A
    OK.

    Now lets get back on topic...
     
    lopezjm2001 likes this.
  9. Flying White Dutchman

    Flying White Dutchman Senior Member

    Joined:
    Dec 29, 2007
    4,374
    313
    0
    Vehicle:
    Other Non-Hybrid
    Model:
    N/A
  10. lopezjm2001

    lopezjm2001 Senior Member

    Joined:
    Apr 14, 2009
    1,146
    407
    5
    Location:
    Sydney Australia
    Vehicle:
    Other Electric Vehicle
    Model:
    N/A
    I have been working on the code to make a page that will plot a Real time graph of a variable such as the MG2 torque as you drive - See photo attached of MG2 torque and RPM. I would like to plot more than one variable and now I can see a good advantage for having a Duinomite Mega (DM) color modification. Fortunately Geoff Graham is working on a modification to modify the DM for color.

    The Back Shed: DuinoMite and Colour?

    Looking forward to see Geoff"s results.

    I have also included a BMP graphics file that will show the Duinomite logo at startup every time you start your Prius. Maybe I should include a disclaimer in the logo. Also looking at using the Playmod command in mmbasic 4.0 which can play a MOD sound file at startup. Something like this "Hello, how are you today" sounded over the 7" monitor speaker every time you startup the Prius. I will find out whether the Playmod command will work with Duinomite. I know it will work with the Maximite.
     

    Attached Files:

  11. lopezjm2001

    lopezjm2001 Senior Member

    Joined:
    Apr 14, 2009
    1,146
    407
    5
    Location:
    Sydney Australia
    Vehicle:
    Other Electric Vehicle
    Model:
    N/A
    I was using my Duinomite Mega to spy on my miniVCI as to how it gets the active PID from the ICE ECU for the 12V battery value and got the following results (see photos)

    The miniVCI transmitted:

    7E0 2 21 E1 - ????
    7E0 2 21 42 - asking for 12V battery value PID 2142

    The miniVCI received

    7E8 04 61 E1 00 00 - ????
    7E8 04 61 42 35 8E - here is the 12v battery value - 35 8E = 13710/1000 = 13.7 volts

    Does anybody have any idea what the two unknown frames are about? Handshaking? They are commonly used with all active PIDs asked by my miniVCI.
     

    Attached Files:

    NortTexSalv04Prius likes this.
  12. 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
    Lpz

    I don't know why you send 7E0 2 21 E1 before 7E0 2 21 42, but this first pid is used to get the number of dtc (according to berkeley xls)
    You get the answer : zero dtc = 00 00
    :)
     
  13. lopezjm2001

    lopezjm2001 Senior Member

    Joined:
    Apr 14, 2009
    1,146
    407
    5
    Location:
    Sydney Australia
    Vehicle:
    Other Electric Vehicle
    Model:
    N/A
    Thanks Planetaire. I guess it would make sense to check the ECU for a DTC before asking for PID.
    Where can I find Berkeley xls? Never mind. Found it with Google - really informative.
     
    [email protected] likes this.
  14. 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
    [email protected] and jdh2550 like this.
  15. jdh2550

    jdh2550 Co-Founder, Current Motor Company

    Joined:
    Nov 16, 2010
    317
    249
    0
    Location:
    Ann Arbor
    Vehicle:
    2005 Prius
    Model:
    N/A
    Hi Lopez,

    Maybe you could make a stacked set of graphs - that way you wouldn't need color. Also, sometimes it's easier to read stacked signals rather than having them all on the same axes - even when you do have color. Think of an old pen-based strip chart recorder. Of course you lose a certain amount of resolution - but I think in this case you want to look at general trends rather than detailed changes?

    Just a thought.
     
    [email protected] likes this.
  16. jdh2550

    jdh2550 Co-Founder, Current Motor Company

    Joined:
    Nov 16, 2010
    317
    249
    0
    Location:
    Ann Arbor
    Vehicle:
    2005 Prius
    Model:
    N/A
    OK - it's September and Labor Day here in the US. Which means I'm on holiday. And what better thing to do on holiday than code? (which is what I do for a living).

    I've just run a successful test on filtering. Yay! :)

    For those who care about the details: It turns out that I was chasing a red herring when looking at why "filters are not remaining set" - it may be a bug in the Microchip plib library but the "IsFilterDisabled()" func returns true even when a filter appears to be active. Or it might be me misunderstanding things regarding how to use the lib. It turns out the actual issue was my filter mask (not filter) was wrongly configured. One limitation with my just tested fix to the filter mask is that it will only work for SIDs (11-bits) not EIDs (29-bits). However the Prius only uses SIDs. I'll play with the mask configuration and see if I can make it work for EIDs

    So now I need to tidy up the implementation, transfer it to 4.0 (I'm currently working in 3.2c still) and do some more testing. Then I'll write some documentation and provide some examples. And then - I'll be ready to distribute it.

    But first comes dinner...

    :)
     
  17. jdh2550

    jdh2550 Co-Founder, Current Motor Company

    Joined:
    Nov 16, 2010
    317
    249
    0
    Location:
    Ann Arbor
    Vehicle:
    2005 Prius
    Model:
    N/A
    OK, attached is the first beta release of the new CAN commands. Included in the zip file are the following items:

    - DMCAN2.hex - flash this onto your DuinoMite. It's built from the latest MMBasic 4.0 files and the hex is distributed with permission of Geoff Graham (overall author of MMBasic).
    - CAN_Commands.pdf - documentation for the new commands
    - Example[0-2].bas - example files. These should get you started.

    A couple of notes:
    - it's still in beta so if you find bugs then tell me
    - it's open source and provided as-is - don't expect oodles of support but obviously I want to make sure it works properly
    - this code is not backwards compatible with the original CAN implementation. However, an enterprising sole could make a simple compatibility library by implementing Frank's original commands as subroutines.
    - the documentation refers to an additional 3 examples (one of which is the backwards compatibility subroutines). I haven't gotten around to them yet - but I figured you'd want me to distribute stuff sooner rather than later.
    - Geoff has indicated that he'll include this implementation into the official MMBasic code base. This will allow inclusion in future releases from Geoff.
    - The documentation file refers to "license X" - I'm still deciding on which license to use for the source code. The compiled hex is licensed in the same way as the original MMBasic hex. Use it in any way you want but it's provided as-is with no warranty expressed or implied.
    - One bug I just noticed (but am too lazy to fix right now) is that although CAN FREE does free all memory it doesn't appear to clear the filters properly (so you'd need to reboot your DM between running example1.bas and example2.bas to see the differences)

    Comments welcome.
     

    Attached Files:

  18. lopezjm2001

    lopezjm2001 Senior Member

    Joined:
    Apr 14, 2009
    1,146
    407
    5
    Location:
    Sydney Australia
    Vehicle:
    Other Electric Vehicle
    Model:
    N/A
    Thanks for taking the time to do your implementation. Lately on a couple of occasions I have had to compact my CanviewV4.0.BAS program due to using up too much memory, I could not edit the program online due to insufficient memory so I have had to split the program into two files for the purpose of debugging. Really need to edit online to debug my code. So I hope your implementation will allow me to cut down on program code, not have to split my program into two files and increase updating time.
     
    NortTexSalv04Prius likes this.
  19. lopezjm2001

    lopezjm2001 Senior Member

    Joined:
    Apr 14, 2009
    1,146
    407
    5
    Location:
    Sydney Australia
    Vehicle:
    Other Electric Vehicle
    Model:
    N/A
    Just converted my CanviewV4.0 program to JDH2550's new CAN command implementation. The CAN_commands.PDF file needed a example of using the CAN transmit command - CAN TX ......, Having a dedicated channel to buffer a certain PID made it easy to receive all my active PIDs in theory. So I figure that there would be several ways of of using dedicated channels with active PIDs.

    The PDF shows the CAN RX as CAN RX channel_num, data(8), ok

    and then in the example you show

    CAN RX 0,data(0),ok

    There is a inconstancy as to whether to use data(8) or data(0). I took a gamble and chose data(0).
     
    jdh2550 likes this.
  20. lopezjm2001

    lopezjm2001 Senior Member

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

    I ran your example1.BAS program. I get

    "channel flags = 0X1"
    "channel 0 filter is NOT set"

    I think it is only suppose to print the above to the screen when you use the command CAN PRINTCONFIG ok. But it is doing it with the CAN CONFIG ok command.

    In your example1.bas you need to reset the timer = 0 inside the loop after the print command so you can see how long it takes to update the screen.

    I think you have rushed this and maybe full of bugs. Needs further testing. Thanks.
     
    jdh2550 likes this.