<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet href="/blog/templates/default/atom.css" type="text/css" ?>

<feed 
   xmlns="http://www.w3.org/2005/Atom"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/">
    <link href="http://carrott.org/blog/feeds/atom.xml" rel="self" title="emini" type="application/atom+xml" />
    <link href="https://carrott.org:443/blog/"                        rel="alternate"    title="emini" type="text/html" />
    <link href="https://carrott.org:443/blog/rss.php?version=2.0"     rel="alternate"    title="emini" type="application/rss+xml" />
    <title type="html">emini</title>
    <subtitle type="html"></subtitle>
    <icon>https://carrott.org:443/blog/templates/default/img/s9y_banner_small.png</icon>
    <id>https://carrott.org:443/blog/</id>
    <updated>2017-03-12T18:11:30Z</updated>
    <generator uri="http://www.s9y.org/" version="1.5.3-2">Serendipity 1.5.3-2 - http://www.s9y.org/</generator>
    <dc:language>en</dc:language>
    <admin:errorReportsTo rdf:resource="mailto:tom@carrott.org" />

    <entry>
        <link href="https://carrott.org:443/blog/archives/159-Nissan-Leaf-CAN-Bus-Man-In-The-Middle.html" rel="alternate" title="Nissan Leaf CAN Bus Man In The Middle" />
        <author>
            <name>carrott</name>
            <email>tom@carrott.org</email>        </author>
    
        <published>2017-03-12T10:26:17Z</published>
        <updated>2017-03-12T18:11:30Z</updated>
        <wfw:comment>https://carrott.org:443/blog/wfwcomment.php?cid=159</wfw:comment>
    
        <wfw:commentRss>https://carrott.org:443/blog/rss.php?version=atom1.0&amp;type=comments&amp;cid=159</wfw:commentRss>
    
            <category scheme="https://carrott.org:443/blog/categories/2-Battery-Management-System" label="Battery Management System" term="Battery Management System" />
    
        <id>https://carrott.org:443/blog/archives/159-guid.html</id>
        <title type="html">Nissan Leaf CAN Bus Man In The Middle</title>
        <content type="xhtml" xml:base="https://carrott.org:443/blog/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>I wrote a man in the middle for the leaf battery communication. It uses <a href="https://github.com/caran/can4python">can4python</a> and <a href="http://kayak.2codeornot2code.org/">Kayak's</a> <a href="https://github.com/julietkilo/kcd">kcd format</a> to describe the signals. It probably only works on Linux. Source code is here <a href="https://carrott.org/git/leaf-can-utils.git">https://carrott.org/git/leaf-can-utils.git</a></p>

<p>It decodes all the messages received on one interface (from the battery) into signals, lets me change their values, and then re-encodes them back into the can bus format, recalculates the new checksum when necessary and sends them out the other interface (to the car). It displays each signal and the received and sent signals:

<pre>
                                                     Hexadecimal    Decimal
                                                       In   Out     In    Out
                                      1db Checksum:  007e  007e    126    126
                                       1db Counter:  0002  0002      2      2
                                      1dc Checksum:  005d  005d     93     93
                                      55b Checksum:  007e  00dc    126    220
                                           5bc 2_2:  0002  0002      2      2
                                     Capacity Bars:  000a  000a     10     10
        Li-ion battery available charge signal (%):  0040  0040     64     64
              Li-ion battery capacity signal (GID):  0074  0074    116    116
                     Li-ion battery current signal: -0001 -0001     -1     -1
      Li-ion battery gradual capacity loss signal?:  0068  0068    104    104
                     Li-ion battery voltage signal:  017f  017f    383    383
                                       Temperature:  007e  007e    126    126
                                       Wheel Speed:  0000  0000      0      0
                                          _1db 1_2:    00    00      0      0
                                          _1db 3_2:    2a    2a     42     42
                                            _1db 4:    00    00      0      0
                                            _1db 5:    00    00      0      0
                                            _1dc 0:    6e    6e    110    110
                                            _1dc 1:    04    04      4      4
                                            _1dc 2:    df    df    223    223
                                            _1dc 3:    fd    fd    253    253
                                            _1dc 4:    04    04      4      4
                                            _1dc 5:    d8    d8    216    216
                                            _1dc 6:    c6    c6    198    198
                                          _55b 1_2:    00    00      0      0
                                            _55b 2:    aa    aa    170    170
                                            _55b 3:    00    00      0      0
                                            _55b 4:    e0    e0    224    224
                                            _55b 5:    00    00      0      0
                                            _55b 6:    10    10     16     16
                                          _5bc 1_2:    03    03      3      3
                                            _5bc 3:    3f    3f     63     63
                                          _5bc 4_1:    09    09      9      9
                                            _5bc 5:    05    05      5      5
                                            _5bc 6:    40    40     64     64
                                            _5bc 7:    5a    5a     90     90
                                       _5bc Mux_02:    07    07      7      7
                                            _5c0 3:    00    00      0      0
                                            _5c0 6:    00    00      0      0
                                            _5c0 7:    02    02      2      2
                                     _5c0 Mux_1_40:    7e    7e    126    126
                                     _5c0 Mux_1_80:    7e    7e    126    126
                                     _5c0 Mux_1_c0:    7e    7e    126    126
                                     _5c0 Mux_2_80:    7e    7e    126    126
                                     _5c0 Mux_2_c0:    7e    7e    126    126
                                     _5c0 Mux_5_40:    6c    6c    108    108
                                     _5c0 Mux_5_80:    d0    d0    208    208
                                     _5c0 Mux_5_c0:    c4    c4    196    196
</pre>

<p>Yesterday I spent some time testing it on a Gen 1 leaf at <a href="https://bluecars.nz">Blue Cars</a></p>

