A DIY CanZE dongle, part 2. Geek talk.

We might have ironed out most issues with the DIY dongle. If there are people willing to build an ESP32 based dongle, especially if they own a Q90, R90, or R110 model, we would like to hear about it. Requirements would be:

  • Preferably drive one of the above models.
  • Willing and able to build a dongle, which requires ordering stuff through Aliexpress or ebay HK, basic solderinig skills, and either some basic knowledge of using PlatformIO with Atom (or VSCode) with git, or the abilty to upload binaries to an ESP32 development board from the command line.
  • Fool around with it, and be willing to cycle quickly though different updates of CanZE or the ESP32 code.

Climate computer loosing it’s mind revisited!

Remember this post? Well today SpeakEV user StinkyPete posted a detailed sequence of events how to trigger it and what firmware version has it fixed. I will repeat here only his short version.

  • Set the car to pre-condition at a specific time (requiring the car to be plugged in)
  • Allow the pre-condition cycle to fully complete
  • Sometime later, use the key fob to initiate a pre-condition
  • Firmware version of the CLIMA system: 0803 or lower, figured by user Tooney

In this post a general description of the heating system.

A DIY CanZE dongle

The KonnWEI dongles are, though the most stable in terms of what you get when you buy, not the best to run CanZE with, especially when fast performance is required. Think like the Driving, Braking and Consumption screens. For the technically inclined: this is because these type of dongles are designed to query, in their own pace, car computers using the ISO-TP protocol, where we had to misuse them to also intercept the raw, operational data. Most of that data can also be obtained through ISO-TP, but again, it would have been slow and we would have to do a lot of reverse engineering to make that work.

And then of course there are a ton of dongles that don’t work at all as they have severely stripped functionality.

With the availability of cheap ESP32 micro-controllers, that can do CAN, WiFi and Bluetooth, time had come to finally build our own hardware. In the next posts, I will describe the hardware, the software and the testing. For now suffice to say that we have something working over Bluetooth, with an unmodified CanZE instance on Android, for under 20 euros hardware, and it is blazing fast.

For those who want to follow in our footsteps and want to build their own dongle, let me start with a shopping list. Especially useful if you order on AliExpress!

  • ESP-32 development board. Maybe something like this.
  • CANbus transceiver board. Needs to be 3.3 volt, so for instance this.
  • Some sort of housing / SAE J1962 (“OBD2”) connector. My advice would be to buy the cheapest dongle you can get and gut it. You should be able to do that for under 3 euros.
  • A small 12 to 5 volt converter. While the ESP development board can take 12 volt, that is a maximum and I wouldn’t advice to run it on the car’s 13.5 volt. Example.
  • Some veroboard, wire, and other generic craft and soldering stuff.

Stay tuned!

Defective key card – again

This is a re-post of what I wrote on SpeakEV a few days back.

The battery in my key card had failed. Note that in the “non-keyless” version, the car does not warn you about that. I removed the mechanical key from the key card and put it in the lock. Turning it, the ring arch, acting as a lever snapped off. You can still see the original crack in the picture below. The arch is made from a hard rubbery material and it had obviously weakened over time. Glue was no option. The material is not very suited for it and anyway the levered forces on that tiny surface area would be way too high.

What I decided to do is first glue it with super glue to ensure it’s original shape. Then I used pieces of small black nylon tie rib to reinforce the arch. Using a hairdryer I bent one piece to follow the inside curve (where the key ring pulls), then glued it in with two component resin. I repeated that for the (flat) bottom part, filling up as much cavity space where I could. For extra strength I also put a third strip over the slightly curved top of the arch, diverting even more force from the original crack. I let it harden and then used a power file to grind away excess resin and sharp ends of the strips. Finally, I touched it up with some black permanent marker. I expect the nylon to last forever, the metal key ring will not shave that off soon.

Bottom line is: when using the mechanical key, tread very lightly. Also, do check the integrity of the arch part of your card. If in doubt, you might want to do something about it. I did with SWMBO’s key.

Charging currents (three phase)

Before we start two things: I made a significant error about ripple current in the previous post, corrected now. Also, we have a lot less data for three phase operation, so this post is more speculative. If you think I made significant errors, please comment. Before going on, I assume you’ve read at least the post Charger Design.

Theory: Consider the following set of graphs, the first one representing the voltage between each of the phase lines (La, Lb, Lc) and Neutral (N).

The output voltage Vdc of a three-phase full-wave rectifier as shown in that post looks like the second graph. Side note: The 0 potential in the upper graph (the N line) is very much not on the same potential as the 0 in the middle graph, which represents the minus output of the rectifier. For a 400 volt line to line system, the average Vdc will be almost 540 volt, peaking 562 and bottoming 487.

