The precharge circuit runs entirely based on hardware (i.e. no firmware is required).
Fig 1. Pre-charge Logic - HV line for pre-charging
Figure 1 shows the high voltage side of the pre-charge board. HV_IN is where the circuit is connected to the battery. The two MOSFETs connected in parallel act as a switch which connects our HV line to the motor controllers. The MOSFETs are put in parallel because parallel MOSFETs will balance out, distributing the current a bit and overall handling the load better. This switch will also disconnect the pre-charge circuit once the pre-charge is complete. The line contains four power resistors before the motor controller each rated at 100W, limiting the inrush current. After the motor controller is two resistors in parallel which act as discharge resistors.
Things to research:
- MOSFETs
- N-channel vs P-channel
- Parallel MOSFETs
- Power resistors vs normal resistors
Fig 2. Pre-charge HV - power resistors Fig 3. Pre-charge Logic - comparator
Fig 1 shows the power resistors used to limit the current when pre-charging with two voltage dividers connected to either side. The voltage dividers connected to the left and right sides of the power resistors are used to compare the voltage of the battery and motor controllers and set to reduce the 150V from the HV line to 9.39V on the battery side and 9.84V on the motor controller side. Basically, if the pre-charge circuit is on, IN- will be 9.34V, and IN+ will rise from 0V to 9.84V. Aside from lowering the voltage, the resistances used in the voltage dividers are set such that when the motor controller reaches 95% of the voltage on the battery side, IN+ will be greater than IN-.
Fig 2 shows an op-amp comparator taking in IN+ and IN- as its non-inverting and inverting inputs respectively. This comparison will output a logic high when IN+ is greater than IN-, effectively signaling that the motor controller has reached 95% of the battery's voltage and pre-charge is complete. The op-amp is set with a positive feedback loop to prevent the comparator from outputting a logic high when the op-amp is powered but its inputs are unpowered. This is an issue as, when the circuit is transitioning from a logic high to a logic low, it may bounce multiple times. The positive feedback latches the output to a logic high and makes it so there must be a significant difference between IN+ and IN- to switch the output.