I think I CAN, I think I CAN... Topic is solved

Post Reply
User avatar
Gregski
Posts: 2196
Joined: Tue Sep 14, 2021 10:28 am
Location: Sacramento, California
Has thanked: 305 times
Been thanked: 397 times
Contact:

I think I CAN, I think I CAN...

Post by Gregski »

INTRODUCTION

I would like to sum up in a thread the process I will go through to learn Controller Area Network aka CAN bus. I am not an expert, I know nothing about it other than some EV components that I will most likely end up using, need it in order to be controlled (I'm looking at you onboard battery chargers)

since I am converting a 1971 Chevy truck to electric, the GIF below sums up my enthusiasm in wanting to A) learn CAN bus, and 2) introduce it to my vehicle, I hope that by posting this thread it will guilt me into learning it, and the tens of readers will hold me accountable

yes I know I am bolting up a ton of electrons and sophistication to it already but I draw the line at CAN, ha ha, also I know commercial chargers exi$t but I want to use repurposed hybrid or electric car bits

so if you share my excitement and interest in learning the bare minimum to make things work, chargers charge, converters convert, and current shunts shunt, than feel free to leisurely scroll down

Image
"I don't need to understand how it works, I just need to understand how to make it work!" ~ EV Greg
User avatar
Gregski
Posts: 2196
Joined: Tue Sep 14, 2021 10:28 am
Location: Sacramento, California
Has thanked: 305 times
Been thanked: 397 times
Contact:

Re: I think I CAN, I think I CAN...

Post by Gregski »

A LIST OF THINGS THAT CAN
(these will all be links eventually)

  • BMW 330e, 530e, and 740e battery pack BMS
  • Chevy Volt Charger (first gen only)
  • Chevy Volt DC-DC Converter (first gen only)
  • Damien Maguire's Lexus GS450h VCU

please holler at me with more items to add to the list

Image
"I don't need to understand how it works, I just need to understand how to make it work!" ~ EV Greg
arber333
Posts: 3241
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 74 times
Been thanked: 223 times
Contact:

Re: I think I CAN, I think I CAN...

Post by arber333 »

Gregski wrote: Thu Apr 28, 2022 5:05 pm A LIST OF THINGS THAT CAN

please holler at me with more items to add to the list

Image
Outlander heater
Outlander AC compressor

Incidentally Volt AC compressor also does CAN :) but i dont know its language...
User avatar
Gregski
Posts: 2196
Joined: Tue Sep 14, 2021 10:28 am
Location: Sacramento, California
Has thanked: 305 times
Been thanked: 397 times
Contact:

Re: I think I CAN, I think I CAN...

Post by Gregski »

"Retail" TOOLS THAT CAN these are off the shelf store bought tools

listed in order of price-a-tology, you do not need all of them, we will try to compare them and see which ones we like to use

I do not endorse nor profit from any sales of these tools, I am just sharing the tools I plan to try/evaluate and what I've seen the "Big Boys n Girls" use to reverse engineer, operate, or control these gizmos.



CANable: USB to CAN Adapter

$29 SOLD OUT

CANable.jpg
CANable.jpg (45.86 KiB) Viewed 7303 times




USB to CAN Analyzer CAN-BUS Intelligent Converter Adapter With USB Cable Support XP/WIN7/WIN8


AMAZON - $37

I hope to see if this can work as a bare minimum entry level solution,
I have not seen nor know of any of our Open Inverter Reverse Engineers (OIREs) use this particular tool,
if you have experience with it, please do share, feel free to update this thread as you wish

Manual: NA
Tech Support: NA

Pros Cons
cheap you must download and install drivers in addition to the software
only one CAN channel


61iCyGFES6L._AC_SL1001_.jpg
61iCyGFES6L._AC_SL1001_.jpg (37.65 KiB) Viewed 7305 times



Final Thoughts: though I somehow managed to get this gizmo to actually see/read CAN Bus messages it is NOT worth the headache, the interface is to arcane, so I actually returned it, and I hate doing that, but it sucked that bad!