Assuming for the moment a simple resistive load on that Vdc, the input current on the wire of phase A Ila will look like the third graph. So there we have it. It looks “somewhat sinusoidal”, but there will be quite a few harmonics in that current. But we can imagine this waveform a bit smoothed out by the filter contraption of the charger.

I have exactly one voltage-current graph of a ZOE charging in 3 phase operation. It is for a Q model on an 11 kW (3 x 16 A) charger, but the battery was already quite full, so it is running on a lower current.

Looks familiar? Some phase shift and smoothing by the filter and that’s it. Just like with the single phase charging, the phase shift is noticeable because of the relatively low charge current. The dips in the middle of the tops are quite noticeable. The current can’t be shaped like the the line voltage simply because in a three-phase full-bridge rectifier, 1/3rd of the time a wire simply can’t provide current. For the remaining 2/3rd, the charger seems to simply follow the voltage curve of the raw DC output, just like it does when running in single phase mode.

A good article about rectifying 3 phases can be found here.

Only slightly related: I received power intake graphs from both a Q210 and an R240 when throttling down. It seems the Q model steps down in roughly 600 Watt steps, while the R model uses smaller 300 Watt steps.

Charging currents (single phase)

After the startup sequence described in the previous posts it is now time to move on to the actual charging. Again, all the measurements come from SpeakEV user ElectricBeagle and tons of valuable info has come from user arg. If you want to check out the discussion that lead to all of this, here it is.

Let’s set the stage first. We assume single phase charging, the earth check has been performed, the mains has already been connected and, since it’s single phase charging, the relay between N and L3 has already closed. More about that later. Charging has started and as shown in the previous post, the current has ramped up to the desired level. The ramping is gradual, taking about one second.

The rather massive 100 uF capacitor is now creating that 6 A reactive current. It’s sole purpose seems to be to dampen the huge current spikes created by the switch mode power supply. Note that the capacitors are rated for 63 A. The worsening power factor is simply a side effect of that. However, at 16 A, the PF is already above 0.9, so no worries. Bottom line is: at decent currents, say at or above 16 A, the power factor is great and they do clever things with the switching to follow the voltage, see next picture, taken at a current setting of 30 A, with a very small resistor in the N line to measure current without phase shift.

At significantly lower power levels things worsen very quickly. For instance an off grid PV inverter would need to be very potent in coping with that reactive power. But I digress. Because what you really want to know is the effect of the switching. So let’s zoom in on the raggedness of the current curve.

What I wrote here before was way off, as arg argued in private…….An earlier picture suggests that the current coil produces roughly 1 volt peak-to-peak per 4 A wire current (RMS). That suggests a 10 kHz ripple current of just over 200 mA RMS. On a 10 A charge current that is give or take 2%. But this measurement was done with a current coil on the L wire at 16 A, while the previous picture was done with a resistor in N, at 30 A. I suspect the current coil is quite frequency dependent. Going back one picture, one-and-a half-dot ripple on a 26 dot amplitude is roughly 6%. At least ball park same.

Another interesting thing to look at is earth leakage, given the relatively high capacitance between the stator coils and the motor housing. One “blob” is a half-cycle, lasting 10 ms. The pattern is pretty symetrical, with a small (about 6 dots) peak to peak 50 Hz component, and a decent (about 15 dots) 10 Khz signal. The scale is 30mA/div. My rough estimate is that the 50 Hz component is 13 mA RMS and the 10 kHz part a bit above 30 mA RMS. Note that a consumer grade RCD will trip at 30 mA but as arg argued, it should not care too much about the higher frequencies (though old ones may!). All in all the stray capacitance to earth seems to be about 2nF. Note that the leakage current should not go significantly up with power, as it’s a capacitive coupling.

And this is the reason why ZOE sings. Ramping up the frequency further would progressively increase leak current up to the point where dedicated, uncompromised coils would be needed, adding quite a bit of weight if one would want to do 22 or 43 kW rectifying.

All in all I would say: not too bad really! The only thing I am not really sure about is what is meant with HF and EHF frequency in the leak currents the car can report. I always assumed 150 Hz (3rd harmonics) and 10 kHz (the switching frequency), but I am not 100% sure. If anyone knows or suspects more, I’d love to know.

Oh and about the single phase relay. It can’t close before the chargepoint contactor is closed, because as long as it is open, the car doesn’t know if the chargepoint is single or three phase. However, assuming no contactor in the filter module (and I haven’t found any in the pictures of the filter and charging module), once power is switched on and it is single phase, the capacitor between L3 and N is idle, so it’s no problem to bridge it with a relay at that moment in time.

Charger startup sequence – the measurements