<p>We cut the can bus wires inside the battery box, just after they go through the water proof connector to the outside and connected about 1 metre of thin figure 8 wire to each side of the cut. This let us access the bus on the car and the bus on the battery while the battery was plugged in under the car. It's possible to get enough slack in the internal battery loom to feed the connector all the way through the machined hole and make room for some extra wires to pass through. This is obviously only suitable for testing as the battery is no longer waterproof, but let us fasten the lid onto the battery before sliding it back under the car and lifting it up to meet the cables below the car.</p>

<p>With the two pairs connected together, the car behaved normally, going into ready and spinning the wheels.</p>

<p>The BMS module terminates the bus so we connected a termination resistor to the car side of the cut and used termination on the CAN interface talking to the battery. We plugged the other end of the man in the middle to the OBD2 port and didn't use termination.</p>

<p>The MitM just worked!</p>

<p>The car is very tolerant of errors on the CAN bus. You can stop the battery messages and it goes into turtle mode and all the battery info disappears off the instrument cluster. When you re-start the battery messages it goes back to normal mode and the battery info reappears. Start-up is quite critical, if you don't let the battery send it's start up messages the car doesn't go into ready mode. The car never shut down or went into a permanent turtle mode while I was messing with data on the bus -- it always went back to normal mode if I restored the unmodified message flow from the BMS. I modified the data in nearly every field to see what would happen.</p>

<p>The car will go into ready and turn the wheels even when it cannot send messages to the battery. This means the startup sequence doesn't involve a car to battery handshake, even if the car is expecting some startup messages from the battery within a time window. The "check engine" light comes on and it does record some DTCs:
<ul>
<li>P3180 VCM detects an error signal that is received from LBC via CAN communication for 0.02 seconds or more.</li>
<li>P3183 After a lapse of 0.3 seconds from M/C RELAY ON, the following state remains for 2.8 seconds or more: LBC's calculation result to the VCM-set example question is incorrect.</li>
</ul></p>

<p>My MitM only works in one direction (from the battery to the car) and it turns out my CAN bus setup wouldn't let two programs play together, so when I started a CAN repeater (candump -b) to copy data from the car to the battery I got corrupted frames and no buffer space errors. I'm going to make the MitM work in both directions to resolve this.</p>

<p>If you play a different car's battery messages into this car, it does not go into ready. I didn't spend much time on this and I didn't write code to start the BMS messages at the right time, I just started playing the recording of a running BMS and switched the car on. One experiment that I should have tried was to start the car with it's real battery and then switch to messages recorded from a different car. There are some new DTCs when you try to start a the car while playing messages recorded from another car including

<ul>
<li>P3102 Li-ion Battery ID Registration must be performed if the Li-ion battery controller or VCM is replaced.</li>
</ul></p>

<p>The next experiment is to swap in a BMS module from another car.</p>

<p>I figured out some more of the BMS protocol by messing with the data and seeing how the car reacted.</p>

<p>The Fuel Gauge display on the instrument cluster is powered by the GIDs signal (the first 10 bits of 0x5BC), not the state of charge signal (first 10 bits of 0x55B). I guess it knows how many GIDS is "full" because the battery will have fewer gids and still read full as it ages.</p>

<p>0x5BC bits 36-39 (ie the high nibble of the 5th byte) somehow effects the Fuel Gauge, lower numbers mean more bars, all other things being the same. Maybe this is used to calculate how many GIDs each bar is worth? I haven't explored this.</p>

<p>The battery capacity gauge (the bars outside the fuel gauge) is controlled by a muxed field, when 0x5BC bits 32-35 (ie the low nibble of the 5th byte) is 0x3, 0x5BC bits 16-19 (ie the low nibble of the 3rd byte) contains the capacity bars. I haven't yet used the mux field support in the kcd format to express this -- can4python doesn't support it so I had to hand code it. The cluster does not remember the capacity -- changing this value directly manipulates the number of bars displayed, the value on the can bus is literally the number of bars (0x0 -> no bars, 0xC -> 12 bars).</p>

<p>The indicated temperature on the instrument cluster is controlled by another muxed field, when 0x5C0 is 0x40, the indicated temperature is controlled by the 3rd byte of 0x5C0. This mux has 3 values, on this car all 3 are similar in the 3rd byte, but only the when the mux is 0x40 does the 3rd byte control the temperature in the instrument cluster.</p>

<p>Many thanks to Carl at <a href="https://bluecars.nz">Blue Cars</a> for letting me torture his car and Bill &amp; Ed for assisting.</p>  
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="https://carrott.org:443/blog/archives/158-OVMS-Nissan-Leaf-Remote-Climate-Control.html" rel="alternate" title="OVMS Nissan Leaf Remote Climate Control" />
        <author>
            <name>carrott</name>
            <email>tom@carrott.org</email>        </author>
    
        <published>2016-06-03T09:16:35Z</published>
        <updated>2016-06-03T11:05:19Z</updated>
        <wfw:comment>https://carrott.org:443/blog/wfwcomment.php?cid=158</wfw:comment>
    
        <wfw:commentRss>https://carrott.org:443/blog/rss.php?version=atom1.0&amp;type=comments&amp;cid=158</wfw:commentRss>
    
            <category scheme="https://carrott.org:443/blog/categories/1-Electric" label="Electric" term="Electric" />
    
        <id>https://carrott.org:443/blog/archives/158-guid.html</id>
        <title type="html">OVMS Nissan Leaf Remote Climate Control</title>
        <content type="xhtml" xml:base="https://carrott.org:443/blog/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>I've added remote climate control support in the Nissan Leaf <a href="http://openvehicles.com/">OVMS</a> firmware. This is relatively straightforward because Nissan built this feature into the Leaf's CARWINGS package. In New Zealand CARWINGS wasn't sold with the Leaf and Japanese import Leaves have a Japanese cell phone which doesn't work in New Zealand. Making it work here means emulating the function of the TCU module. On a Gen 2 Leaf this is simple, send a CAN bus frame to wake the car up and another frame to tell it to turn on or off the climate control, or start charging.</p>