CANalyst-II USB to CAN Analyzer CAN-Bus Converter Adapter Support ZLGCANpro

AMAZON - $84

as seen in action by Mr. Arber Kramar a mechanical engineer Ampera/Volt DCDC or APU

Manual: In Chinese
Tech Support: actually pretty responsive via email

Pros Cons
has two CAN Bus Channels
Software comes with driver
(only one thing to install)
Download site is in Chinese
Manual is in Chinese
61SOoQenK0L._AC_SL1200_.jpg
61SOoQenK0L._AC_SL1200_.jpg (29.79 KiB) Viewed 7305 times



Final Thoughts: I really wanted this thing to work out, it is a well made piece of hardware however it is pretty much for analyzing/reading CAN messages only, and not really for sending multiple commands simultaneously, so if I hadn't waited too long I would have returned this one as well.



MICROCHIP APGDT002 CAN BUS ANALYZER TOOL, CAN 2.0B, ISO11898-2

AMAZON - $170

Or direct from: Part Number: APGDT002 CAN BUS ANALYZER TOOL

Manual:
CAN-Bus-Analyzer-Users-Guide-DS50001848C.pdf
(907.26 KiB) Downloaded 173 times
Tech Support: http://support.microchip.com

31UQfBoQzNL._AC_.jpg
31UQfBoQzNL._AC_.jpg (9.16 KiB) Viewed 7305 times



we will rely on this Price to Ease of Use chart to rate our reverse troubleshooting (ha ha) tools

Price To Use Chart.jpg
Price To Use Chart.jpg (42.67 KiB) Viewed 7127 times
"I don't need to understand how it works, I just need to understand how to make it work!" ~ EV Greg
User avatar
Gregski
Posts: 2196
Joined: Tue Sep 14, 2021 10:28 am
Location: Sacramento, California
Has thanked: 305 times
Been thanked: 397 times
Contact:

Re: I think I CAN, I think I CAN...

Post by Gregski »

DIY TOOLS THAT CAN these are more difficult/complex to setup initially, but once configured they are great tools!

in addition to the "retail or commercial" tools listed above, I would like to review some free, roll your own, and or open source solutions as well, keep in mind that all things cost, and just because something is "free" as in money, that does not mean you don't get to pay for it in some other way, my personal experience has taught me that usually if it is money free it will cost you in terms of time and energy, not saying that is bad, just sayin'

I do not endorse nor profit from any sales of these tools, I am just sharing the tools I plan to try/evaluate and what I've seen the "Big Boys n Girls" use to reverse engineer, operate, or control these gizmos.



SaavyCAN on the Teensy hardware platform

Collin small.jpg
Collin small.jpg (4.72 KiB) Viewed 7280 times

SaavyCAN Bus Analyzer Software: FREE
available on the author's Collin Kidder's GitHub


Hardware: $25 for the Teensy 3.6 controller board (must be version 3.6) plus an additional $10 for the CAN transceiver board
available on AMAZON FYI: Currently SOLD OUT (as of 4/29/2022)

additional Software required for the hardware: FREE
  • Arduino IDE
  • Teensy-RET (Reverse Engineering Tool)
IMG_7600.JPG
IMG_7600.JPG (34.8 KiB) Viewed 7277 times

yes these are that tiny!
IMG_7485.JPG
IMG_7485.JPG (29.15 KiB) Viewed 7277 times
IMG_7413.JPG
IMG_7413.JPG (27.54 KiB) Viewed 7277 times



SaavyCAN on the Arduino DUE hardware platform

SaavyCAN Bus Analyzer Software: FREE
available on the author's Collin Kidder's GitHub


Hardware: $35 for the Arduino Due controller board (strongly recommend the green name brand board especially if it is your first Arduino product instead of the cheaper generic blue or black ones) plus an additional $10 for the CAN transceiver board
available on AMAZON FYI: Currently ON SALE 30% Off (as of 4/29/2022)