This is a companion to the previous post. All measurements are done by SpeakEV user ElectricBeagle. They are all done using either a granny cable set to 10 amps or a decent chargepoint set to 30 amps.


Here is the current when plugging in, measured using a current coil on the L wire. It doesn’t show the phase angle but all current is reactive as it creates by the filter capacitors.The stable, reactive current is about 6A RMS, close to 10A peak. Note that the spike occurs when the reactive current would be about zero, so the actual plug voltage would be at it’s maximum, creating the maximum spike current. It’s roughly 40 amps and lasts about 1 ms.

Ignore the lower curve. The upper trace is measured using a resistor in the PE wire. You can clearly see the two measurement pulses. They are roughly 20 mA and last 1ms.

This is a slow trace of the L current, measured again using the current coil. It shows the spike and reactive current. After about 3 seconds the charger kicks in and does  gradual current ramp up to about 13A lead current. That is about 12A real current.

Charger startup sequence

We’ve had somewhat of a blank spot when it comes to the start of a charging session. Understanding it well can help diagnosing why the car might refuse. SpeakEV user ElecticBeagle bit the bullet and started measuring currents in all the leads to find out what is going on. For brevity, I assume that the cable is in and locked, connecting protective earth [PE] to the car’s chassis, and everything to activate the chargepoint is done. The main contactor in the chargepoint is about to close.

  • The main contactor is closed in the chargepoint. This usually creates a significant current spike in the lead(s) as all L lines have a 100 uF capacitor to N, see the blue box in the third picture of this post. Correction: pretty sure now the capacitors are in a delta configuration, not a star.
  • Car allows for dampening out ringing for a second or two. Note that because of the capacitors, a significant though reactive current (6A per lead) is drawn. This is, ignoring some losses, not a power uptake.
  • The car injects two 20 mA pulses between PE  and N in both polarities to measure earth resistance. If the resulting voltage exceeds 4 V, meaning an earth resistance of more than 200 ohms, the charge point is rejected. *)
  • The car ramps up power uptake from 0 to the requested power in about one second. It’s very gradual, which is also notable in the ramp up of the “whine”.

Maybe you remember fairy tales about > 500 A startup currents by the ZOE, usually told by chargepoint mechanics. Well, this is what it is, a 100 uF capacitive load. Because of lead resistance and filter coils, inrush is actually limited and the spikes are 30 – 50 amps and last about one ms. This is no big deal whatsoever and any notion that this is problematic can be dismissed.

Now there are other tests done such as lead voltage and earth leak current, but these test can not be detected, though they should be pretty straight forward. I read of one driver seeing it’s car still charge on 180 V from an off grid PV system. I don’t know if the car would actually start a session this low.

I am now tempted to build myself an Arduino based earth tester using the same principle as have an extra diagnostic tool. For the Netherlands though, this is hardly worth the effort as most, if not all chargepoints are connected using decent earthing.

I’ll write in another post about the currents while charging.

*) Entire books have been written about safe earthing of power distribution networks. For the technically inclined Dutchies (or the ones who can bear Google Translate), this is such a book, link to the relevant part. I will only say here that ZOE of course is unable to have a true earth reference. So she assumes a network where N and PE are actually connected. In modern TS-C-N networks this should always be the case. In TT networks, where earth is provided with a local earth rod, things might not work out that way, let alone floating or midpoint-earthed networks. These are dying breeds but still all over Europe, especially in the more rural areas.

Defective key card

The key card of my ZOE was slowly giving me trouble (not the keyless entry one BTW, it’s a simple ZOE Life).

It was slightly iffy for a few weeks, but nothing that a bang couldn’t fix. However yesterday I could almost not start her while away from home. As significant other has another good working card, I decided it was worth to give it a tinker treatment. Unfortunately it is friction welded together and carefully cutting it open along the sides was not enough. Unreasonable force (for the initiated, bigclive.com) using spudger and chisel was to be applied.

Remote control antenna and chip is top left, transponder for the slot top right. It’s a flat, probably ferrite brittle core, with hair-thin exposed copper wire wound around it. That thing had come off. The problem probably was a somewhat dry solder joint that had gone bad under regular stress and making an iffy contact. I assume it broke off completely under said unreasonable force. Long story short, I soldered it back on the PCB using leaded solder and put it back together. For now with Scotch tape to make sure it works again, which it seems to do indeed. I will carefully glue it shut again if it keeps up a few more days.

Bottom line: if you decide to open this thing up, be very careful when cutting around that coil area, and be prepared to use quite a bit of close-to-destructive force just below the open/close button pair and around the coin cell area, all to be applied carefully with a blunt chisel tool not to kill the thing. At least you now have a layout.

Mesmerizing video of the R motor production (and more)

Top