Mini Mainboard

From openinverter.org wiki
Revision as of 15:14, 7 October 2023 by Johu (talk | contribs) (copied over pin descriptions from V3 board)
Jump to navigation Jump to search
Mini mainboard front

The mini mainboard is the smallest form factor openinverter motor control board. It has the same functionality as the Main Board Version 3 but offloads a few components. It is meant to be used as a daughter board on top of an adapter board. The adapter board must (or may) implement:

  • The Wifi module socket
  • Relay drivers

In addition the mini mainboard allows talking to SPI peripherals. Therefore some pins have double mapping:

  • SIG_CRUISE: MOSI (SJ3 must be closed to the right side for that).
  • OUT_BRAKE: MISO
  • OUT_ERR: SCK
  • OUT_OUVTG: /CS

Like previous boards it contains a 5V switching regulator that can be loaded with about 500 mA. Alternatively It can be powered with a single 5V rail, which has to sit at 5.3V though for sufficient resolver excitation amplitude.

As opposed to earlier mainboards the current sensor inputs are now designed for 5V input, i.e. 2.5V @ 0A. This interfaces directly with most current sensors that OEMs use and also with Melexis chips, LEM HTFS and Tamura L06P current sensors.


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. Tie this to +12V (otherwise the inverter won't start using the 'start' switch)
  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 are switch via a uln2003 driver, each output can sink (makes a connection to ground) up to 150mA each

schematic (v2)
  • The precharge output (OUT_PRE, pin 20) has two paralleled outputs, resulting in a maximum sinkage of 500mA.
  • The DC contactor (OUT_DCSW, pin 12) output is is switch via a additional N-Chanel mosfet, which can sink up to 1-2amps.

There's no econimizer system built into the openinverter board, so make sure your contactors have the appropriate economizing circuits .

  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


*note: there's 2 versions of the main board v3, the old board lacked the high current output drivers for the contractor control. This old version is only capable of sinking up to 300mA for the OUT_DCSW and 150mA for OUT_PRE.

Pictured in: "Main board (v1)"

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 150mA.

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. Frequency is configurable to 4.4, 8.8 or 17.6kHz.

  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 stabilized 5V.

  1. Udc (Pin 4) Bus voltage input. 0-3.3V, cutoff frequency 16Hz
  2. Il1 (Pin 6) Current phase 1. 0V=-Imax, 2.5V=0A, 5V=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 4 optionally provides 5V to power an optical encoder. To do that you have to bridge R28 (or put an application specific value there). You can also bridge R1 to get a GND connection on pin 2

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 a TTLUSB adapter or an Olimex ESP8266 wifi module. Pin 1 provides the 3.3V. 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 Signal Name
1 ENC_B/S3 Encoder channel B/Resolver S3
2 SJ4 GND/Resolver center point S1S4
3 ENC_A/S2 Encoder channel A or single channel input/Resolver S2
4 ENC_Z/R1 Index pulse input/5V output/Resover excitation R1
5 SIG_CRUISE Cruise Control Input (12V)
6 THROTTLE1 Throttle Input (0-3.3V)
7 SIG_START Start input (12V)
8 THROTTLE2 Regen Pot Input (0-3.3V)
9 SIG_BRAKE Brake Input (12V)
10 OUT_BRAKE Brake output (open collector 300mA)
11 SIG_MPROT Motor Protection Switch (12V, PWM inhibit when low)
12 OUT_DCSW DC contactor output (open collector 300mA)
13 SIG_FORWARD Forward (12V)
14 OUT_ERR Error Signal (open collector 150mA)
15 SIG_REVERSE Reverse (12V)
16 OUT_OVTMP Over/Under Voltage (open collector 150mA)
17 SIG_EMCYSTOP Reserved
18 OUT_TEMP Temperature PWM output (open collector 150mA)
19 SIG_BMS BMS Over/Under Voltage input (12V)
20 OUT_PRE Precharge Output (open collector 150mA)
21 MTEMP- Motor Temperature Input -
22 MTEMP+ Motor Temperature Input +
23 GND GND
24 VCC Vcc (7-26V)
25 CANL CANL
26 CANH CANH


Hardware detection

Because the mini mainboard is primarily meant to be mounted on some sort of base board, we wanted to introduce a detection mechanism for the base board in case any special treatment is needed.

We chose to assign a secondary meaning to the OUT_BRAKE pin because its level can be measured by the ADC. So OUT_BRAKE can be brought to a certain voltage level with a high impedance voltage divider. The voltage level encodes the hardware variant. It will not disturb normal operation because its total resistance is chosen at least one order of magnitude larger than the output impedance of OUT_BRAKE, which is about 270 Ohms.

A the upper voltage divider resistor R1 is connected to the "5V" rail which actually sits at 5.3V. R2 is connected to GND

Variant R1 R2 voltage ADC +/-5% range
- 47k 2k7 0.29 V 357 339-375
- 47k 3k3 0.35 V 431 409-453
- 47k 3k9 0.41 V 504 479-529
Nissan Leaf Gen3 47k 4k7 0.48 V 598 568-628
- 47k 5k1 0.52 V 643 611-675
- 47k 5k6 0.56 V 700 665-735
- 47k 6k8 0.67 V 831 789-873
- 47k 7k5 0.73 V 905 860-950
- 47k 8k2 0.79 V 977 928-1026
- 47k 9k1 0.86 V 1067 1014-1120
- 47k 10k 0.93 V 1154 1096-1212