<p>The Gen 1 Leaf is a little more complicated. The TCU wakes up the car by applying 12v to a wire, telling the VCU to wake up. After the VCU wakes up, the TCU sends the same command message as on the Gen 2 car. The OVMS hardware doesn't have an external 12V GPIO so I had to make something. I had a small relay lying around and using that was easier than building a 12v protected output. I glued a drive transistor on one side of the expansion port and the relay to the cell phone module. The LED catches the relay's turn off spike but any diode would do.</p>

<div class="serendipity_imageComment_center" style="width: 800px"><div class="serendipity_imageComment_img"><!-- s9ymdb:254 --><img class="serendipity_image_center" width="800" height="583"  src="https://carrott.org:443/blog/uploads/2016/ovms-leaf-gen1-remote-wakeup.jpg"  alt="OVMS Module with modification to wake up Gen 1 Nissan Leaf" /></div><div class="serendipity_imageComment_txt">OVMS Module with modification to wake up Gen 1 Nissan Leaf</div></div>

<p>I used the previously unconnected Ring Indicate pin on the DIAG serial port to get the 12V signal out of the OVMS. RI is a good pin because it's an output from the OVMS and it is intended to tell the host the phone is ringing which matches up well with the "hey something important is happening, pay attention" use here. RS232 uses +12v signaling so a normal serial device will still be ok to plug into the port. The wire from the relay goes through one of the mounting holes for the serial port to access the pins on the back side of the circuit board, this avoids fouling the case which is pretty tight on all sides of the circuit board.</p>

<p>I've disconnected Nissan's TCU and stuffed a wire into it's plug to connect the OVMS to the Leaf's wiring loom. Nothing has complained about the disconnected TCU that I can see.</p>

<p>I'll post a schematic shortly.</p>

<p>Remote climate control is great, you can press a button on the OVMS cell phone app to get the car headed to toasty warm or cooled down before you get to it. If it's not plugged in then you get 15 minutes of cooling or heating, and more if it is plugged in. You can't control what the climate control does, Nissan have hard coded it to target 25C which is likely to cool the cabin in the summer and certainly heats it in the winter. Nissan have programmed the remote climate control to use recirculated air so in winter the windows are usually fogged up. I don't think there is anything I can do about that but the windscreen button once you're in the car doesn't take long to clear it.</p>  
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="https://carrott.org:443/blog/archives/157-Speedometer-Scaling.html" rel="alternate" title="Speedometer Scaling" />
        <author>
            <name>carrott</name>
            <email>tom@carrott.org</email>        </author>
    
        <published>2015-02-03T06:47:53Z</published>
        <updated>2015-02-03T07:24:34Z</updated>
        <wfw:comment>https://carrott.org:443/blog/wfwcomment.php?cid=157</wfw:comment>
    
        <wfw:commentRss>https://carrott.org:443/blog/rss.php?version=atom1.0&amp;type=comments&amp;cid=157</wfw:commentRss>
    
            <category scheme="https://carrott.org:443/blog/categories/4-Fabrication" label="Fabrication" term="Fabrication" />
    
        <id>https://carrott.org:443/blog/archives/157-guid.html</id>
        <title type="html">Speedometer Scaling</title>
        <content type="xhtml" xml:base="https://carrott.org:443/blog/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>I've <a href="https://carrott.org:443/blog/archives/156-Speedometer-Adaptor-Progress.html">replaced</a> the Mini's mechanical speedometer with an <a href="/emini/Mitsubishi_FTO_Speedometer">electronic unit from a Mitsubishi FTO</a>. This speedometer requires 2548 pulses per km, but my motor controller outputs a 7031 pulses per km. I need to make a box that outputs 1 pulse for every 2.764 input pulses. I made a <a href="/git/speedo_scaler.git/tree">fairly naive 2.75:1 implementation</a> in an arduino by outputting one pulse for every 3 input pulses except every 4th pulse, where it only waits for 2 input pulses. This jitter doesn't seem to affect the speedo needle even at fairly low speeds.</p>

<p>The current implementation counts to 11 and uses a switch statement to output pulses which isn't really generalizable to other ratios but is probably close enough to what I need.</p>  
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="https://carrott.org:443/blog/archives/156-Speedometer-Adaptor-Progress.html" rel="alternate" title="Speedometer Adaptor Progress" />
        <author>
            <name>carrott</name>
            <email>tom@carrott.org</email>        </author>
    
        <published>2015-01-30T20:08:44Z</published>
        <updated>2015-01-30T20:40:09Z</updated>
        <wfw:comment>https://carrott.org:443/blog/wfwcomment.php?cid=156</wfw:comment>
    
        <wfw:commentRss>https://carrott.org:443/blog/rss.php?version=atom1.0&amp;type=comments&amp;cid=156</wfw:commentRss>
    
            <category scheme="https://carrott.org:443/blog/categories/4-Fabrication" label="Fabrication" term="Fabrication" />
    
        <id>https://carrott.org:443/blog/archives/156-guid.html</id>
        <title type="html">Speedometer Adaptor Progress</title>
        <content type="xhtml" xml:base="https://carrott.org:443/blog/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <!-- s9ymdb:248 --><img class="serendipity_image_center" width="800" height="280"  src="https://carrott.org:443/blog/uploads/2015/speedo-adaptor-parts.jpg"  alt="Speedo Adaptor Parts" /><br />
