Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Retrofitting a car and running it with Elixir

Marc Lainez
June 21, 2024
63

Retrofitting a car and running it with Elixir

Extending a cars' lifespan is not an easy feat. We need to ask ourselves what makes people enjoy a car today and what technology it should include. This talk shares the current state of our journey in retrofitting a car and building a new and open vehicle control system (OVCS), redesigning the engine controller and infotainment systems with off-the-shelf components running with Elixir.

We will explain how we reverse-engineered the proprietary CAN bus messages from the car, how we created our own Raspberry Pi CAN bus hats and how we used Nerves to create firmware for the new electric engine controller and infotainment systems.

Marc Lainez

June 21, 2024
Tweet

Transcript

  1. tÜç=ïÉ=~êÉ 2013: Founded 2017: First Elixir project by Loïc (Elicopter

    Elixirconf EU 2017) 2016-2023: Founded and sold Ibanity (thank you Elixir...) 2024: Sabbatical break, playing around with cars… Marc Loïc Thibault
  2. qÜÉ=éêçÄäÉã Automotive world is closed Car’s average lifespan is 8-12

    years although a lot is still usable/salvageable Aftermarket software support and public doc inexistent (future cybersecurity risk?) Parts from different brands don’t work together (to low compatibility between brands)
  3. ls`p Open vehicle control system Open software and open hardware

    components Abstraction layer for vehicles hardware and software More developer friendly than traditional automotive technologies Allows prototyping and monitoring for vehicle projects
  4. a b p f d k = ` e l

    f ` b p _ r f i a f k d = _ i l ` h p b s b o v q e f k d = q l d b q e b o c r o q e b o = t l o h
  5. omf=Q a b p f d k = ` e

    l f ` b p oQ=jáåáã~ Nothing automotive grade yet… kÉêîÉë
  6. D E S I G N C H O I

    C E S _ r f i a f k d = _ i l ` h p b s b o v q e f k d = q l d b q e b o c r o q e b o = t l o h
  7. Inverter _ r f i a f k d =

    _ i l ` h p Vehicle Management System Motor Charger Controls Controller Contactors Controller Infotainment Battery Management System Anti-lock Braking System Dashboard Ignition Lock Doors Orion CAN OVCS CAN VW Polo CAN Nissan Leaf CAN OVCS components OEM components
  8. sjp The car’s “brains” RPI4 + Nerves Connected to all

    networks Translates and routes messages https://github.com/open-vehicle-control-system/ovcs/tree/main/vms _ r f i a f k d = _ i l ` h p
  9. sjp=J=ãçåáíçêáåÖ Phoenix + Vue.js app for real time monitoring Enable

    throttle pedal calibration Alerts when controllers are not present or defective _ r f i a f k d = _ i l ` h p
  10. sjp=J=ÅÜ~ääÉåÖÉë Testing on hardware is hard... 3D printing can fail…

    Building an Elixir CAN library from scratch _ r f i a f k d = _ i l ` h p
  11. `çããìåáÅ~íáçå=Äìë CAN bus (Controller Area Network) allows to communicate efficiently

    amongst all vehicle components Standard in automotive, ships, planes, machinery and more While CAN is standard, the message payload are not, and almost never documented by manufacturers _ r f i a f k d = _ i l ` h p
  12. `çããìåáÅ~íáçå=Äìë Sending and receiving data over CAN is not the

    same as using a REST API Data is just a set of bits Frames are broadcasted to all module and continuously _ r f i a f k d = _ i l ` h p
  13. `~åí~ëíáÅ Based on a declarative YAML file, Cantastic allows you

    to emit and receive frames in a convenient way. _ r f i a f k d = _ i l ` h p https://github.com/open-vehicle-control-system/cantastic
  14. `çåíêçääÉêë “Dumb” logic, rely on VMS decisions for safety Connects

    to CAN with SPI module (mcp2515) Used to enhance existing capabilities with CAN (analog pedal, fuel gauge, ...) https://github.com/open-vehicle-control-system/ovcs/tree/main/controllers _ r f i a f k d = _ i l ` h p Gear selector
  15. `çåíêçääÉêë=J=ÅÜ~ääÉåÖÉë Large relays interfered with Arduino and crashed them Using

    ethernet cables instead of real CAN cables was unreliable Bad USB cables (not enough power when using mcp2515) Relay hat conflicting with SPI pin Next: look for automotive grade alternative _ r f i a f k d = _ i l ` h p
  16. fåÑçí~áåãÉåí Connected to OVCS and Car drive CAN Running WPEWebkit

    in Kiosk mode 3D printed enclosure that fits in the car’s radio bay _ r f i a f k d = _ i l ` h p https://github.com/open-vehicle-control-system/ovcs/tree/main/infotainment
  17. fåÑçí~áåãÉåí=J=ÅÜ~ääÉåÖÉë Making it work in kiosk mode • Lots of

    buildroot tinkering • Slow WPEWepkit compile time Still some intermittent issues with the Direct Rendering Manager and Wayland on RPI4 at boot time Next: try standard minimal Debian with live-build _ r f i a f k d = _ i l ` h p
  18. D E S I G N C H O I

    C E S B U I L D I N G B L O C K S b s b o v q e f k d = q l d b q e b o c r o q e b o = t l o h
  19. ls`pN=cê~åâÉåÅ~ê 2007 Polo Bluemotion H b s b ov q

    e f k d = q l d b q e b o EM57 2013 Nissan Leaf Motor
  20. jÉÅÜ~åáÅ~ä=ïçêâ b s b ov q e f k d

    = q l d b q e b o Welded new motor support CNC cut and welded aluminum connection plates Fabricated custom junction between motor and gearbox
  21. mêçíçíóéÉ=Äç~êÇ b s b ov q e f k d

    = q l d b q e b o Vehicle Management System Car controls controller Contactors controller And lots of wires…
  22. D E S I G N C H O I

    C E S B U I L D I N G B L O C K S E V E R Y T H I N G T O G E T H E R c r o q e b o = t l o h
  23. kÉñí=ëíÉéë Connect batteries and Battery Management System Test the car

    in a controlled environment Add redundancy to VMS Use automotive grade components? Self-driving in Elixir? c r o q e b o = t l o h