Volvo C30 with Leaf drivetrain

Tell us about the project you do with the open inverter
User avatar
bexander
Posts: 834
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 63 times
Been thanked: 89 times

Volvo C30 with Leaf drivetrain

Post by bexander »

Creating this thread as I just bought my next project car, a Volvo C30.
IMG_1922.jpg
IMG_1923.jpg
IMG_1924.jpg
My plan is to replace the sad old diesel engine with the motor, inverter and gearbox from a Leaf or more specific, the drivetrain I'm currently running in my Clio.
Battery is not yet decided but 80-96S and 15-20kWh is the baseline.
Charger will be based on Eltek FlatPack's.

The hardest work will most likely be to hack the HSCAN-bus to be able to emulate the removed ECM.
The C30 platform is shared with Volvo S40, V50, C70, Mazda 3 and Ford Focus. I think the S60 shares the same electric architecture as well. But I haven't found a great deal of information online.
Some basic information about the Volvo CAN:
The CAN network on a Volvo.odt
(852.23 KiB) Downloaded 120 times
So if anyone knows a good source of information regarding Volvo HSCAN messages, please share.

I have installed SavvyCAN and just bought a Arduino Due so will start diggin in to CAN-messages soon.
User avatar
bexander
Posts: 834
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 63 times
Been thanked: 89 times

Re: Volvo C30 with Leaf drivetrain

Post by bexander »

Sharing what I have found so far regarding the HS-CAN. Some things are my best guesses.
volvo_c30_2007_hs_can.dbc
(5.07 KiB) Downloaded 93 times
C30_CAN.txt
(681 Bytes) Downloaded 91 times
volvo_c30_2007_hs_can_message_id.txt
(1.08 KiB) Downloaded 90 times
Focus is to understand what the ECM does and how I can create a "fake" one to keep the rest of the modules happy.

My log-files so far:
Volvo_C30_HS-CAN_logs_stationary.zip
(5.43 MiB) Downloaded 86 times
Volvo_C30_HS-CAN_logs_driving.zip
(8.24 MiB) Downloaded 93 times
Also, started to search for a suitable battery and I have gotten a good deal on a VW e-up -20 battery pack so its 36kWh. A bit larger then I was looking for but both volume and weight is ok. My plan is to try and use OEM-BMS with some CAN-hackning as well, hoping it is similar to e-Golf...

EDIT: Updated with my latest findings.
User avatar
crasbe
Posts: 234
Joined: Mon Jul 08, 2019 5:18 pm
Location: Germany
Has thanked: 43 times
Been thanked: 97 times

Re: Volvo C30 with Leaf drivetrain

Post by crasbe »