I printed a 3 part adaptor to mount the Mitisubishi FTO speedometer inside the mini instrument cluster. I printed them in PET-G which hopefully won't soften in the sun -- it's apparently good for 75°C so that does seem unlikely. I must thank Daniel Dillan at <a href="http://www.vivenda.co.nz">www.vivenda.co.nz</a> for suggesting PET-G and advice on getting good results with it (print it hotter and slower than PLA).<br />
<!-- s9ymdb:249 --><img class="serendipity_image_center" width="800" height="533"  src="https://carrott.org:443/blog/uploads/2015/speedo-adaptor-prototypes.jpg"  alt="Speedo Adaptor Prototypes" /><br />
I'm not entirely sure why I needed so many prototypes. Good thing I have my own printer.<br />
<!-- s9ymdb:250 --><img class="serendipity_image_center" width="800" height="533"  src="https://carrott.org:443/blog/uploads/2015/speedo-adaptor-1.jpg"  alt="First Adaptor on Speedo" /><br />
<!-- s9ymdb:251 --><img class="serendipity_image_center" width="800" height="533"  src="https://carrott.org:443/blog/uploads/2015/speedo-adaptor-2.jpg"  alt="Second Adaptor on Speedo" /><br />
<!-- s9ymdb:252 --><img class="serendipity_image_center" width="800" height="533"  src="https://carrott.org:443/blog/uploads/2015/speedo-adaptor-3.jpg"  alt="Speedo installed in instrument cluster (back)" /><br />
<!-- s9ymdb:253 --><img class="serendipity_image_center" width="800" height="533"  src="https://carrott.org:443/blog/uploads/2015/speedo-adaptor-4.jpg"  alt="Speedo installed in instrument cluster (front)" /><br />
I now need to create an appropriate speed pulse signal from the inverter. Initial investigation suggests I cannot configure it to make less than 6000 pulses per kilometre, which is a little more than double what the speedometer expects. A simple arduino sketch will fix that.  
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="https://carrott.org:443/blog/archives/155-Speedometer-Reverse-Engineering.html" rel="alternate" title="Speedometer Reverse Engineering" />
        <author>
            <name>carrott</name>
            <email>tom@carrott.org</email>        </author>
    
        <published>2015-01-02T23:34:35Z</published>
        <updated>2015-01-30T20:42:16Z</updated>
        <wfw:comment>https://carrott.org:443/blog/wfwcomment.php?cid=155</wfw:comment>
    
        <wfw:commentRss>https://carrott.org:443/blog/rss.php?version=atom1.0&amp;type=comments&amp;cid=155</wfw:commentRss>
    
            <category scheme="https://carrott.org:443/blog/categories/4-Fabrication" label="Fabrication" term="Fabrication" />
    
        <id>https://carrott.org:443/blog/archives/155-guid.html</id>
        <title type="html">Speedometer Reverse Engineering</title>
        <content type="xhtml" xml:base="https://carrott.org:443/blog/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <!-- s9ymdb:247 --><img class="serendipity_image_center" width="800" height="658"  src="https://carrott.org:443/blog/uploads/2015/eeprom-sniffing.jpg"  alt="Mitsubishi FTO Odometer EEPROM" />

<p>I reverse engineered the data stored in my <a href="https://carrott.org/emini/Mitsubishi_FTO_Speedometer">Mitsubishi FTO Speedometer</a> in order to re-calibrate it to suit the Mini face. Both faces show 180km/h, but the mini face spreads it over a slightly wider angle than the FTO does. The data is stored in an OKI 16811G 128 byte Serial EEPROM. This is quite an old part which uses Microwire (a predecessor and subset of SPI) to communicate. I had some trouble finding the data sheet for this part so I tried to sniff the communications between the odometer's CPU and the EEPROM with an Arduino running <a href="https://github.com/gillham/logic_analyzer">gillham's SUMP compatible firmware</a>. Unfortunately the Arduino only has 2k of ram so recording all the state changes wouldn't fit. The communication is clocked at about 1MHz and I wasn't able to write a parser fast enough to stay in sync.</p>

<p>There is a fair amount of questionable information about odometer EEPROMs on the Internet, mostly related to tools for sale to wind your odometer back. One of these references claimed the part was compatible with a 93C46 so I wrote an EEPROM reader for that part and read out the data. Unfortunately this wiped the EEPROM! Somehow my reader code triggered the erase all command. This isn't entirely surprising because the <a href="http://images.ihscontent.net/vipimages/VipMasterIC/IC/OKIS/OKISD005/OKISD005-747.pdf">right data sheet</a> shows this EEPROM uses a different protocol to that used in the 93C46.</p>

