Scion xB EV – Interface Electronics

This page discusses the interface and control electronics in my 2004 Scion xB EV conversion.

The Solectria UMOC445TF inverter, which controls the AC55 motor in my car must be interfaced to several other systems of the car.  It must communicate with the BMS in order to prevent battery overvoltage (from regen when the battery is full) or from undervoltage (due to either excessive power demand, cold temperature, or low battery).    The Inverter must connect to a throttle signal, forward/neutral/reverse switch, ignition switch, brake light, and several other input and output signals in order to fully integrate with the car.

The Manzanita Micro PFC-30 charger must also interface with the BMS (to avoid overcharging the battery) as well as be controlled by the J1772 charging protocol, in order to allow use of public charging stations.

In order to do achieve all of this in a relatively modular fashion,  I built two electronics enclosures, which I call the “CB” (control box) and “CIB” (charger interface box).

  • Control Box (CB):   The Control Box is essentially the brainstem of the car.   It receives, combines, and conditions all incoming external signals needed by the UMOC445TF inverter, and provides output of all diagnostic and chassis signals coming from the inverter.   It also includes a couple of “expert mode” controls that can be switched to
    override the BMS signals and allow the car to be drivable, for example in an emergency situation or if the BMS fails.
  • Charger Interface Box CIB):    The Charger Interface Box allows the Elithion BMS and the J1772 signalling circuit to control the Manzanita Micro PFC30 charger.   It also includes an AC ammeter and several indicators and override switches, which can be set to allow charging in the event the BMS fails or if no J1772 signals are present.  The latter capability allows charging from any AC power source, not just J1772 charging stations.   This is an advantage over production EVs which must carry an expensive portable J1772 charging station if they wish to charge from a regular 120V or 240V outlet.

xB Control Signals

block diagram of all control signals in scion xB EV conversion

block diagram of all control signals in scion xB EV conversion

The associated graphic is a result of my attempt to get into one place all the control and status signals I was going to have to handle.   My ultimate build has diverged from this slightly, but overall this is accurate insofar as the major control and indicator signals in the car go, so it is probably a good start for anybody else considering a similar build.

Design Philosophy

I tried to ensure that all my control systems are able to detect and respond to fault conditions especially safety related (e.g. detecting a faulty throttle signal) or economically related (detecting a low battery before damage is done).   I also tried to ensure that all signals are designed such open circuit condition on that signal is interpreted as a fault.  This way a loose wire does not prevent a critical signal from being detected.

At the same time, this is an EV conversion and reliability is not always a given.  So I incorporated several bypass mechanisms to allow the car to drive (potentially at peril to the batteries) if certain systems, e.g. the BMS) are not communicating properly.

Control Box (CB)

The Control Box is essentially the brainstem of the car.   It receives, combines, and conditions all incoming external signals needed by the UMOC445TF inverter, and provides output of all diagnostic and chassis signals coming from the inverter.   It also includes a couple of “expert mode” controls that can be switched to override the BMS signals and allow the car to be drivable, for example in an emergency situation or if the BMS fails.   It is located where the gearshift lever used to be.

Functions:

  • Provide Forward/Reverse/Neutral controls to driver and indicators for same.
  • Supply 5V power to Prius Throttle Pedal and transfer VPA1 throttle signal to inverter.
  • Provide charging interlock function, allowing fuel door open to prevent drive-away
  • Require ignition key turned to “start” position briefly to enable driving
  • Detect and latch System Fault indication and shut down inverter when detected.
  • Detect and latch Fault Condition with the Prius Throttle Pedal
  • Detect and latch Fault signal from BMS
  • Detect and latch Fault signal from Inverter
  • Provide for manual reset of fault signal and perform lamp test
  • Indicate low battery from BMS or inverter and provide and progressively limit throttle
  • Provide manual throttle limiter (power saver) control
  • Provide manual regen disable/enable function
  • Automatically disable regen from BMS overvoltage signal
  • Turn on back up lights based when in reverse
  • Turn on brake lights when inverter commands it, combine signal with brake pedal switch
  • Provide Motor Temperature warning to driver
  • Provide manual override of BMS “FAULT” and “LLIM” signals to allow car to drive in event of emergency or BMS failure.