additional Software required for the hardware: FREE
  • Arduino IDE
  • RET (Reverse Engineering Tool)
Collin small.jpg
Collin small.jpg (4.72 KiB) Viewed 7280 times
IMG_9450.JPG
IMG_9450.JPG (27.86 KiB) Viewed 7278 times
IMG_7190.JPG
IMG_7190.JPG (54.81 KiB) Viewed 7280 times
41Z25TvqDpL._AC_.jpg
41Z25TvqDpL._AC_.jpg (10.67 KiB) Viewed 7278 times


we will also rely on this Price to Ease of Use chart to rate the open source / roll your own troubleshooting tools
"I don't need to understand how it works, I just need to understand how to make it work!" ~ EV Greg
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: I think I CAN, I think I CAN...

Post by Pete9008 »

I've got the bits to set up SavvyCAN here but not used them yet.

Have had a go with the software though and it does look very good.
User avatar
Gregski
Posts: 2196
Joined: Tue Sep 14, 2021 10:28 am
Location: Sacramento, California
Has thanked: 305 times
Been thanked: 397 times
Contact:

Re: I think I CAN, I think I CAN...

Post by Gregski »

Pete9008 wrote: Fri Apr 29, 2022 6:29 pm I've got the bits to set up SavvyCAN here but not used them yet.

Have had a go with the software though and it does look very good.
nice, which bits, on what platform, ie the Arduino Due or the Teensy? post some pics if you [ahem] CAN
"I don't need to understand how it works, I just need to understand how to make it work!" ~ EV Greg
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: I think I CAN, I think I CAN...

Post by Pete9008 »

Gregski wrote: Fri Apr 29, 2022 6:34 pm nice, which bits, on what platform, ie the Arduino Due or the Teensy? post some pics if you [ahem] CAN
:lol:

The Due, exact one you have pictured above. I could only get a TJA1050 board (5v not 3v3) to go with it though and I've seen a couple of posts saying they don't work well together so we'll see...

