How to: Interface CA speedo to Vectrix Encoder

8 posts / 0 new
Last post
heathyoung
Offline
Last seen: 7 years 7 months ago
Joined: Wednesday, July 27, 2011 - 21:11
Points: 90
How to: Interface CA speedo to Vectrix Encoder

I've done some searching here and elsewhere and it seems that this is something no-one else has done yet - being able to read the speed of the Vectrix by interfacing with the motor encoder.

I think its a pretty essential modification, as it gives you your watthours per klm, a speedo that's less jerky than stock and higher resolution.

The motor encoder is a quadrature differential encoder, complete with differential A/B and differential hall outputs. The hall outputs fire 6 times per revolution, and output 3.6V. The A/B outputs are MUCH higher frequency. Pinouts were determined with a multimeter and oscilloscope and the pinout in the factory manual is completely wrong. Don't use it.

Knowing this, you can intercept the signal using a high impedance buffer (so you don't load down the signal - very important), and isolate it using an optocoupler (you must isolate it or you break isolation provided by the DC:DC converter).

I initially used the 5V rail (white wire, pin 13), ground (black wire, pin 10) and yellow hall (yellow wire, pin 3) as inputs, and ran these to an LM358 set up as a voltage follower, feeding an MCT9001 optocoupler (I used this part for two reasons - I had it in stock, and it has a good CTR - current transfer ratio). I then fed this to the speed wire of the Cycle Analyst, and used the opto to pull it to ground. This worked well till about 60Kph, when it dropped to zero - WHUT?!

Scoping the waveform showed a characteristic triangle wave of an RC (resistor capacitor) constant - Makes sense, since the speed pad is fed by a high value resistor, and has a capacitor to ground (to filter high frequency noise) - as the frequency went up, the waveform got smaller and smaller till it was no longer sensed as valid input by the CA's microprocessor.

Humph. The designer clearly never expected the frequency to get this high (300Hz) being pulled to ground. So - I ran a 2K resistor from the CA's 5V rail to the SP pad - and the waveform immediately improved - a nice square wave that the CA detected to the end of the speedo.

BUT - the additional load imposed by the 2K resistor meant at low speed (under 2Kph) the backlight was flashing dim/bright/dim as the hall sensor fired, and the voltage reg got very hot. This is a bad thing.

So - an auxiliary +5V supply was required - this consisted of a large series resistor (10K) and zener diode + cap, which now feeds the SP pad of the CA via a 1K resistor. Problem solved.

To calibrate the speedo, the values of 1600mm for the tyre circumference (measured with a dressmaker's tape around the tyre) poles of 28 (its a 12 pole motor, with a 4.6:1 reduction ratio - BUT the hall transitions happen 6 times per revolution NOT 12).

This was all tested with the bike on a jack with the rear wheel lifted, and the kickstand contacts shorted with a piece of wire. My CA is an older model V2.3, that had done a few years duty on ebikes already. Its fed via a relay that comes on with the bike ignition, and also when the charger is powered.

heathyoung
Offline
Last seen: 7 years 7 months ago
Joined: Wednesday, July 27, 2011 - 21:11
Points: 90
Re: How to: Interface CA speedo to Vectrix Encoder

Images didn't attach properly...

Encoder Plug Pinout

Encoder_Plug.jpg

Schematic

CA_Interface_Schematic.jpg

+5V Lead soldered

IMG_0324.JPG

Perfboard Rear - note 0.1u decoupling cap.

IMG_0318.JPG

Perfboard Front - note 100K resistor not used in final version

IMG_0319.JPG

Heatshrunk for insulation and safety

IMG_0320.JPG

Checking calibration against factory speedo

IMG_0321.JPG

Full speed test results - 107 Kph occurs when bouncing off the speed limiter.

IMG_0323.JPG

Mik
Mik's picture
Offline
Last seen: 8 years 8 months ago
Joined: Tuesday, December 11, 2007 - 15:27
Points: 3739
Re: How to: Interface CA speedo to Vectrix Encoder

Great stuff!

Where would it best fit in the collaborative handbook?

Maybe a new chapter about the cycle analyst?

Mik

This information may be used entirely at your own risk.

There is always a way if there is no other way!

heathyoung
Offline
Last seen: 7 years 7 months ago
Joined: Wednesday, July 27, 2011 - 21:11
Points: 90
Re: How to: Interface CA speedo to Vectrix Encoder

An interesting problem has turned up with this mod (I think) - I've been getting a high temperature telltale illuminating on the dash now.

I did wash the bike before I set out, might be water somewhere weird, but the only temperature sensors that are left on the bike are the one on the IGBT, and the one on the motor.

I'm thinking its the motor one, I may be drawing too much current from the +5V rail, and need to use the 12V rail for the opamp supply (I think if the 5V rail drops, then the temp sensor for the motor (which is in the same loom) may appear to be too hot.

If it stops bloody raining for long enough today I might take it out again and see if its still erroring.

heathyoung
Offline
Last seen: 7 years 7 months ago
Joined: Wednesday, July 27, 2011 - 21:11
Points: 90
Re: How to: Interface CA speedo to Vectrix Encoder

False alarm. Took the bike for a ~20Klm run with lots of acceleration and deceleration - No temp light:

Stats from CA

Min V = 107V @ 163.3A = 17.5Kw - From this, internal resistance of the pack = 140-107 = 33V drop @ 163.3A = 0.2 Ohms, or 0.0046 Ohms per cell (43) (ignoring wiring and connector losses). Not bad.

I've got a bright red LED on the dash that shines whenever a cell drops below 2.5V, tells you to back off the throttle.

Min A (Regen) 38A (5.4Kw regen) - was surprised at this, along with the 10% regeneration. Didn't have to use the disc brakes at all (apart from hill starts).

Used 1296 WH to go 22Klms, efficiency is 52wh/Klm. I have an ebike that uses 35Wh/klm, so I was very surprised with this.

I rebuilt the PCB into a project box, along with the power supply (I used 5W resistors since I had them in the junkbox, they are major overkill).

MEroller
MEroller's picture
Offline
Last seen: 1 year 7 months ago
Joined: Monday, September 26, 2011 - 09:24
Points: 847
Re: How to: Interface CA speedo to Vectrix Encoder

52 Wh/km in a Vectrix is quite a feat, I think! With my extremely gentle ride to the electric vehicle world record attempt (507!) at the start of this year's WAVE I managed 28.3 Wh/km, but that encompassed a lot of max. 50km/h constant speed riding. When I ride with maximum fun factor I will easily top your 52 Wh/km, with my miserly 5...8kW bike, and weighing about a third less than the VX1!

My rides:
2017 Zero S ZF6.5 11kW, erider Thunder 5kW

robwhite
robwhite's picture
Offline
Last seen: 1 year 8 months ago
Joined: Tuesday, August 11, 2009 - 04:29
Points: 63
Re: How to: Interface CA speedo to Vectrix Encoder

G/ day Heath would you be interested in making me up one of those black boxes? I'm running the same ca as you could you contact me on email please rob.whit@ bigpond.net.au

rob white

heathyoung
Offline
Last seen: 7 years 7 months ago
Joined: Wednesday, July 27, 2011 - 21:11
Points: 90
Re: How to: Interface CA speedo to Vectrix Encoder

Yep sure I'll send it over with those other boards for you.

I'll put up some photos of version 2 (version 1 was a bit ugly and for testing only).

CA_Interface_V2_PCB.JPG

The new PCB with onboard supply - 12V for the CA 'speed' wire (its designed for this). Note if you have the magnet sensor on your CA there is a good chance that the yellow speed wire is not connected in the CA itself. The 4K7 5W resistors are MAJOR overkill for the 1mA load, but its what I had in the garage.

CA_Interface_V2_Case.JPG

Now in a proper case rather than heatshrink.

CA_Interface_V2_Mounted.JPG

And all boxed up on the bike. This is a lithium converted Vectrix, but with a twist - the top 13 cells are on their sides, so no cutting of the cover was necessary.

The top battery box also makes a very nice mounting point for the shunt and the Anderson connectors. Yes, I am a little retentive I know :)

X Vectrix
Offline
Last seen: 1 year 8 months ago
Joined: Tuesday, August 4, 2009 - 05:20
Points: 298
Re: How to: Interface CA speedo to Vectrix Encoder

Heath
If you get the hi temp icon again, check pins 7 and 10 of the encoder connector. These are the temp sensor inputs. The sensor is a thermal switch, which will open at a certain temperature. A bad connection at 7 or 10 will give the same affect.
Also try to notice the message on the odo, if its the motor sensor you will see "EngHot"

Log in or register to post comments


Who's online

There are currently 0 users online.

Who's new

  • eric01
  • Norberto
  • sarim
  • Edd
  • OlaOst

Support V is for Voltage