<p>With a wiped EEPROM the odometer stop working, so I had to get another one. I also got an <a href="http://dangerousprototypes.com/docs/Open_Bench_Logic_Sniffer">Open Bench Logic Sniffer</a> which let me observe the entire communication between the odometer and the EEPROM and confirm that the protocol in the correct data sheet was the protocol actually in use. While re-scaling the speedometer for the new face I also reverse engineered the stored kilometre value and re-set the odometer to zero to celebrate the conversion to electric power. I also made some <a href="https://carrott.org/emini/Mitsubishi_FTO_Speedometer">somewhat comprehensible notes</a> about how this data is stored, an <a href="https://carrott.org/git/eeprom_sniffer.git">Arduino sketch to read and write the EEPROM</a> which includes some tools to re-format the data, and an <a href="https://carrott.org/git/speedo_test.git">Arduino sketch to test an electronic speedometer</a> and find the number of pulses per km.</p>  
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="https://carrott.org:443/blog/archives/154-Speedometer.html" rel="alternate" title="Speedometer" />
        <author>
            <name>carrott</name>
            <email>tom@carrott.org</email>        </author>
    
        <published>2014-04-29T08:59:12Z</published>
        <updated>2014-04-29T10:38:41Z</updated>
        <wfw:comment>https://carrott.org:443/blog/wfwcomment.php?cid=154</wfw:comment>
    
        <wfw:commentRss>https://carrott.org:443/blog/rss.php?version=atom1.0&amp;type=comments&amp;cid=154</wfw:commentRss>
    
            <category scheme="https://carrott.org:443/blog/categories/4-Fabrication" label="Fabrication" term="Fabrication" />
    
        <id>https://carrott.org:443/blog/archives/154-guid.html</id>
        <title type="html">Speedometer</title>
        <content type="xhtml" xml:base="https://carrott.org:443/blog/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>Surprisingly the <a href="/emini/Gearbox">new gearbox's</a> speedometer cable connects to the Mini speedometer. Unfortunately it interferes with the body at the gearbox end so I haven't been able to test it's calibration. I've been using the speed display on my <a href="https://carrott.org:443/blog/archives/82-EVision-Display-Installation.html">EVision</a> which listens to a speed pulse from my motor controller, but there is no odometer or trip meter and I would like to use display other data on the EVision, so I've been looking for an electronic speedometer to mount inside the mini instrument cluster. At the weekend I found a small electronic speedo from a Mitsubishi FTO which was new enough to be electronic but old enough to not be use the CAN bus and be small and separate from the other gauges.<p>

<p><!-- s9ymdb:245 --><img class="serendipity_image_center" width="600" height="399"  src="https://carrott.org:443/blog/uploads/2014/speedometer-front.jpg"  alt="Mitsubishi FTO Speedometer Under Test" /><br/>
<br/>
The speedometer input is pulled up to 5v and pulled down by a transistor in speed sensor in the gearbox. I made a <a href="https://carrott.org/git/speedo_test.git">simple Arduino sketch</a> and found it requires 2548 pulses per km and very slightly over reads at 100km/h. Interestingly it works at 400km/h! The speedo needle almost touches the other side of the zero stop but the odometer works perfectly. I haven't tested to find the speed at which it stops working.</p>

<!-- s9ymdb:246 --><img class="serendipity_image_center" width="600" height="399"  src="https://carrott.org:443/blog/uploads/2014/mitsubishi-mechanism-in-mini-cluster.jpg"  alt="Mitsubishi FTO Speedo Mechansim in Mini Instrument Cluster" />

<p>The mechanism is small enough to fit into the mini instrument pod, but the face is too big. The original mini face will fit if I make the window for the odometer bigger and enlarge the center hole slightly. The shaft is smaller but it shouldn't be too hard to fit the mini needle. I'm not sure if I should mount a remote trip meter button, or drill through everything and try to mount a button in the normal position. I'm now designing an adapter to mount the mechanism. Interestingly both cars have 180km/h speedometers, but the Mini spreads it out over more degrees. I'm not sure how hard it will be to calibrate the needle.</p>

</p>I'm considering whether to wind the speedo forward to 200,000km and call that "electric zero" or to attempt to align it with the car's current speedo -- <a href="http://tachosoft.com/">TachoSoft</a> indicate that the mileage data is stored in a separate serial EEPROM.</p>

  
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="https://carrott.org:443/blog/archives/153-Observe-Polarity-of-DC-Switches!.html" rel="alternate" title="Observe Polarity of DC Switches!" />
        <author>
            <name>carrott</name>
            <email>tom@carrott.org</email>        </author>
    
        <published>2013-08-11T01:27:22Z</published>
        <updated>2013-08-11T01:27:22Z</updated>
        <wfw:comment>https://carrott.org:443/blog/wfwcomment.php?cid=153</wfw:comment>
    
        <wfw:commentRss>https://carrott.org:443/blog/rss.php?version=atom1.0&amp;type=comments&amp;cid=153</wfw:commentRss>
    
            <category scheme="https://carrott.org:443/blog/categories/1-Electric" label="Electric" term="Electric" />
    
        <id>https://carrott.org:443/blog/archives/153-guid.html</id>
        <title type="html">Observe Polarity of DC Switches!</title>
        <content type="xhtml" xml:base="https://carrott.org:443/blog/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>Many high voltage DC contactors, switches and circuit breakers are only able to perform to their specifications if the current is flowing in the expected direction. This is because they include magnets which push the arc away from the switching element and into an arc chute or other plasma management device. A wire carrying a current through a magnetic field experiences a force (this is how motors work!) and this is particularly effective in the case of an arc because the "wire" is actually made of ionized gas. The problem comes when you reverse the direction of the current -- the "blow out" magnets suddenly become "blow in" magnets and the switch catches fire.</p>

<p><a href="http://www.rise.org.au/">RISE</a> did some testing of polarized DC circuit breakers intended for solar power and the results were quite spectacular. Do wait for the 40A tests towards the end!</p>
<iframe width="420" height="315" src="//www.youtube.com/embed/Cup5fMGaE2g" frameborder="0" allowfullscreen></iframe>