Circuit Design

controller interface board circuit schematic (beware errors!)

controller interface board circuit schematic (beware errors!)

Whlle all of the above could be achieved with a microcontroller, most of the signals would still have required considerable hardware for buffering and conditioning, and thus even with a microcontroller the overall hardware complexity of the board would have been similar, and then I would have had to write and test software on top of that.  I chose to implement all functions in discrete logic for this reason.

None of the individual functions are terribly complicated,  but taken as a whole there is a fair amount going on.  Physically, the control box is a large outdoor conduit junction box that has enough room in it for the circuit board and a few relays and terminal blocks.  The actual logic circuit is built on a 4×6 44 pin edge card connector prototyping board.  The vast majority of the logic is implemented with LM339 analog comparators and 74HC00 quad NAND gates and 74HC04 (standard) and 74HC14 (schmidt trigger) inverter gates.   Since speed is not an issue,  I utilized resistor and diode combinations to convert individual inverters into N-wide inputs as needed.   this allowed for building the whole board with only a few very common (e.g. radio shack should have them) digital logic components.

The signals (FAULT, HLIM, LLIM, DCL) coming from the BMS are optically isolated using PC817 optocouplers.   Technically the BMS and Inverter share common chassis ground but the Elithion BMS documentation recommended an isolated interface.   If nothing else, solation will reduce the likelihood of electronic noise on the long cable coming from the BMS unit in the back of the car up to the control box.

Refer to the UMOC Service Manual for detailed specifications as to the UMOC control signals coming in over the 25 pin D-SUB connector.  Connections to these are referenced in the above schematic.

Following subsections are more detail on some of the more complex individual functions of the control box.  Refer back to the above schematic.

Prius Throttle Pedal Interface

prius throttle pedal (bottom) next to scion xB gas pedal (top)

prius throttle pedal (bottom) next to scion xB gas pedal (top)

I used a 2nd generation Toyota Prius throttle pedal in my xB EV conversion.  This has the advantage of completely eliminating the need for a throttle cable, throttle pot, and the associated space requirement and mechanical complexity.   The Prius throttle pedal is directly compatible with many (if not all) EV inverter/controllers.

OEM Documentation

OEM Toyota Prius throttle pedal diagnostic documentation here:  prius_throttle_pedal_diagnostic.pdf

Pinouts: (pedal positioned as if installed in car, looking down from top as if seated in driver seat, socket alignment keys to right)

  1. VPA1 (farthest pin) 0.8V-4.2V output signal
  2. EP1 Ground
  3. VCP1 +5V supply
  4. VPA2 1.6V-5V output signal
  5. EP2 Ground
  6. VCP2 (nearest pin) +5V supply

There are a couple of sources online for a compatible plug.   You can find the prius pedals themselves cheap and plentiful on ebay, or buy a new one through some EV parts resellers or from toyota.

Design

The 2nd generation toyota prius gas pedal is a self contained, modular component.  It contains a spring loaded pedal connected to a dual hall effect sender.  The electronics are completely sealed and there are no moving contacts.   It should be extremely reliable.  (This throttle pedal was the subject of the toyota “stuck throttle” recall fuss a few years back.  Their fix for this, visible on one of my pedals which must have been a recall unit, was to trim the bottom edge of the pedal to make it less likely to catch on floor mats)   The electronics were never found to be at fault.

It runs off of +5v and produces two independent throttle signals.  The first, VPA1 runs from approximately 0.8V to 4.2V, and the second, VPA2 maintains a constant 0.8V higher, running from approximately 1.6V to 5V over the same pedal travel range.    In both cases, the low voltage indicates off-pedal, and high voltage indicates full throttle.  The purpose of the two independent signals is for fault detection.

