Main Board Version 3

Hardware » Main Board Version 3

  • Schematic
    Schematic
  • Pin mapping
    Pin mapping
  • Populated board
    Populated board

The main board is the heart of the inverter system. It contains all the intelligence that is needed to convert the users inputs into motor shaft movement. It also contains all the protection circuitry to avoid damage in case of errornous inputs.

The pdf schematic is available via github.

Its distinct features are:

Digital inputs

There are external 8 digital inputs on JP2. A voltage of >7V is interpreted as a logical 1 (high). They all have a cutoff frequency of 40Hz.

  1. Cruise Control (Pin 5).
    This input sets the current motor speed as the set point for cruise control. Cruise control is disabled with the Brake input.
  2. Start (Pin 7).
    This input starts the inverter operation.
  3. Brake input (Pin 9).
    This input is connected to the brake pedal. It sets a configurable negative torque (regen) which overrides the throttle. I.e. if you press both, brake pedal and throttle, the throttle is ignored.
  4. Motor Protection switch or emergency stop (Pin 11).
    This input is connected to the thermal protection switch that is embedded into many motors. Its function is to inhibit the PWM signals when the motor overheats. This input directly controls the PWM signals without software interaction. The PWM is enabled as long as this input is high and shut down as soon as it goes low. If your motor does not have such a switch, tie the input high permanently.
  5. Forward (Pin 13).
    If this input is high the motor spins forward.
  6. Reverse (Pin 15).
    If this input is high the motor spins backward. When neither input is high the motor will not spin at all.
  7. Reserved input (Pin 17).
    This used to be an emergency stop input but I decided to reduce the number of HW stop pins. Emergency stop can now be chained to pin 11.
  8. BMS input (Pin 19).
    This input limits the motor torque (both negative and positive) if a BMS signals an over or undervoltage condition. It is active high, i.e. high means over/undervoltage.

There is one more digital inputs on JP3

  1. Error input (Pin 13)
    This pin is pulled high (5V). When pulled low an error is signalled and the PWM is inhibited

Digital outputs

There are 5 external open collector outputs on JP2. They sink up to 300mA each, DC contactor output can sink up to 600mA.

  1. DC contactor output (Pin 12)
    This output is activated when the bus voltage is above a given threshold and the start pin goes high. It is disabled on overcurrent, motor overheat and emergency stop.
  2. Error output (Pin 14)
    This output is activated on over current, motor overheat, emergency stop, throttle out of range.
  3. Voltage output (Pin 16)
    This output is activated when the bus voltage surpasses an upper or lower threshold.
  4. Precharge output (Pin 20)
    This output is activated when the inverter is powered up. It is disabled as soon as the DC contactor is enabled.
  5. Brake output (Pin 10)
    This output is high when potnom reaches a certain negative threshold. The purpose is to switch on the brake light on a certain regen level

PWM outputs

There is one external PWM output on JP2, Pin 18. It outputs a duty cycle that is proportional to the motor or heatsink temperature or speed. Its offset and gain is software configurable. The frequency is fixed to 17kHz. It is an open collector output so it can be used with most temperature gauges in cars. It can sink up to 300mA.

There are 6 internal PWM outputs on JP3. Pins 4, 8 and 12 provide a GND connection, Pins 1, 5 and 9 provide 5V. The outputs are 3.3V, 16mA.

  1. PWM Top phase 1 (Pin 2)
  2. PWM Bottom phase 1 (Pin 3)
  3. PWM Top phase 2 (Pin 6)
  4. PWM Bottom phase 2 (Pin 7)
  5. PWM Top phase 3 (Pin 10)
  6. PWM Bottom phase 3 (Pin 11)

There is a configurable dead time between top and bottom outputs.

Analog Inputs and over-current protection

There are 3 external analog inputs on JP2.

  1. Throttle input, 0-3.3V (Pin 6).
    Cutoff frequency 16Hz, input resistance 10k.
  2. Regen pot input, 0-3.3V (Pin 8).
    Cutoff frequency 16Hz, input resistance 10k.
  3. KTY83 temperature sensor input (Pin 22 positive, Pin 21 negative).
    Cutoff frequency 16Hz

There are 4 internal analog inputs on JP7. Pins 5, 7, 10, 15, 16 provide a GND connection, Pin 1,2, 8, 11, 12 provide stablelized 5V.

  1. Udc (Pin 4)
    Bus voltage input. 0-3.3V, cutoff frequency 16Hz
  2. Il1 (Pin 6)
    Current phase 1. 0V=-Imax, 1.67V=0A, 3.3V=Imax (software configurable). Cutoff frequency 48kHz.
  3. Il2 (Pin 9)
  4. Heatsink temperature (Pin 13), cutoff frequency 16Hz

The two current sensors are used for the programmable hardware over-current protection. A trip limit can be programmed that configures a hardware comparator. When the given current limit is hit, the PWM signals will be shut down without software interaction.

Position feedback

There is an input for a pulse encoder on JP2. Pin 3 can be connected to an open collector output of an encoder. Its input resistance is 500 Ohms. The cutoff frequency is 16kHz. E.g. a 60 pulses/rotation encoder can spin up to 18000 rpm before the limit is hit. By changing the value of R2 the cutoff frequency can be varied (lower value, higher frequency).

Alternatively Pin 1 and 3 can be connected to a quadrature encoder found embedded in many motors. It has better response than a single channel.

Additionally Pin 4 can be connected to an index pulse for future use with synchronous motors.

Pin 2 provides 5V with an output resistance of 120 Ohms to power the diode of an optical encoder with 30mA. You can bridge R7 to obtain plain 5V.

Alternatively Pin 1 and 3 can be connected to a sin/cos feedback device and Pin 4 can generate a resolver excitation sine wave. In that case Pin 2 provides 1.7V to make the resolver feedback unipolar.

Communication

JP1 provides a TTL level (3.3V) UART interface. It can be directly connected to the provided TTLUSB adapter. Pin 1 provides the 3.3V net of the Olimex board. It can be used to power the board or to power an external module like a Wifi or bluetooth transceiver. 400mA should not be exceeded. Pin 1 is 3V3, Pin 2 is GND,  Pin 3 is TX,  and Pin 4 is RX (Olimex UEXT compatible).

The communication parameters are fixed to 115200 8N2 (2 stop bits!) and may be raised to 921600.

There is a CAN interface on JP5. Pin 25 is CANL, Pin 26 is CANH

Power input

The main board contains a regulated buck converter to power all of its components. The allowed input voltage is 7-26V.

Pin Header Summary

Pin Header JP2

Pin Name
1 Encoder channel B/Resolver S3
2 30mA output for IR diode/Resolver center point S1S4
3 Encoder channel A or single channel input/Resolver S2
4 Index pulse input/Resover excitation R1
5 Cruise Control Input (12V)
6 Throttle Input (0-3.3V)
7 Start input (12V)
8 Regen Pot Input (0-3.3V)
9 Brake Input (12V)
10 Brake output (open collector 300mA)
11 Motor Protection Switch (12V, PWM inhibit when low)
12 DC contactor output (open collector 600mA)
13 Forward (12V)
14 Error Signal (open collector 300mA)
15 Reverse (12V)
16 Over/Under Voltage (open collector 300mA)
17 Reserved
18 Temperature PWM output (open collector 300mA)
19 BMS Over/Under Voltage input (12V)
20 Precharge Output (open collector 300mA)
21 Motor Temperature Input -
22 Motor Temperature Input +
23 GND
24 Vcc (7-26V)
25 CANL
26 CANH