<p>Consult the manufacturer's datasheet to ensure your switches are correctly installed!</p>  
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="https://carrott.org:443/blog/archives/152-Dont-use-AC-Circuit-Breakers-on-DC.html" rel="alternate" title="Don't use AC Circuit Breakers on DC" />
        <author>
            <name>carrott</name>
            <email>tom@carrott.org</email>        </author>
    
        <published>2013-08-09T07:28:14Z</published>
        <updated>2013-08-09T08:56:54Z</updated>
        <wfw:comment>https://carrott.org:443/blog/wfwcomment.php?cid=152</wfw:comment>
    
        <wfw:commentRss>https://carrott.org:443/blog/rss.php?version=atom1.0&amp;type=comments&amp;cid=152</wfw:commentRss>
    
            <category scheme="https://carrott.org:443/blog/categories/1-Electric" label="Electric" term="Electric" />
    
        <id>https://carrott.org:443/blog/archives/152-guid.html</id>
        <title type="html">Don't use AC Circuit Breakers on DC</title>
        <content type="xhtml" xml:base="https://carrott.org:443/blog/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>I tested a few circuit breakers rated for AC using my car's 250V DC battery. I used my <a href="https://carrott.org:443/blog/archives/150-Load-Tester.html">load tester</a> to limit the current to about 27A. I found that with a resistive load, the breakers successfully interrupted the current but failed safely after 5 or 10 switching cycles. Since I didn't have the equipment to limit the current to 50 or 100A, I used one of the windings in an isolation transformer to make the load more inductive and sort-of simulate a higher fault current situation. With this additional resistance, the current dropped to 23A. The results were quite scary:</p>

<p>
<iframe width="560" height="315" src="//www.youtube.com/embed/jSzDps_z8Gc" frameborder="0" allowfullscreen></iframe>
<br />
A Vynckier Series E circuit breaker interrupted the current once and caught fire on the second attempt. The fire only went out because I used my (400V 250A DC rated) contactor to turn off the current, you can see the flash on the left when it switches off.
</p>

<p>
<iframe width="560" height="315" src="//www.youtube.com/embed/pbcuHgSujJ8" frameborder="0" allowfullscreen></iframe>
<br />
A People DZ47-63 circuit breaker interrupted the current but destroyed itself in the process. Inside you can see the switching element is significantly shortened and the casing burnt:
<br/>
<!-- s9ymdb:243 --><img class="serendipity_image_center" width="600" height="399"  src="https://carrott.org:443/blog/uploads/2013/burnt-people-breaker.jpg"  alt="inside the people breaker" />
</p>

<p>
It's important to note these tests represent abuse of the circuit breakers, if you ask them to switch AC they will likely give years of trouble free operation. The key is that 50Hz AC current falls to zero for long enough that the plasma cools, when the voltage rises during the next cycle, the arc can't re-establish without the plasma. With DC, the current doesn't stop and the arc just keeps burning.
</p>  
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="https://carrott.org:443/blog/archives/151-EV-Builders-Part-1.html" rel="alternate" title="EV Builders Part 1" />
        <author>
            <name>carrott</name>
            <email>tom@carrott.org</email>        </author>
    
        <published>2013-03-13T08:37:51Z</published>
        <updated>2013-03-13T08:46:18Z</updated>
        <wfw:comment>https://carrott.org:443/blog/wfwcomment.php?cid=151</wfw:comment>
    
        <wfw:commentRss>https://carrott.org:443/blog/rss.php?version=atom1.0&amp;type=comments&amp;cid=151</wfw:commentRss>
    
            <category scheme="https://carrott.org:443/blog/categories/5-News" label="News" term="News" />
    
        <id>https://carrott.org:443/blog/archives/151-guid.html</id>
        <title type="html">EV Builders Part 1</title>
        <content type="xhtml" xml:base="https://carrott.org:443/blog/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <a class="serendipity_image_link"  href='http://vimeo.com/channels/evbuilders/61404047'><!-- s9ymdb:241 --><img class="serendipity_image_center" width="640" height="360"  src="https://carrott.org:443/blog/uploads/2013/evbuilders-1.jpg"  alt="Theo with his converted Sera" /></a>
<br />
<br />
My friend <a href="http://www.evbuilders.com/">Theo</a> is making a film about converting his Toyota Sera. Part one is now finished, <a href="http://vimeo.com/channels/evbuilders/61404047">check it out</a>.  
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="https://carrott.org:443/blog/archives/150-Load-Tester.html" rel="alternate" title="Load Tester" />
        <author>
            <name>carrott</name>
            <email>tom@carrott.org</email>        </author>
    
        <published>2013-01-15T09:38:00Z</published>
        <updated>2013-01-15T11:56:49Z</updated>
        <wfw:comment>https://carrott.org:443/blog/wfwcomment.php?cid=150</wfw:comment>
    
        <wfw:commentRss>https://carrott.org:443/blog/rss.php?version=atom1.0&amp;type=comments&amp;cid=150</wfw:commentRss>
    
            <category scheme="https://carrott.org:443/blog/categories/4-Fabrication" label="Fabrication" term="Fabrication" />
    
        <id>https://carrott.org:443/blog/archives/150-guid.html</id>
        <title type="html">Load Tester</title>
        <content type="xhtml" xml:base="https://carrott.org:443/blog/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <!-- s9ymdb:238 --><img class="serendipity_image_center" width="800" height="532"  src="https://carrott.org:443/blog/uploads/load-heater.jpg"  alt="Load Tester glowing" />
<p>
I made a little load tester with some stove elements. They draw 27A at 260V. The camera is sensitive to near infrared -- they don't look as bright in real life. I think I will have to improve the cooling system before running it at higher voltage. The 3rd element away from the fan runs hottest, probably because the 4th element radiates heat away on it's outside and heats the 3rd element with the other.
</p>

<!-- s9ymdb:239 --><img class="serendipity_image_center" width="800" height="532"  src="https://carrott.org:443/blog/uploads/anderson-flash.jpg"  alt="scorched anderson disconnect" />
<p>Connecting this thing is not entirely straightforward. At low currents, you can use an Anderson disconnect with moderate safety, but things go badly at 27A and 260V. When I connected all 4 elements for the first time, the pins hit end on and the plug didn't go together. I don't know if disconnecting would have gone better with the small run-up that a fully mated connector offers, but I do know that separating from half connected went badly. There was a pop and a ball of white a big bigger than a hand span. When the after-image started to fade I could see the outline of the connector with a jet of white exiting the connector at 45 degrees on each side.</p>

