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

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

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

Post by Gregski »

and we got ourselves a dime a dozen regular US 120 volt (pronounced: "one ten") 15 amp power cord, perfect for some troubleshootin'

IMG_2273.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: 398 times
Contact:

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

Post by Gregski »

arber333 wrote: Sun May 01, 2022 5:49 pm Ok so send the command with microchip at 500ms and heartbeat at 30ms from canalyst. If you can connect microchip the last one since it is probably terminated. You can disconnect termination resistor for canalyst so this is your best bet in the middle.

When connecting can modules you need to keep the length of the y line as short as possible, 10cm at most. Better to just put incomming and outgoing lines into the canalyst terminals altogether...
so here is my setup for dual CAN Bus analyzers (I realize the CAN bus wires are better off twisted together, these are just laid out for demonstration purposes)

IMG_2275.JPG
IMG_2277.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: 398 times
Contact:

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

Post by Gregski »

alright so I got both CAN analyzers hooked up and running and sending commands (one each)

and I figured out how to filter on CAN ID on the CANalyst-II (the pink one) so I confirmed that the black Microchip one is indeed sending it's message every 500ms as it should
CANalyst-II Receiving Message.jpg


yet it's still NOT WORKING

IMG_2279.JPG

does what I am sending look alright in the window below to you all?
CANalyst-II Sending Message 3.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: 398 times
Contact:

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

Post by Gregski »

so at this point it is one of these things:

1. I suck and have no idea what i am doing or I am simply making some bonehead mistake (highly likely)
2. the retail CAN analyzers suck
3. the charger is simply broken
"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: 398 times
Contact:

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

Post by Gregski »

the-beatings-will-continue-until-morale-improves.jpg
the-beatings-will-continue-until-morale-improves.jpg (76.25 KiB) Viewed 3642 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: 398 times
Contact:

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

Post by Gregski »

it's time for...




[ wait for it ]


LaunchScreen.png
"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: 398 times
Contact:

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

Post by Gregski »

and here is how you bake a SavvyCAN cake, first the dry ingredients (aka the hardware)

you start off with a Chevy Volt first gen onboard charger
IMG_2281.JPG


then you add a scoop of Arduino Due
IMG_2283.JPG
IMG_2285.JPG

a pinch of a CAN BUS transceiver (this is because the Arduino Due board is CAN enabled or CAN ready but it does not have all the extra hardware on it, so it needs what is called a shield, an add on or an adapter if you will)
IMG_2291.JPG

yes this thing is tiny
IMG_2293.JPG

a laptop as before
IMG_2297.JPG

and of course a regular car battery
IMG_2300.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: 398 times
Contact:

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

Post by Gregski »

Arduino does not make a Due board with a built in CAN bus transceiver EVTV.me does and calls it a EVTVDUE MICROCONTROLLER so we sent them $100 large and now we could wait for it to arrive, or we can roll our own today

the little CAN Bus transceiver is connected to the Arduino Due board (aka the brain ie microcontroller) via four wires, it get's it's 3.3 volt power from the Due board in daisy chain fashion

black - negative / ground
red - positive 3.3 volts
yellow - transmit
green - receive

IMG_2301.JPG
IMG_2303.JPG
IMG_2305.JPG
IMG_2307.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: 398 times
Contact:

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

Post by Gregski »

alright, congratulations we are half way there to setting up our DIY SavvyCAN thingie

now comes the wet ingredients aka the Software

yes Mr. Collin Kidder gives us a program to run, but that program needs something called Generalized Electric Vehicle Reverse Engineering Tool (GV-RET) which needs to be somehow installed on the Arduino Due board in order to run/execute, and for that we need something called Arduino IDE (Integrated Development Environment) think Notepad on steroids

arduino.png
arduino.png (4.24 KiB) Viewed 3623 times
Arduino IDE Download.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: 398 times
Contact:

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

Post by Gregski »

after you install Arduino IDE and tether your Due board to your computer for the first time you might get prompted to install a board driver, just go on and do it
Boards Manager.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: 398 times
Contact:

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

Post by Gregski »

Arduino calls programs "sketches" and when ever you launch the IDE it opens to a fresh new sketch, it wants you to start writing some code, just ignore that for now

First Sketch.jpg

we need to tell Arduino what little brain board we are connecting to it via a USB cable, in our case it is a native Arduino Due so we go to:

Tools\Board\Arduino ARM (32-bits) Boards\ and select Arduino Due (Native USB Port) don't even connect to the other Programming port even if programming
Board Arduino Due.jpg

now that we told it what board we have now we have to tell it what COM port it is on, the number does not matter, it's what ever COM port your computer finds the board connected to (you may have to close Arduino IDE and relaunch it to get it to see the board on a certain Port)
COM Port.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: 398 times
Contact:

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

Post by Gregski »

"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: 398 times
Contact:

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

Post by Gregski »

a great write up on CAN bus with Arduino Due is on our very own Wiki, no need for me to reinvent the wheel, but here is a summary

to get pretty much any program to run in Arduino you need something called "Libraries" or as I like to call them ".h files"