Most modern inverters/controllers for EV conversions take the throttle signal as a 0-5V range, with 0V indicating no throttle and 5V indicating full throttle.  They are often programmable for a slightly different range within the 0-5V limits.    This means it is very easy to use the prius pedal as your throttle sender

Easy Interface to Inverter/Controller

It is of course possible (and easiest) to utilize just one channel of the prius pedal for your throttle signal.  In this case, you just supply 5V either from the inverter/controller or a separate 5V power supply (such as a 7805 voltage regulator circuit supplied by the ignition system 12V) to VCP1 and VCP2 pins, attach ECP1 and ECP2 pins to chassis ground, and attach the output of VPA1 to your inverter/controller throttle input, and finally calibrate the inverter/controller to the voltage range that VPA1 outputs.  (0.8V-4.2V)   VPA2 is unused in this scenario.

Safer Interface to Inverter/Controller

Refer to the CB schematic, above.   The circuit I describe below is part of that schematic.

For safety reasons, It is a good idea to consider building a circuit that utilizes both channels VPA1 and VPA2 to detect the fault condition when the expected constant voltage difference between the two sides is not present.   The Control Board circuit I use incorporates this.   It requires four analog voltage comparators (a single LM339 chip) , and a few external diodes and resistors, so is not a complex circuit.   It detects several fault conditions,  including VPA2<VPA1 and (VPA2-1V)>VPA1.  This effectively detects “stuck low” and “stuck high” for both VPA1 and VPA2.  If either condition is detected the global fault signal is triggered and the inverter is disabled.   The same circuit also generates an “off pedal” detector circuit that disables the inverter if VPA1<1V.  OR VPA2<1.8V.   This ensures that even if the first half of the circuit fails to detect a fault, a separate signal will be generated that stops the car if you let up on the throttle.

In addition to the throttle signal error detection circuit above,  the output of VPA1 is directly connected to the 0-5V throttle signal input on the UMOC445TF inverter.   5V is supplied by the digital logic 5V power supply on the Control Board.

The upshot of this is that several fault conditions are checked for that should drastically reduce the likelihood that any single fault or problem with the throttle pedal or wiring will cause a runaway.

Ignition Interlock and “Start” function

The Control Box ignition interlock is designed to prevent the car from being driven away while the fuel door is open.  There is a switch on the fuel door which runs between the INTERLOCK_LOOP_IN and INTERLOCK_LOOP_OUT signals on the above schematic.   If there is no continuity, it will prevent the ignition relay from closing and latching when the ignition key is turned to “start”.

Forward/Reverse/Neutral

Forward and Reverse are selected by two separate push buttons.  A third pushbutton on FAULT_R is the combination fault reset and neutral selector.  DIRECTION_FWD and DIRECTION_REV signals in the above schematic feed into a flip flop circuit.  This flip flop utilizing four 74HC04 inverters.  The circuit has a cleared state (neutral) that is selected at power up or when the RESET/NEUTRAL switch is pressed.   NOTE:  Schematic is not up to date here WRT to this flip flop.  Need to update.   As drawn there is no neutral gear selection.  Circuit comes up in FWD.  UMOC needs to see “neutral” direction position before it will engage drive.  

BMS interface

The interface to the Elithion BMS allows the control box to act on the following BMS signals:

  • FAULT:   Indicates the BMS has either detected a severe voltage or temperature condition with a cell, cannot communicate with one or more cells, or has experienced an internal error.
  • HLIM:   High voltage limit.  This means the inverter should not allow regen as the battery cannot accept any more charging.
  • LLIM:   Low voltage limit.  This means the battery is completely depleted and the car should not drive any further.
  • DCL:   Drive current limit.  This is an analog signal that slowly transitions from “full power” to “minimum power” to gradually reduce power as the battery discharges.