<p>Safe disconnection is easily achieved with the right <a href="/emini/Contactors">contactor</a>. A small flash is visible inside the arc chamber during disconnection.</p>  
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="https://carrott.org:443/blog/archives/149-Motor-Torque-Mount.html" rel="alternate" title="Motor Torque Mount" />
        <author>
            <name>carrott</name>
            <email>tom@carrott.org</email>        </author>
    
        <published>2012-12-31T10:04:51Z</published>
        <updated>2012-12-31T10:22:31Z</updated>
        <wfw:comment>https://carrott.org:443/blog/wfwcomment.php?cid=149</wfw:comment>
    
        <wfw:commentRss>https://carrott.org:443/blog/rss.php?version=atom1.0&amp;type=comments&amp;cid=149</wfw:commentRss>
    
            <category scheme="https://carrott.org:443/blog/categories/4-Fabrication" label="Fabrication" term="Fabrication" />
    
        <id>https://carrott.org:443/blog/archives/149-guid.html</id>
        <title type="html">Motor Torque Mount</title>
        <content type="xhtml" xml:base="https://carrott.org:443/blog/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>One of the weakest parts of my motor mounting system is the bush which absorbs the torque generated by the motor. This mount was made very quickly from stuff I had lieing around and it turns out I applied force to the bush in different direction to that which it was designed for. I'm now working on a new design involving at least two more mounts which will better control the front-rear position of the motor in addition to it's torque.</p>

<p>The first mount is nearly done and sits between the gearbox and the front rail of the subframe, you can just see the top bolt and the hole for the bottom bolt in the middle left of this picture:<br/>

<!-- s9ymdb:237 --><img class="serendipity_image_center" width="800" height="324"  src="https://carrott.org:443/blog/uploads/2012/motor-subframe.jpg"  alt="motor and subframe on stand" />

</p>  
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="https://carrott.org:443/blog/archives/148-Revenge-Of-the-Electric-Car-Showing-in-New-Zealand-with-Chris-Paine.html" rel="alternate" title="Revenge Of the Electric Car Showing in New Zealand with Chris Paine" />
        <author>
            <name>carrott</name>
            <email>tom@carrott.org</email>        </author>
    
        <published>2012-04-25T11:06:19Z</published>
        <updated>2012-04-25T11:06:19Z</updated>
        <wfw:comment>https://carrott.org:443/blog/wfwcomment.php?cid=148</wfw:comment>
    
        <wfw:commentRss>https://carrott.org:443/blog/rss.php?version=atom1.0&amp;type=comments&amp;cid=148</wfw:commentRss>
    
            <category scheme="https://carrott.org:443/blog/categories/5-News" label="News" term="News" />
    
        <id>https://carrott.org:443/blog/archives/148-guid.html</id>
        <title type="html">Revenge Of the Electric Car Showing in New Zealand with Chris Paine</title>
        <content type="xhtml" xml:base="https://carrott.org:443/blog/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <a href="http://docnz.org.nz/2012/ak/film/revenge-of-the-electric-car">Revenge of the Electric Car</a> is on at the <a href="http://docnz.org.nz/festival/">Documentary Edge Festival</a> in Auckland and Wellington. The director, Chris Paine will be speaking at the opening night (tomorrow! 26th April!) and on the 4th of May. I'm going along to the 4th of May. Unfortunately it doesn't look like he'll be attending the Wellington showings.  
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="https://carrott.org:443/blog/archives/147-Battery-Seat.html" rel="alternate" title="Battery Seat" />
        <author>
            <name>carrott</name>
            <email>tom@carrott.org</email>        </author>
    
        <published>2012-02-08T11:54:17Z</published>
        <updated>2012-02-08T11:54:17Z</updated>
        <wfw:comment>https://carrott.org:443/blog/wfwcomment.php?cid=147</wfw:comment>
    
        <wfw:commentRss>https://carrott.org:443/blog/rss.php?version=atom1.0&amp;type=comments&amp;cid=147</wfw:commentRss>
    
            <category scheme="https://carrott.org:443/blog/categories/4-Fabrication" label="Fabrication" term="Fabrication" />
    
        <id>https://carrott.org:443/blog/archives/147-guid.html</id>
        <title type="html">Battery Seat</title>
        <content type="xhtml" xml:base="https://carrott.org:443/blog/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <!-- s9ymdb:236 --><img class="serendipity_image_center" width="600" height="399"  src="https://carrott.org:443/blog/uploads/2012/battery-seat.jpg"  alt="40 cells on rear seat." />

<p>Ed came over and helped me make a temporary battery box for the rear seat. This lets me evaluate performance with 40 more cells, for a total of 76. Knowing how well the car performs at higher voltage with a larger battery lets me decide how hard I need to work to squeeze cells under the bonnet. The intention is still to retain 4 seats in the car, this box is just an experiment.</p>

<p>Building this battery box was harder than it sounds. The seat base is full of curves so the bottom of the box needs a strong base, and holding the cells down with their dangerous high voltage terminals very close to the edges is not trivial. I'll post a picture of the lid which was key to holding the cells down shortly. The box is made of wood which is more flammable than I would like, restraint will be achieved with ratchet tied downs attached to the seat belt anchors.</p>

