Content guidelines
1、Problem to solve
Industrial battery banks with large scale., with voltage of 220V DC and stacked batteries.
On-Line Battery bank monitor with reasonable cost would be the most importance part. With Infineon CoolMOS C7 shall solve the problem with voltage, current, temperature with elastic control, fast response, compact in size and flexible in design.
With CoolMOS G7 MOSFET, the measuring circuit can be wired parallel, using CoolMOS G7 MOSFET as contactless switch to toggle measuring mode.
And the CoolMOS G7 MOSFET can replace mechanic relay and mechanical Protection Circuit Breaker to trip off the circuit when there is short-circuit or abnormal temperature rise on Fault Battery.
There are two CoolMOS G7 MOSFET shall be used for one-battery-pack, one for measuring circuit and one for Outgoing wire protection.
2. Hardware and software to build
2.1 There are many choice. The Nucleo-stm32F410RB is used in this design, the MCU balance the cost and performance in good condition.
Shun resistor for voltage and coulomp counting resistor for current sensing. The temperature sensor for is TI-tempsensor.
Other auxiliary parts, like LCD1602 and wirings etc.
2.2 The mbed.org can be good in design.
2.3 New hardware is included, THE MKR1000 arduino board WIFI.
2.4 The thingspeak API
3. Here is the program
3.1 Here is the program loop. Interrupt and Ticker are used.
3.2 Codes
The main part
InterruptIn control(USER_BUTTON);
InterruptIn protection(D0);
DigitalOut trip_protection(D0);
DigitalOut trip_control(D1);
Ticker mticker;
Ticker pticker;
int main(){
lcd.cls();
textLCD("Battery Monitor.", 1);
wait(2);
// Assign functions to button
protection.fall(&protection_on);
control.fall(&control_ON_OFF);
trip_protection=0;
trip_control= 0; // Start Close then trip on.
control_ON_OFF();
while(1){
//closeLCD();
} // end of while
} // end of main
The manually controlled On_Off status for the control, via One of the MOSFET,
void control_ON_OFF() {
trip_control = !trip_control;
if (trip_control == 1) {
led1= 1 ;
trip_protection=1;
textLCD("BMS is On. ", 0);
textLCD("Ready to go. ", 1);
wait(2);
//trip_control= 1;
textLCD("VOL= V", 0);
textLCD("CUR= mA", 1);
mticker.attach(&measuretick, MEASURESPAN);
pticker.attach(&protectick, 0.1);
}
else if (trip_control != 1) {
//trip_control= 0;
led1 = 0;
textLCD("BMS is Off. ", 0);
textLCD("Trip Off. ", 1);
mticker.detach();
wait(1);
//trip_protection=0;
//pticker.detach();
}
}
Another Protection pin vs another MOSFET.
void protection_on() {
...
}
Analogue to digital for A0, A1, A2 pins, trigger Protection if there is boolean FAULT.
void protectick() {
//char* meas_v,meas_i,meas_t;
float ana_read_a1,ana_read_a2,ana_read_a0;
bool fault;
ana_read_a1 = VOL_REF* (voltage_value.read()); // Read the analog input value (value from 0.0 to 1.0 = full ADC conversion range) and Converts value in the 0V-3.3V range
ana_read_a2 = CUR_REF* (current_value.read());
ana_read_a0 = TEM_REF* (temperature_value.read());
fault = (ana_read_a1 > VOLMAX) or (ana_read_a2 > CURMAX ) or (ana_read_a0 > TEMMAX);
printf("measure = %f:%f:%f.\n", ana_read_a1,ana_read_a2,ana_read_a0);
if (fault) {
trip_protection=0;
}
}
4. Wiring
4.1 Here is the wiring diagram
4.2 The conversion ratio for voltage in shun resistor and serial current resistor shall be fix according to calculation.
For conversion ratio of voltage = 1M /100k =10 times
For serial current sensing resistor of 10 ohms, divided by 10 in the code, as of
#define VOL_REF 3300 * 10 //With convert RATIO in shun resistors
#define CUR_REF 1000 / 10 //With 10ohm Resistor
4.3 Use of CoolMOS™ C7
As per the datasheet, the 5V is enough for CoolMOS™ C7 Drain-Gate drive voltage, that is shown in this diagram.
But for safety reason and fast response, one opti-MOSFET drive of 12V is necessary. I have FAIRCHILD FOD 8314 ready for better performance.
5. Demo RUNNING
5.1 Wiring according to the sketch
5.2 Plug and running
Comments