Following Elithion guidelines, and modelling the relevant portions of my circuit after their example, I have optically isolated these signals.   FAULT trips the Control Board fault status, which stops the car from driving until power cycle or manually clearing the condition.  HLIM disables regen.   LLIM pulls down the UMOC DRIVE_DISABLE signal which stops the car from driving.  Owing to the PC817 optocouplers not being linear,   I cheated with DCL and implemented a two stage cutback in throttle.   The first cuts throttle maximum power to about 60%, and the second stage to 30%.   In both conditions, a flasher circuit makes the battery warning LED blink about twice per second.  Once LLIM occurs the low battery LED comes on solid.

Fault Detection and Latch

If FAULT is detected by the Control Box circuit, it is latched (remembered) until manually cleared or power cycled.   A J-K flip flop in the above schematic does this.   There are several sources that can trip FAULT condition.  When tripped,  the Digital Enable input to the inverter is disabled, preventing driving and regen.   (This is different from the drive disable, which disables drive but not regen),

FAULT can be triggered from the following sources:

  • Prius Throttle Pedal Fault detection circuit
  • BMS
  • Inverter “Fault” LED

Note:  In 2000 miles of driving,  so far I have had one spurious “Fault”.   I think it was the UMOC445TF inverter, but I do not know for sure.  Turning off and back on the ignition cleared the problem.

A lamp test function is built into the fault reset circuit,  so that when the FAULT_R switch is pressed it will momentarily light all LEDs on the control box.

Backup/Brake Lights

The UMOC inverter provides a brake light output which is designed to drive a 12V coil relay to turn on the brake lights when regen is on.  I have wired the relay contacts in parallel with the brake light switch on the brake pedal, so either will turn on the brakes.

The back up lights are also relay isolated and are driven by a MOSFET whose gate is attachecd to the proper point in the forward/reverse flip flop circuit.

Power Saver

As shown in the UMOC445TF service manual, the power saver control is simply a 5K potentiometer used to limit maximum throttle.   I have found this is useful for when the batteries are cold to limit voltage sag and also as a poor mans cruise control.   I have implemented this as recommended, a 5K pot.  It is in parallel with the BMS DCL circuit so either one can pull down the UMOC’s analog power saver input.

UMOC445TF Signal Interface

The UMOC445TF signals all come off of a 25 pin D-SUB connector.  (e.g. an old parallel printer cable).   The pinouts and signal defintions are available in the UMOC Service Manual. All its digital signals are TTL level and the Power Saver and Throttle signal are both 0-5V analog signals with 0V “low” and 5V “high”.   It does not need to be optically isolated as the signals share chassis ground.   That said,  it may not be a terrible idea though I did not do it.   I did try to ensure I had dedicated, or lightly loaded TTL outputs drive each of the UMOC digital inputs, and I tried to buffer every TTL output from the UMOC (its outputs are designed to directly drive LEDs)

UMOC445TF Breakout Box

It is relatively easy, and very valuable,  to build a breakout box, basically exactly following the circuit schematic in the UMOC Service Manual.   This allows for bench testing the inverter (useful even if the motor is not attached), configuring it, verifying cable pinouts, and debugging faults.   My homemade test box pretty closely resembles the one shown in the service manual that Solectria made.  I did not figure it would be possible to lay hands on an original Solectria one so I did not try.    You can see it in action on the youtube video on my Motor and Controller page.

Charger Interface Box (CIB)

IMG_2906The Charger Interface Box allows the Elithion BMS and the J1772 signalling circuit to control the Manzanita Micro PFC30 charger.   It also includes an AC ammeter and several indicators and override switches, which can be set to allow charging in the event the BMS fails or if no J1772 signals are present.  The latter capability allows charging from any AC power source, not just J1772 charging stations.   This is an advantage over production EVs which must carry an expensive portable J1772 charging station if they wish to charge from a regular 120V or 240V outlet.