If the C30 is anything like the earlier P26 platform (V70 II, etc), you proooooooobably won't be able to remove the ECM entirely. The P26 platform has a static handshake between the CEM and the ECM for the immobilizer. Without that the CEM won't unlock many features of the car (and you'll get an error message in the display). (The C30 is the P1 platform, not sure if that's better or worse: https://d5t5.com/wiki/wiki/article-volvo-platforms )

The later platforms are even worse in terms of the immobilizer because they have a changing challenge (with increasing key) between the CEM and ECM which has not been reverse engineered yet.

I took a quick look into the documents in VIDA (which you should really get for this) and you miiiiiiight be lucky. The documents mention nothing about cryptographic stuff (but it's not terribly detailed either). The documents for the immobilizer are located in "Information -> Product Specifications -> Design and Function -> 3 Electrical System -> 36 Other electrical equipment -> Immobilizer/Start Inhibition". This is for VIDA 2014D, the latest offline version. I'm not sure if you can get access to the online version and where it could be found there.
One thing that stands out is one sentence that mentions diagnostic test modes which circumvent the immobilizer.

VIDA is actually even more of a gold mine, since it contains a lot (or all) of the CAN IDs of the modules as well. There are some pages about "VIDA Mining", since it's essentially a big SQL database: http://www.stevediraddo.com/2019/01/13/ ... tinkering/
MAYBE you can find the CAN sequence for the aforementioned test mode in there but I haven't checked.


For another route you can have a look at this project: http://s80ev.blogspot.com

I think he started by trying to fake the sensor values of the ICE to make the ECM happy and later just intercepted the CAN signals to send RPM etc values to the rest of the car. So the actual ECM knows sends the messages of a stopped engine but the "man in the middle" CAN Filter module changes those values to whatever the electric motor is currently doing.


A few more CAN messages can be found here (but no guarantee that they are the same for the C30): https://github.com/vtl/volvo-ddd
This site has more good information as well (as before, I don't know if it's applicable to the C30): http://hackingvolvo.blogspot.com/2012/12/success.html
Some information about the electronic power steering (not sure if the C30 has that) and some further links about CAN details: https://rusefi.com/forum/viewtopic.php?p=45444#p45444
This is actually for the C30 and has a lot of legwork already done: https://github.com/Alfaa123/Volvo-CAN-Gauge

If anything, you have some stuff to read now (if you didn't find those pages yourself before). :)


Edit: A lot of information about the CEM can be found here: https://www.matthewsvolvosite.com/forum ... 10&t=85611
There is some information about the immobilizer hidden in there as well, but I'm not registered so I can't search for it (and I don't want to look through the 200+ pages again :D )

This could be interesting as well (not sure which ECM the C30 has though): https://github.com/prometey1982/VolvoTools

This is P2 platform, so probably not very useful (I guess?): https://www.swedespeed.com/threads/canb ... le.171294/


That's all information I've gathered so far because I intend to convert a Volvo V70 II at some point in the future :D
User avatar
bexander
Posts: 834
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 63 times
Been thanked: 89 times

Re: Volvo C30 with Leaf drivetrain

Post by bexander »

That is awesome @crasbe, great information. Thank you very much!!

I have the Vida 2014D installed and have just read through the Immo information you pointed to.
Seem to be more complicated then I was hoping... This will for shure be the biggest challange with this project...

Do you know if the Vida SQL contain info regarding the in car CAN-bus communication? To my understanding it only contains information regarding the Vida request/respond CAN-communication for diagnostics.
arber333
Posts: 3241
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 74 times
Been thanked: 223 times
Contact:

Re: Volvo C30 with Leaf drivetrain

Post by arber333 »

Hm... like i said i sometimes use the WRONG key for my Pug and immobilizer just goes nuts... but the moment i apply engine running signal its just not interested anymore. :twisted:

I know Michael. He was also involved in EVTV first attempt at GEVCU as i remember. He has a good schematic design for DUE CAN and SW CAN oh his site. I used to talk to this guy, but last couple of years i cant seem to get a reply.
User avatar
crasbe
Posts: 234
Joined: Mon Jul 08, 2019 5:18 pm
Location: Germany
Has thanked: 43 times
Been thanked: 97 times

Re: Volvo C30 with Leaf drivetrain

Post by crasbe »

bexander wrote: Wed Aug 03, 2022 6:16 am Do you know if the Vida SQL contain info regarding the in car CAN-bus communication? To my understanding it only contains information regarding the Vida request/respond CAN-communication for diagnostics.
I'm not entirely sure. If anything you'll learn the IDs of the ECMs. However there should be diagnostic functions like "turn on interiour light at 50%" or "check throttle position" they'll probably use the real CAN messages... I guess?
User avatar
crasbe
Posts: 234
Joined: Mon Jul 08, 2019 5:18 pm
Location: Germany
Has thanked: 43 times
Been thanked: 97 times

Re: Volvo C30 with Leaf drivetrain

Post by crasbe »

arber333 wrote: Wed Aug 03, 2022 6:59 am Hm... like i said i sometimes use the WRONG key for my Pug and immobilizer just goes nuts... but the moment i apply engine running signal its just not interested anymore. :twisted:
That's actually well worth a try. But you'd probably have to intercept the CAN bus between the CEM and the DIM (the instrument cluster) to avoid the "IMMOBILIZER. SEE USER MANUAL" (or whatever it is in English/Swedish) message. At least in Germany the car is required to have a functioning immobilizer after a certain year (2001 I think?). Not that the TÜV would check that, but if there's such a message, it might give them bad ideas to check it :D
User avatar
bexander
Posts: 834
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 63 times
Been thanked: 89 times

Re: Volvo C30 with Leaf drivetrain

Post by bexander »

crasbe wrote: Wed Aug 03, 2022 10:53 am
arber333 wrote: Wed Aug 03, 2022 6:59 am Hm... like i said i sometimes use the WRONG key for my Pug and immobilizer just goes nuts... but the moment i apply engine running signal its just not interested anymore. :twisted:
That's actually well worth a try. But you'd probably have to intercept the CAN bus between the CEM and the DIM (the instrument cluster) to avoid the "IMMOBILIZER. SEE USER MANUAL" (or whatever it is in English/Swedish) message. At least in Germany the car is required to have a functioning immobilizer after a certain year (2001 I think?). Not that the TÜV would check that, but if there's such a message, it might give them bad ideas to check it :D
Yes, that is an interesting behaviour. Worth a try when I have figured out what signals is the engine running... :)

I did come across this:
https://github.com/vtl/volvo-cem-cracker
Not exactly what I'm looking for but might provide some clues. Just skimmed through the code so far.
User avatar
crasbe
Posts: 234
Joined: Mon Jul 08, 2019 5:18 pm
Location: Germany
Has thanked: 43 times
Been thanked: 97 times

Re: Volvo C30 with Leaf drivetrain

Post by crasbe »

The CEM cracker history is described in the first link on the edit.

To explain what it is I have to tell a bit of a longer story:
VIDA does not contain any software for any of the modules in the Volvo. If you want to flash a module, you have to access it from the Volvo servers (which is obviously not possible for the *cough* copies of VIDA). This is usually quite an expensive endeavour as well.

There is some software from Eastern Europe (like VDASH from the d5t5 Website) which can read and flash modules without accessing the Volvo servers from previously read images. This can be important when you change any module in the car, because it's usually programmed to the VIN.

The CEM however is different from other modules because it contains a PIN that is necessary to initialize the flash mode. The CEM Cracker software uses a quirk in the microcontroller to guess the PIN. With that PIN you can read and flash the CEM with VDASH etc.


For your application, this is not incredibly useful though. I don't think there's a need to flash the CEM (except if you want to reverse engineer the CEM microcontroller program and disable the immobilizer :D ).
All of this trouble can be circumvented though if you just access the programming port on the PCB of the CEM. VDASH works via OBD/CAN and doesn't require opening the module.
User avatar
bexander
Posts: 834
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 63 times
Been thanked: 89 times

Re: Volvo C30 with Leaf drivetrain

Post by bexander »

I have updated the dbc-file to the latest, viewtopic.php?p=43056#p43056

I have decided that it is now time to disassemble the car. The immo and other problems will have to be solved once the car is converted.
User avatar
Ev8
Posts: 801
Joined: Sat Jan 30, 2021 11:05 am
Has thanked: 41 times
Been thanked: 149 times

Re: Volvo C30 with Leaf drivetrain

Post by Ev8 »

That’s my kinda thinking, on the RX8 the immobiliser is the only bit on oem hardware I never got working, the dash still blinks a key symbol at me,
User avatar
bexander
Posts: 834
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 63 times
Been thanked: 89 times

Re: Volvo C30 with Leaf drivetrain

Post by bexander »

I have now removed entire exhaust system incl. cat and dpf and fueltank to find out how much space there is to use for batteries.
IMG_2001.jpg
E-up battery is 36kWh with a weight close to 200kg for the modules.
I have found another option by using cells from Kia Niro. Will be more work but a 84S1P configuration would provide 19kWh with a weight under 100kg.
Niro option easier to fit, but I think there is enought room to fit e-up battery if some moduleas are placed above the rear axle subframe.
Leaning towards the Niro option as I really like low weight and rarely do longer trips.

I also have some ideas regarding range extension (battery trailer or IC powered pusher trailer). Will look into this more when car is converted and registered.
User avatar
bexander
Posts: 834
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 63 times
Been thanked: 89 times

Re: Volvo C30 with Leaf drivetrain

Post by bexander »

Oil burner removed.
IMG_2011.jpg
Left to remove is shift linkage and diesel powered auxiliary heater before I can start fitting the electric drivetrain.
IMG_2012.jpg
User avatar
bexander
Posts: 834
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 63 times
Been thanked: 89 times

Re: Volvo C30 with Leaf drivetrain

Post by bexander »

I've started mocking up drive unit mounts for the leaf motor/gearbox. In my Clio I used differential bushings from a BMW E39 as motor mount.
33171090389.jpeg
Fits well in a tube with ID: 53mm, 45mm length, and works well with a M14 bolt. It is very easy to use but it is quite stiff an so I ask if there are better bushings out there that might be a bit softer?
To my understanding the Outlander rear diff mounts are quite soft. Would love to use such bushings but I have not found them as lose pieces, only together with aluminium bracket?
User avatar
crasbe
Posts: 234
Joined: Mon Jul 08, 2019 5:18 pm
Location: Germany
Has thanked: 43 times
Been thanked: 97 times

Re: Volvo C30 with Leaf drivetrain

Post by crasbe »

I recently bought a Volvo S60 I as a daily driver and a new diagnostic tool (iCarsoft CR MAX) and played around with it a little bit. (Yes, different platform than your C30, but maybe still interesting).

It gave some insight about other potential factors of the immobilizer. The diagnostic numbers 47-59 in the PDF (there are 3 frames, they should be identical) seem to be relevant. Interesting here is that it validates "TP", which I guess it the throttle body module.

IF your diesel engine has a throttle body module, you should certainly keep it for now since Volvos are generally very picky about that (you can't just change it for example, it has to be programmed. And it's a known weakness of the Volvos of a certain era...).
Attachments
2022-09-21_13-54-29[1].pdf
(26.06 KiB) Downloaded 99 times
User avatar
bexander
Posts: 834
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 63 times
Been thanked: 89 times

Re: Volvo C30 with Leaf drivetrain

Post by bexander »

My car did not have a throttle body module, the TP is controlled directly from ECM.
I do know that the brake control module (BCM) sends its serial number to the ECM for immo verification. I have kept the ECM and might use it to verify immo if I'm unable to get the car to work without it.
User avatar
bexander
Posts: 834
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 63 times
Been thanked: 89 times

Re: Volvo C30 with Leaf drivetrain

Post by bexander »

I'm currently building the battery pack and it consumes a lot more time then expected... Will post pictures once it is built.
I have made an adapter board for the connector on the E-niro BMS slave modules. I don't like pigtail wiring join mid-wire but rather connectors that can be bought with new crimp pins for neat wiring harnesses. In order to do so for the slave modules the connectors need to be replaced, hence my adapter boards.
OEM-board
OEM-board
Cut off OEM-connector
Cut off OEM-connector
Adapter board and distance board
Adapter board and distance board
Distance and adapter board mounted, new connector
Distance and adapter board mounted, new connector
Complete
Complete
Complete
Complete
This mod makes the slave board 20mm longer and a few mm higher.

BOM:
https://se.rs-online.com/web/p/pcb-headers/6908903
https://se.rs-online.com/web/p/pcb-headers/6908916/
https://se.rs-online.com/web/p/automoti ... s/6909855/
https://se.rs-online.com/web/p/automoti ... rs/6909868
https://se.rs-online.com/web/p/crimp-contacts/6909899

Gerber-files:
BMS_slave_adapter_V2.zip
(54.58 KiB) Downloaded 69 times
BMS_slave_adapter_V2_distance.zip
(30.25 KiB) Downloaded 66 times
User avatar
bexander
Posts: 834
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 63 times
Been thanked: 89 times

Re: Volvo C30 with Leaf drivetrain

Post by bexander »

Finally some progress with the batteries. Have been spending quite some time with my mill to produce this:
IMG_2166_crop.jpg
Today I was finally ready to assemble:
IMG_2174_crop.jpg
IMG_2175_crop.jpg
Both modules are done even though the pictures only show one, 40S in each. Weight is just shy of 44kg per module.

Next is the contators and precharge. Also need to sort out busbars and BMS connection boards.
User avatar
crasbe
Posts: 234
Joined: Mon Jul 08, 2019 5:18 pm
Location: Germany
Has thanked: 43 times
Been thanked: 97 times

Re: Volvo C30 with Leaf drivetrain

Post by crasbe »

It's nice to see your progress :)
And remember: Winter time is EV hacking time! :D
User avatar
crasbe
Posts: 234
Joined: Mon Jul 08, 2019 5:18 pm
Location: Germany
Has thanked: 43 times
Been thanked: 97 times

Re: Volvo C30 with Leaf drivetrain

Post by crasbe »

With info from the Volvo CAN Gauge project I could add two more signals to your DBC:

Code: Select all

BO_ 16779308 ImmoCEM: 8 CEM
   SG_ InstrumentBrightness : 3|4@0+ (1,0) [0|1] "" XXX
   SG_ DayNightMode : 15|1@0+ (1,0) [0|1] " ; 0=DayMode, 1=NightMode" XXX
This might mean the messages are not for the immobilizer but the Instrument Cluster?


Furthermore I did some digging in the VIDA scripts, but it looks like these are all(?) just in the diagnostic request format, that is described in the CAN Gauge project as well:
https://www.matthewsvolvosite.com/forum ... 50#p620050
User avatar
bexander
Posts: 834
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 63 times
Been thanked: 89 times

Re: Volvo C30 with Leaf drivetrain

Post by bexander »

Well, could be both these signals and IMMO info in same message?

The Inctrument Cluster is not on the HS-can but on the LS-can so I think these signals are for the SWM, which controls the steering wheel buttons and likely also the brightness of their backlighting.
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: Volvo C30 with Leaf drivetrain

Post by EV_Builder »

Ev8 wrote: Wed Aug 24, 2022 1:57 pm That’s my kinda thinking, on the RX8 the immobiliser is the only bit on oem hardware I never got working, the dash still blinks a key symbol at me,
Im quite sure i saw small devices who fix that for rx8...
Converting an Porsche Panamera
see http://www.wdrautomatisering.nl for bespoke BMS modules.
User avatar
crasbe
Posts: 234
Joined: Mon Jul 08, 2019 5:18 pm
Location: Germany
Has thanked: 43 times
Been thanked: 97 times

Re: Volvo C30 with Leaf drivetrain

Post by crasbe »

bexander wrote: Mon Feb 20, 2023 4:54 am Well, could be both these signals and IMMO info in same message?

The Inctrument Cluster is not on the HS-can but on the LS-can so I think these signals are for the SWM, which controls the steering wheel buttons and likely also the brightness of their backlighting.
That's certainly possible as well. When comparing the logs, it looks like the first two bytes are relevant to the backlight/DayNightMode stuff and the following 6 bytes change every time the car wakes up with the key being inserted.

EV_Builder wrote: Mon Feb 20, 2023 7:22 am Im quite sure i saw small devices who fix that for rx8...
Yeah, there's this device here: https://cartools.lv/Shop/product_info.p ... cts_id=200
But from the looks of it, it works the other way around: It has a standalone mode to emulate a CEM, but not a standalone mode to emulate the ECM.

Maybe it could still work if this board is used and the "fake ECM" always sends the same reply and then this device fixes the reply?
Might be worth asking in the support forum.
User avatar
bexander
Posts: 834
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 63 times
Been thanked: 89 times

Re: Volvo C30 with Leaf drivetrain

Post by bexander »

The manual for the CEM-3 immo with it's "standalone mode" kind of implies that it is not necessary for the CEM to receive a response from the ECM.

"If JMP2 is open, original messages from CEM are completely dropped and own ones are sent (standalone
mode, “no CEM”). If JMP2 is shorted, original messages issued by CEM are modified to comply with ECU
demands."

Without respons from the ECU the CEM will most likely not allow starter relay or fuel pump to start but I don't need any of that. Will just have to wait and see when I get to that part.
Obviously someone knows the inner worksings of the C30 immo, thats for shure.
User avatar
crasbe
Posts: 234
Joined: Mon Jul 08, 2019 5:18 pm
Location: Germany
Has thanked: 43 times
Been thanked: 97 times

Re: Volvo C30 with Leaf drivetrain

Post by crasbe »

You will probably get the "Immobilizer. See user manual" warning in the DIM when the CEM is unhappy. Maybe you have to intercept the LS-CAN between CEM and DIM to supress the message as a hack.

I'm afraid the guys from cartools won't share their knowledge... that's usually the case.
Someone even took the CEM Pin Hacking stuff and made a product out of it and sells it for a couple of hundred Euros. If there's money to be made, people will try to pursue it.
That's why I want to document everything as publicly as possible :)
Post Reply