Main Board Version 3
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:
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.
- 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.
- Start (Pin 7). This input starts the inverter operation.
- 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.
- 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.
- Forward (Pin 13). If this input is high the motor spins forward.
- Reverse (Pin 15). If this input is high the motor spins backward. When neither input is high the motor will not spin at all.
- 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.
- 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
- Error input (Pin 13) This pin is pulled high (5V). When pulled low an error is signalled and the PWM is inhibited
There are 5 external open collector outputs on JP2. They sink up to 150mA each, DC contactor output can sink up to 300mA.
- 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.
- Error output (Pin 14) This output is activated on over current, motor overheat, emergency stop, throttle out of range.
- Voltage output (Pin 16) This output is activated when the bus voltage surpasses an upper or lower threshold.
- 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.
- 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
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.
- PWM Top phase 1 (Pin 2)
- PWM Bottom phase 1 (Pin 3)
- PWM Top phase 2 (Pin 6)
- PWM Bottom phase 2 (Pin 7)
- PWM Top phase 3 (Pin 10)
- 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.
- Throttle input, 0-3.3V (Pin 6). Cutoff frequency 16Hz, input resistance 10k.
- Regen pot input, 0-3.3V (Pin 8). Cutoff frequency 16Hz, input resistance 10k.
- 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.
- Udc (Pin 4) Bus voltage input. 0-3.3V, cutoff frequency 16Hz
- Il1 (Pin 6) Current phase 1. 0V=-Imax, 1.67V=0A, 3.3V=Imax (software configurable). Cutoff frequency 48kHz.
- Il2 (Pin 9)
- 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.
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.
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
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
|1||Encoder channel B/Resolver S3|
|2||GND/Resolver center point S1S4|
|3||Encoder channel A or single channel input/Resolver S2|
|4||Index pulse input/5V output/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 300mA)|
|14||Error Signal (open collector 150mA)|
|16||Over/Under Voltage (open collector 150mA)|
|18||Temperature PWM output (open collector 150mA)|
|19||BMS Over/Under Voltage input (12V)|
|20||Precharge Output (open collector 150mA)|
|21||Motor Temperature Input -|
|22||Motor Temperature Input +|