Circuit Design

charger interface box whiteboard scrawl.  the only schematic I have right now.

charger interface box whiteboard scrawl. the only schematic I have right now.

Since the Charger Interface Box is much simpler than the Control Box above,  I did not create a very good schematic for it, and the contents of the box are point-to-point wired.   The best I currently have is the shown whiteboard drawing,  which I have badly patched up to correct a couple errors.   All the LED resistors can be 1K, the PROX to GND resistor should be 2.7K per J1772 if your inlet does not have one.   The Relay is either a DPST or two SPST 30A, 240V AC relays with 12V coil.   The BMS to REGBUS relay is a regular automotive car alarm relay (SPDT)   Ammeter can either be inline or current transformer type.   I drew an inline one, but ended up using one that has a current transformer.   The two BMS override switches are the two sides of a DPDT micro toggle switch.  All snubber and isolation diodes can be 1N4002 or equivalent.    Refer to Manzanita Micro’s online documentation for their Regbus pinouts.

Functions:

The Charger Interface box provides the following functions:

  • Provide J1772 signalling (prox and pilot) sufficient to allow use with public J1772 EV charging stations.
  • Provide BMS control of the manzanita micro charger to its regbus port to cycle charger as battery reaches full charge.  (BMS “HLIM” signal)
  • Provide Emergency shutdown of manzanita micro charger via BMS “FAULT” signal.
  • Provide BMS and J1772 manual override controls.
  • Provide AC Ammeter to monitor charging current.
  • Provide alternate L14-30 and L6-30 inlets for charging without using J1772 plug

J1772 Signalling

I used a Modular EV Power AVC2 J1772 signalling unit for the primary part of allowing use of public charging stations.   This unit properly controls the PROX and PILOT signals but does NOT allow for charging current negotiation with the charging station.   This is not too big of an issue as there is a current knob on the Manzanita Micro PFC30 charger, and virtually all public charging stations will charge at 15 amps, so that is where I set the charger unless I know the station will accept more.

BMS Control of Charger

The Manzanita Micro charger uses a proprietary “regbus” interface which is intended to work with their own BMS.   While proprietary the interface is published and simple to create a basic interface.   Not all the manzanita chargers have isolated regbus interfaces as they repeatedly warn about in their documentation, so to be sure I built my Elithion “HLIM” to Regbus “HOT” interface using relay isolation, as it was the simplest way.   Basically once HLIM comes on,  the HOT signal on the Manzanita Regbus is triggered and the charger stops.   I intend to eventually improve this to use the BMS “CCL” (charge current limit) function to gradually reduce charger output instead of having ON/OFF control only.

BMS Emergency Charger Shutdown

The Manzanita Micro charger will run just fine with nothing at all plugged into its regbus port, meaning if there is a fault with the BMS control interface the charger may continue running and damage the battery (though the charger should be tuned so that it detects the overall battery voltage is at full charge and ramp back based on that).   To avoid this possibility, the Charger Interface Box provides a second mechanism for the BMS to shut off the charger.  This is done by controlling a pair of 30 amp relays (one on each HOT) on the power input to the charger.  if the BMS FAULT signal triggers (or goes open circuit) then these relays will open and turn off the charger.

BMS Overrides

To allow charging even with a nonfunctional BMS or without a proper J1772 charging station I provided two override switches, one to bypass the BMS FAULT and HLIM signals and the other to bypass the Modular EV Power AVC2 “on” relay.

Alternate Charging Inlets

This is simple.   The J1772 inlet on the side of the car terminates in a L14-30 twist lock plug that mates with the Charger Interface Box.  I can simply unplug this, set the J1772 bypass, and use any 30 amp extension cord that has this common type of 30 amp, 240 volt plug.   I can also bypass the charger interface box entirely and plug an L6-30 extension cord directly into the charger’s plug.

Next Topics

Lithium Batteries and BMS