<p>In other news, the new cable connecting the inverter to the motor has resolved my <a href="https://carrott.org:443/blog/archives/146-Inverter-Interference.html">inverter instability</a>. I'll blog more about this cable soon.</p>  
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="https://carrott.org:443/blog/archives/146-Inverter-Interference.html" rel="alternate" title="Inverter Interference" />
        <author>
            <name>carrott</name>
            <email>tom@carrott.org</email>        </author>
    
        <published>2012-01-30T10:13:11Z</published>
        <updated>2012-01-30T10:43:29Z</updated>
        <wfw:comment>https://carrott.org:443/blog/wfwcomment.php?cid=146</wfw:comment>
    
        <wfw:commentRss>https://carrott.org:443/blog/rss.php?version=atom1.0&amp;type=comments&amp;cid=146</wfw:commentRss>
    
            <category scheme="https://carrott.org:443/blog/categories/9-Inverter" label="Inverter" term="Inverter" />
    
        <id>https://carrott.org:443/blog/archives/146-guid.html</id>
        <title type="html">Inverter Interference</title>
        <content type="xhtml" xml:base="https://carrott.org:443/blog/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <a href="http://carrott.org/blog/archives/143-Rear-Inverter.html">Previously</a>, I reported that my <a href="http://carrott.org/emini/Siemens_Simovert_Short">Simovert</a> motor controller was happy in the rear of the car with the motor in the front of the car. It turns out this is not the case. While going up and down the driveway did not uncover any problems, going up and down the road has. The inverter shuts down with a range of errors:

<ul>
<li>GateDriveUnit</li>
<li>LCA Err Latch</li>
<li>Overcurrent</li>
<li>VC_Over_Voltage</li>
</ul>

<p>I am hoping that this is caused by a combination of poor motor phase cable routing and poor motor-inverter grounding. It turns out that the Siemens supplied motor cables have a shield which is grounded in the cable glands, effectively joining and extending the casing of the motor and the inverter to envelope the motor cables. Such a shield will do a lot to control noise radiated by the motor cables. My motor cables had none of this and worse the motor was not well grounded -- I'm told that non-trivial current can flow between the motor and inverter through the ground due to "induction effects". Regardless of how real this is, properly bonding the inverter ground to the motor ground seems reasonable.</p>

<p>I am solving this problem with a 50mm<sup>2</sup> 3 phase neutral screen cable and appropriate glands. The very stiff underground rated cable I have isn't really appropriate and in hindsight, I should have found a supplier of the right cable, but that story is for my next post.</p>  
            </div>
        </content>
        
    </entry>
    <entry>
        <link href="https://carrott.org:443/blog/archives/145-33.4Ah.html" rel="alternate" title="33.4Ah" />
        <author>
            <name>carrott</name>
            <email>tom@carrott.org</email>        </author>
    
        <published>2012-01-20T09:08:08Z</published>
        <updated>2012-01-20T09:52:34Z</updated>
        <wfw:comment>https://carrott.org:443/blog/wfwcomment.php?cid=145</wfw:comment>
    
        <wfw:commentRss>https://carrott.org:443/blog/rss.php?version=atom1.0&amp;type=comments&amp;cid=145</wfw:commentRss>
    
            <category scheme="https://carrott.org:443/blog/categories/3-Battery" label="Battery" term="Battery" />
    
        <id>https://carrott.org:443/blog/archives/145-guid.html</id>
        <title type="html">33.4Ah</title>
        <content type="xhtml" xml:base="https://carrott.org:443/blog/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <a href="http://carrott.org/blog/archives/39-In-with-the-new.html">In 2008 I bought a battery</a>. At the time, I knew that I was buying a product with a shelf and cycle life (it wears out even if you aren't using it). I didn't expect the battery to sit around for as long as it has, but here we are 3.5 years later. I did a capacity test of the 36 cells installed in the car and found a usable capacity of 33.5Ah:

<!-- s9ymdb:233 --><img class="serendipity_image_center" width="1150" height="600"  src="https://carrott.org:443/blog/uploads/2012/36-cell-capacity.png"  alt="discharge graph of 36cell pack in the car" />

The nameplate rating is 40Ah which is substantially more. There are several possible causes of this discrepancy:

<ul>
<li>Calendar Life</li>
<li>Cycle Life</li>
<li>High current abuse</li>
<li>High temperature abuse</li>
<li>Differing test methodology</li>
<li>Low capacity when delivered</li>
</ul>

Calendar life and differing test methodology will certainly have an effect. I am charging to 3.55V at 1A which is substantially lower than thunder sky's recommendation. My pack is moderately closely top balanced and at the end of discharge, the highest cell was just below 3.1V while the lowest cell was at about 2.8V at 10A discharge. This suggests the cells have varying capacity or are not properly balanced.

I also tested 10 cells which have not been cycled or abused with high current or high temperature. The pack in the car has had perhaps 10 cycles, a lot of it discharging at 3C for 5 or 10 minutes at a time. I limited my maximum current to 200A or 5C and kept currents above 120A to short 5 or 10 second bursts. This is not too far from Thunder Sky's specs but does cause significant battery heating. In the summer I have measured over 40C at the battery terminals. The 10 cell pack that sat on the bench has not been subjected to high current or high temperature, probably never getting higher than 25C. This pack achieved 34.3Ah and showed less spread in capacity, with the hightest cell at 3.0V while the lowest was at 2.85V:

<!-- s9ymdb:235 --><img class="serendipity_image_center" width="1160" height="600"  src="https://carrott.org:443/blog/uploads/2012/10-cell-capacity.png"  alt="discharge graph of 10 cell battery" />

That these two packs show very similar capacity suggests the high temperature and high current and cycling had little effect on the battery in the car.

Cell voltages were measured with the EVD5 BMS, discharge current and Ah counter performed by my EVision and recorded from it's CAN bus by the BMS data logger. The car's battery was discharged with two domestic 240V heaters and a kettle (which nearly boiled dry). The small 10 cell battery was discharged with a steel wire on a wood form in a large bucket of water.

The 10 cell battery shows a larger spread of voltages under load because i did nothing to prepare the cell terminals before putting making the connections, the terminal connection resistance was all over the place.  
            </div>
        </content>
        
    </entry>

</feed>