1. there are many different ways to install something called "libraries" in Arduino. Libraries are nothing more than just small snippets of code written by people who already dealt with the stuff you are about to deal with, and they were kind enough to save their work and offer it up to you to use so that you don't have to reinvent the wheel (think of it this way a screwdriver in your toolbox is like a library, you don't go buy a new screwdriver every time you go to work on something, you just reach for an existing screwdriver in your toolbox) for example somebody already wrote the code to make a microphone listen, so when you want to write some program that requires a microphone to listen, you can write it from scratch or just download some library called microphone.h because that what suffix the Italians put on their library files ".h"

One way to install libraries is to use the Manage Libraries menu item under Tools cause Arduino comes with a bunch of libraries but they are NOT installed (this is dumb) so you have to install the library that you want/need
Arduino Manage Libraries.jpg
the libraries come in different versions and chasing the latest version may not always yield desirable results and you may want to try an older version and if that still doesn't work go a few more version back (ask me how I know)
Arduino Library Manager.jpg


In order to get the Arduino Due board to realize it can talk to CAN transceiver you need to install a library called due_can this is one of those libraries you install using the Library Manger described above
Arduino due_can.jpg


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: 398 times
Contact:

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

Post by Gregski »

oneeternitylater.jpg

we are back to square one for the fourth time? this time using SaavyCAN here we can see that I managed to successfully connect to the charger and am actually once again reading the CAN bus messages flying by

Fun Fact: CAN Bus is chatty, imagine a bunch of birds sitting on a telephone wire all singing, screaming, chirping at the same time, everyone is talking to everyone, everyone hears all the conversations, yup that's good ol' CAN bus for you

IMG_2309.JPG
IMG_2311.JPG
IMG_2313.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: 398 times
Contact:

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

Post by Gregski »

so with everything hooked up from what I know so far the first thing you have to do in SaavyCAN is make a connection, and you do that via the Open Connection Window and then you simply add a new device the Arduino Due in my case by telling SaavyCAN what Port it is on

New Connection.jpg
New Connection.jpg (29.24 KiB) Viewed 3579 times
Connection Settings.jpg


and here's a better look at my capture of frames
SaavyCAN Messages.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: 398 times
Contact:

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

Post by Gregski »

alright then it was off to the Frame Sender window and the SaavyCAN documentation

Frame Sender.jpg

so here is a first super simple message to only enable the 12 volt aka low voltage charger
First Command.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: 398 times
Contact:

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

Post by Gregski »

and here are both messages being sent

Both Commands.jpg


and here both frames or messages what ever you wanna call them are captured, does this look right? cause it's still not working
Both Commands Captured.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: 398 times
Contact:

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

Post by Gregski »

"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: 398 times
Contact:

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

Post by Gregski »

and literally in the 11th hour I got it working but only by enabling both the low voltage and the high voltage chargers using the 0x03 bit and when I do so I can see amps on the high voltage orange wire going into the battery, it reads 3.5 amps which is approximately half of what I have it set to ie 8 amps, but that's because I am on only 120 volts AC

IMG_2316.JPG
Enable both command.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: 398 times
Contact:

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

Post by Gregski »

Fun Fact: I tried sending the first command at 100ms, 200ms, all the way up to 500ms and they all work for me, so not sure why it has to be at 30ms

also 0x02 or enabling just the high voltage charger works as well, this begs the question is my low voltage side of this charger broken? when I connect a simple multimeter to it with the low voltage charger enabled I should see a higher voltage like 14 volts or something right? well mine showed 10.5 and dropping and it's at 8.4 right now, so time to quit, I learned a ton
"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 »

Sorry for not being there for you, even i have to sleep sometime 😂.
I managed to find out CAN bus is very finnicky when it comes to Y cable length. So really short extensions from out of the main line please.
Also dont twist the wires in different directions...just dont!
And the use of the termination resistor... oh dear! I spent a lot of moments like "what am i doing wrong?" and it worked just fine when i sorted out two 120ohm resiators on both ends of the long twisted wires. If you measure across CAN twisted pair resistance shouldnt be much more/less than 60ohm. If it is more, than you have another resistor active somewhere...
User avatar
EV_Builder
Posts: 1199
Joined: Tue Apr 28, 2020 3:50 pm
Location: The Netherlands
Has thanked: 16 times
Been thanked: 33 times
Contact:

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

Post by EV_Builder »

arber333 wrote: Mon May 02, 2022 7:01 am If it is more, than you have another resistor active somewhere...
If it's less you mean :) , adding resistors lowers the total parallel measurement 8-)
Converting an Porsche Panamera
see http://www.wdrautomatisering.nl for bespoke BMS modules.
User avatar
Gregski
Posts: 2196
Joined: Tue Sep 14, 2021 10:28 am
Location: Sacramento, California
Has thanked: 305 times
Been thanked: 398 times
Contact:

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

Post by Gregski »

arber333 wrote: Mon May 02, 2022 7:01 am Sorry for not being there for you, even i have to sleep sometime 😂.
Don't lie, heroes never sleep!
"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: 398 times
Contact:

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

Post by Gregski »

Oh my goodness, it all works, I figured it out, and you will not believe what was the problem!!!

I was trying to charge an AGM deep cycle battery and not a "real" car battery. Who knew that won't work?

Mighty Max.jpg
"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 »

EV_Builder wrote: Mon May 02, 2022 11:16 am
arber333 wrote: Mon May 02, 2022 7:01 am If it is more, than you have another resistor active somewhere...
If it's less you mean :) , adding resistors lowers the total parallel measurement 8-)
Right...🙄
Post Reply