Software is easy to install on 64bit Linux, bit of a pain on 32bit though. May have to compile it from source to get it working on the laptop :(

I think there is also a wireshark plugin that can handle the CAN protocol but it looked a bit involved setting it up. SavvyCAN looked a lot more straightforward.
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: I think I CAN, I think I CAN...

Post by Pete9008 »

This prompted me to have a go with the boards I have here. I followed this guide https://openinverter.org/wiki/CAN_bus_with_Arduino_Due which pretty much covers all the setup.

Overall it works but there are a couple of issues that may need sorting. Firstly my Due board, which appears to be a genuine Arduino (same as the one pictured above), refuses to start properly following a power cycle and needs a manual reset. Seems there is a design flaw an some boards which can be fixed by adding a resistor, see https://copperhilltech.com/blog/arduino ... res-reset/

Also make sure you get a 3v3 transceiver board, for example something based on the SN65HVD230 should work fine. Mine is based on the 5V TJA1050 which needs a potential divider adding on the Rx output to get it to work with the Due 3V3 inputs.

Also if you use a Due board rather than the proper GVRET candue board then it's missing an EEPROM which means it can't save the configuration. This means it needs reconfiguring each time the power is cycled (although the sketch could be modified to make it default to whatever is needed).

Both GVRET and the SavvyCAN software looks good, I've only scratched the surface with them and apart from one small issue it works fine. The issue is the Temporal Graph window in SavvyCAN - no idea what it is doing but it is the first time I've seen Linux lockup so I'd advise treating it with caution.

Overall this setup looks like it should work well but I think you may be right with the commercial offerings being quicker to get going. I'm going to stick with this though.
User avatar
Gregski
Posts: 2196
Joined: Tue Sep 14, 2021 10:28 am
Location: Sacramento, California
Has thanked: 305 times
Been thanked: 397 times
Contact:

Re: I think I CAN, I think I CAN...

Post by Gregski »

so I'm gonna cut my teeth on a Chevy Volt Gen 1 onboard charger

IMG_2180.JPG

and a CANalyst-II pink thingie (yes I am aware of SavvyCAN but for that we need to know how to use Arduino, and yes it's easy once you know how, but I am trying to keep the complexity down so bare with me please)
IMG_2182.JPG


and a laptop in my case running Windows 10
IMG_2184.JPG

and a regular car battery (yes a bench power supply would make more sense, but chances are regular folk most likely don't have one of those, but they will have a car battery)
IMG_2186.JPG

DISCLAIMER: this is a non electrical engineer tutorial, in case you were fooled
"I don't need to understand how it works, I just need to understand how to make it work!" ~ EV Greg
User avatar
Gregski
Posts: 2196
Joined: Tue Sep 14, 2021 10:28 am
Location: Sacramento, California
Has thanked: 305 times
Been thanked: 397 times
Contact:

Re: I think I CAN, I think I CAN...

Post by Gregski »

What the hewk is a bench power supply?

well it's one of these $85 dollar white boxes with knobs on it that you plug into the wall and it takes Alternating Current (AC) and through some sort of VooDoo magic pumps out Direct Current (DC) so make your electronic device which you plug into it think it is running on battery power, the beauty of such a machine is that using the knobs you decide how much voltage 0 to 60 for example on some and how much amperage 0 - 5 comes out, so instead of buying 9 volt battery you just set the dial on 9 volts, and instead of buying a 12 volt car battery you just turn the knob to 12 volts
bench power supply.jpg
bench power supply.jpg (11.22 KiB) Viewed 7229 times
"I don't need to understand how it works, I just need to understand how to make it work!" ~ EV Greg
User avatar
TheSilverBuick
Posts: 187
Joined: Mon Jun 08, 2020 5:01 pm
Location: Nevada, United States
Has thanked: 3 times
Been thanked: 1 time

Re: I think I CAN, I think I CAN...

Post by TheSilverBuick »

Hi, I'm regular guy and intrigued to see if you CAN or CAN't.
Need to learn. Starting from the basics.
User avatar
Gregski
Posts: 2196
Joined: Tue Sep 14, 2021 10:28 am
Location: Sacramento, California
Has thanked: 305 times
Been thanked: 397 times
Contact:

Re: I think I CAN, I think I CAN...

Post by Gregski »

TheSilverBuick wrote: Sat Apr 30, 2022 1:25 am Hi, I'm regular guy and intrigued to see if you CAN or CAN't.
ha ha, I CAN't make any promises, but I'll definitely try
"I don't need to understand how it works, I just need to understand how to make it work!" ~ EV Greg
User avatar
Gregski
Posts: 2196
Joined: Tue Sep 14, 2021 10:28 am
Location: Sacramento, California
Has thanked: 305 times
Been thanked: 397 times
Contact:

Re: I think I CAN, I think I CAN...

Post by Gregski »

so the CANalyst-II connects to the laptop using one of them old big square plug USB cables, that comes with it (yes I am aware of Savvy CAN, but I am trying to avoid downloading Arduino IDE and chasing down libraries, and visiting GitHub, you know the drill) so the first pass is with the plug and pray out of the box solution, fingers crossed

IMG_2190.JPG
IMG_2192.JPG
"I don't need to understand how it works, I just need to understand how to make it work!" ~ EV Greg
User avatar
Gregski
Posts: 2196
Joined: Tue Sep 14, 2021 10:28 am
Location: Sacramento, California
Has thanked: 305 times
Been thanked: 397 times
Contact:

Re: I think I CAN, I think I CAN...

Post by Gregski »

the CANalyst-II needs software, if you Google for it you can find it, download it, and install it

User Friendly Level: -2
USB CAN TOOL Setup.jpg
USB-CAN Tool.jpg
"I don't need to understand how it works, I just need to understand how to make it work!" ~ EV Greg
User avatar
Gregski
Posts: 2196
Joined: Tue Sep 14, 2021 10:28 am
Location: Sacramento, California
Has thanked: 305 times
Been thanked: 397 times
Contact:

Re: I think I CAN, I think I CAN...

Post by Gregski »

since I am using a Chevy Volt gen 1 onboard charger as my CAN controlled device (your mileage may vary) I head on over to Mr. Arber Kramar's website called LEAFDRIVEBLOG next

whoa, how did I find that?

well first we start with this forum, from the beautifully organized landing page we know we want a Chevy product so we click on Chevy/Opel/Vauxhall/PSA that takes us to the Chevy subforum where one of the top threads just happens to be Chevy Volt Gen1 Charger and the very first reply by Mr. Jack Bauer points us at https://leafdriveblog.wordpress.com/2018/12/28/ampera-charger/

LEAFDRIVEBLOG.jpg
"I don't need to understand how it works, I just need to understand how to make it work!" ~ EV Greg
User avatar
Gregski
Posts: 2196
Joined: Tue Sep 14, 2021 10:28 am
Location: Sacramento, California
Has thanked: 305 times
Been thanked: 397 times
Contact:

Re: I think I CAN, I think I CAN...

Post by Gregski »

so one of the first things that we have to do is make a physical connection of what ever CAN bus scan tool we are using to what ever CAN enabled or CAN controlled apparatus we want to control or reverse engineer

at minimum there is a handful of wires to connect

1. one wire for CAN high signal
2. one wire for CAN low signal
3. usually a 12 volt constant power
4. usually a negative or ground wire
5. and usually a key on / ignition on 12 volt power

or some sort of combination of those, but the first two for sure always

for this we seek out what is called a Pinout Diagram, basically a chart or a table or a picture or a napkin with a bunch of numbered of dots representing pins of some sort of connector or a color code chart of a bunch of wires

New-Doc-2018-12-26-20.25.04_1.jpg
"I don't need to understand how it works, I just need to understand how to make it work!" ~ EV Greg
User avatar
Gregski
Posts: 2196
Joined: Tue Sep 14, 2021 10:28 am
Location: Sacramento, California
Has thanked: 305 times
Been thanked: 397 times
Contact:

Re: I think I CAN, I think I CAN...

Post by Gregski »

alright so here it is with the minimum wiring required to get some CAN traffic going, at this time we can READ the CAN messages flying by

so just to level set, there is no high voltage battery pack connected yet

the charger is also not plugged in to a J1772 plug connector wall charger what ever you wanna call it

yet we are already seeing CAN messages on the screen in our CANanalyst-II software
IMG_2197.JPG
IMG_2199.JPG
"I don't need to understand how it works, I just need to understand how to make it work!" ~ EV Greg
User avatar
Gregski
Posts: 2196
Joined: Tue Sep 14, 2021 10:28 am
Location: Sacramento, California
Has thanked: 305 times
Been thanked: 397 times
Contact:

Re: I think I CAN, I think I CAN...

Post by Gregski »

I am not saying this pink box is better than Savvy CAN by any means, and I will most likey end up using Savvy can in the end, I am just demonstrating that a Neanderthal like me could get this working using a store bought tool like this CANanalyst-II

I literally did not configure anything inside of it's software to get this to work, all I did was click on the shortcut on my desktop and it opened up and then I connected two wires to it, CAN high and CAN low, both of which are nicely labeled on the screw in terminals, I then connected three (thin) wires from the Chevy Volt Charger to the positive terminal on the battery, and the negative and positive leads to the battery on the 12 volt output side (medium thick wires)

IMG_2201.JPG
"I don't need to understand how it works, I just need to understand how to make it work!" ~ EV Greg
User avatar
Gregski
Posts: 2196
Joined: Tue Sep 14, 2021 10:28 am
Location: Sacramento, California
Has thanked: 305 times
Been thanked: 397 times
Contact:

Re: I think I CAN, I think I CAN...

Post by Gregski »

so we are going to connect the high voltage AC and DC next, bearing in mind the following from Mr. Kramar

" Be aware however you can cause damage in charger if you connect it to HV while 12v is active.
So connect inert charger to HV first, then connect the AC lines and only then attach LV connector."
"I don't need to understand how it works, I just need to understand how to make it work!" ~ EV Greg
arber333
Posts: 3241
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 74 times
Been thanked: 223 times
Contact:

Re: I think I CAN, I think I CAN...

Post by arber333 »

Gregski wrote: Sat Apr 30, 2022 4:33 am so we are going to connect the high voltage AC and DC next, bearing in mind the following from Mr. Kramar

" Be aware however you can cause damage in charger if you connect it to HV while 12v is active.
So connect inert charger to HV first, then connect the AC lines and only then attach LV connector."
Well let me chime in on your nice presentation. Volt gen1 charger is one of those thingies that need a heartbeat signal transmitted along the command signal. As long as heartbeat is there charger will listen to commands as they are on my blog.
Sadly Canalyst CAN only transmitt one telegram repeatedly. Howevwe i did notice it has a script option but i havent come that far because i use Canalyst as a monitor and DUE for issuing actual commands.

Maybe for your first application Volt DCDC converter would be easier to implement. See also if you can connect some 12V light bulbs to have an indication when you get DCDC to 14V :).
User avatar
Gregski
Posts: 2196
Joined: Tue Sep 14, 2021 10:28 am
Location: Sacramento, California
Has thanked: 305 times
Been thanked: 397 times
Contact:

Re: I think I CAN, I think I CAN...

Post by Gregski »

arber333 wrote: Sat Apr 30, 2022 6:21 amWell let me chime in on your nice presentation.
Yes, please do, always!

arber333 wrote: Sat Apr 30, 2022 6:21 amVolt gen1 charger is one of those thingies that need a heartbeat signal transmitted along the command signal. As long as heartbeat is there charger will listen to commands as they are on my blog.
Ah, thank you just learned something

arber333 wrote: Sat Apr 30, 2022 6:21 amSadly Canalyst CAN only transmitt one telegram repeatedly. However i did notice it has a script option but i haven't come that far because i use Canalyst as a monitor and DUE for issuing actual commands.
that is EXACTLY what I wanted to and needed to hear, as I could not make out how in the world I would send commands via CANalyst-II and how you were doing it on your website, another lesson learned

arber333 wrote: Sat Apr 30, 2022 6:21 amMaybe for your first application Volt DCDC converter would be easier to implement. See also if you can connect some 12V light bulbs to have an indication when you get DCDC to 14V :).
it may come to that, but stubbornly I must [ahem] charge on


again 1,000 thanks for chiming in, you or anyone else are more than welcome to sprinkle in as much knowledge as you can spare
"I don't need to understand how it works, I just need to understand how to make it work!" ~ EV Greg
User avatar
Gregski
Posts: 2196
Joined: Tue Sep 14, 2021 10:28 am
Location: Sacramento, California
Has thanked: 305 times
Been thanked: 397 times
Contact:

Re: I think I CAN, I think I CAN...

Post by Gregski »

back-to-the-drawing-board.jpg
"I don't need to understand how it works, I just need to understand how to make it work!" ~ EV Greg
User avatar
Gregski
Posts: 2196
Joined: Tue Sep 14, 2021 10:28 am
Location: Sacramento, California
Has thanked: 305 times
Been thanked: 397 times
Contact:

Re: I think I CAN, I think I CAN...

Post by Gregski »

alright, let's see what this MICROCHIP can do, it's black so it's gotta be good

IMG_2203.JPG
IMG_2205.JPG
IMG_2207.JPG
IMG_2209.JPG
"I don't need to understand how it works, I just need to understand how to make it work!" ~ EV Greg
User avatar
Gregski
Posts: 2196
Joined: Tue Sep 14, 2021 10:28 am
Location: Sacramento, California
Has thanked: 305 times
Been thanked: 397 times
Contact:

Re: I think I CAN, I think I CAN...

Post by Gregski »

same concept here, just a bit less arcane USB cable

IMG_2211.JPG
IMG_2214.JPG
"I don't need to understand how it works, I just need to understand how to make it work!" ~ EV Greg
Post Reply