Skip to the content
2 layers256.5 × 172.9 mmMCB19 panel, the printed circuit board in 3D

Modulo de carregamento das baterias auxiliares

Size
256.5 × 172.9 mm
Copper layers
2
Thickness
1.6 mm
Parts
411
Nets
68
Pads
1,194
Tracks, vias
3,924, 1,132
Pours
21
Routed
Yes
KiCad
KiCad 5 (file 20171130)
Created
2 Aug 2019
Updated
16 May 2025

Overview

MCB19 panel is an open-source printed circuit board by ZeniteSolar, from the ZeniteSolar/MCB19 repository on GitHub, published under the GPL-3.0 licence. It is a 2-layer board of 256.5 × 172.9 mm with 411 parts on 68 nets, routed with 3,924 tracks and 1,132 vias.

It is built around the ATMEGA328P-PU, MCP2551-I/SN and INA240A4D, with the LM324, LM7805 and LM7812 among its other parts. Its parts include 150 capacitors, 93 resistors, 42 diodes, 24 ICs and 24 connectors. It belongs with the power and interfaces and adapters boards and the AVR (ATmega, ATtiny) boards of this library.

Main components

12

README

README.md

MCB19

hardware.docs hardware.check firmware.build firmware.docs CodeFactor

Módulo Carregamento das Baterias 2019

Embarcação Guarapuvu II

Equipe Zênite Solar

LICENSES

Sobre

Este módulo é responsável por carregar e gerenciar a carga da bateria auxiliar (rádio e bombas de porão) e da bateria extra (direção elétrica) a partir da energia da bateria principal.

Requisitos
  1. Carregar a bateria

    • Carregar por CC e CV

      • Controlar a tensao com controlador PI em cascata com controlador PI de corrente.
    • Proteções

      • Sobrecorrente na entrada e saída
      • Curto-circuito na entrada e saída
      • Sobre/sub-tensão na entrada e saída
      • Não permitir corrente da saída para a entrada: Um relé em série com a carga é usado para permitir a leitura da tensão na saída antes de entregar corrente para ela, seguindo as seguintes regras:
        • Somente ligar o relé da saída quando o sistema estiver em regime (sem oscilações na entrada ou na saída).
        • Somente ligar o relé da saída quando a tensão na bateria estiver em niveis dentro do esperado.
  2. Monitoramento do estado das baterias

    • Enviar pela rede CAN:
      • Corrente de carga
      • Tensão da bateria
      • Tensão da bateria principal

Abordagens

  1. Especificação do conversor
  • Tensão de entrada: 30-50V
  • Corrente de saida: 8A
  • Tensão de saida: 10-15V

Como no sistema, a tensão da bateria principal (entrada) será sempre maior que a tensão a tenão da bateria extra/auxiliar (saída), foi escolhido projetar um conversor estatico CC-CC Buck, com chaveamento síncrono (dois mosfets) para maior obter eficiencia.

Projeto do Buck
  • Para as condições especificadas anteriormente foram escolhidos:
    • Capacitor de saida: 200uF
    • Indutor de saida 300uH
  1. Controlador
  • Por sua simplicidade de implementação e por permitir ajustes empíricos, controladores PI foram escolhidos para controlar tanto a tensão de saída quanto a corrente de saída.

Referencia

  1. Simulações
  • Para a simulação foi usado o programa Psim pois ele oferece a simulação de bloco C onde foi possivel simular de uma forma simplificada o comportamento do atmega328p, alem de ter ferramentas para controle.
  1. Hardware
  • Para o design da Placa de circuito impresso (PCB) foi utilizado o software KiCad por ser uma ferramenta OpenSource. A PCB foi fabricada usando transferencia termica.
É importante a utilização de snubber para amortecer os picos de tensão nas chaves
  1. Firmware
  • A cada interrupção do ADC é chamada a função de controle. Ao finalizar a maquina de estados é executada onde as mensagens CAN são enviadas e recebidas.

src/conf.h

Configurações gerais do sistema

C
//#Definições do conversor
#define VO_SETPOINT 	13.2
#define IO_MAX      	8
#define VI_MIN      	21

src/adc.c

No arquivo adc.c são lidos os valores dos ADCs e convertidos a valores "humanos", tambem é chamada a função de controle

  • Coeficientes de linearização
    • Com estes coeficientes é convertido o valor lido pelo ADC em uma unidade de medida
C
    static const float vi_coeff = 0.06582490575070313f;                                         
    static const float vo_coeff = 0.06717781789490249f;                          
    static const float io_coeff = 0.01599315004f; 

src/control.c

No arquivo control.c é executado o algoritmo de controle (PiVo em cascata com PiIo), para sintonizar o controlador tem que mudar as constantes Kp e Ti

C
/*          PI CONTROL ALGORITHM - SERIES IMPLEMENTATION
** /desc    Algoritimo para Controlador Proporcional Integrativo Diferencial.
**  ref1: 
https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/902/PI-controller-equations.pdf

** /var r é o valor desejado para a saída, o 'set-point'.
** /var y é o valor da saída.
** /ret     retorna a ação de controle u.
*/
inline float piVo(float r, float y){
    // PI CONFIGURATIONS:
    const float Kp = 0.5;           // analog series proportional gain
    const float Ti = 0.1;          // analog series integration period
    const float Ts = PERIOD;        // digital sampling period

    // INTERNAL CONSTANTS COMPUTATION:
    const float a0 = -Kp;           // IIR coefficient for old sample
    const float a1 = Kp*(1+Ts/Ti);  // IIR coefficient for new sample

    // CONTROLLER STATIC VARIABLES
    static float e0 = 0;            // old error
    static float e1 = 0;            // new error
    static float u = 0;             // control action

src/machine.c

No arquivo machine.c é executada a maquina de estados

C
inline void machine_run(void)                                                    
{                                                                                   
    if(print_adc){ print_infos(); print_adc = 0;}                                   
                                                                                    
    if(machine_clk){                                                                
        machine_clk = 0;                                                            
                                                                                    
        if(error_flags.all){                                                        
            print_system_flags();                                                   
            print_error_flags();                                                    
            print_infos();                                                          
            set_state_error();                                                      
        }                                                                           
                                                                                    
        switch(state_machine){                                                      
            case STATE_INITIALIZING:                                                
                task_initializing();                                                
                                                                                    
                break;                                                              
            case STATE_IDLE:                                                        
                task_idle();                                                                    
                                                                                    
                break;                                                              
            case STATE_RUNNING:                                                     

Parts

411
QtyValueFootprintReferences
54100nFCapacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolderC201, C201, C201, C202, C202, C202, C205, C205, C205, C302, C302, C302, C303, C303, C303, C401 +38
30100nCapacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolderC615, C615, C615, C616, C616, C616, C619, C619, C619, C620, C620, C620, C622, C622, C622, C623 +14
181uFCapacitor_Tantalum_SMD:CP_EIA-6032-20_AVX-F_Pad2.25x2.35mm_HandSolderC301, C301, C301, C304, C304, C304, C501, C501, C501, C504, C504, C504, C604, C604, C604, C628 +2
18LL4148Diode_SMD:D_MiniMELF_HandsolderingD301, D301, D301, D401, D401, D401, D501, D501, D501, D601, D601, D601, D602, D602, D602, D603 +2
1510kResistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolderR203, R203, R203, R401, R401, R401, R410, R410, R410, R604, R604, R604, R605, R605, R605
1212VDiode_SMD:D_MiniMELF_HandsolderingDZ601, DZ601, DZ601, DZ602, DZ602, DZ602, DZ603, DZ603, DZ603, DZ604, DZ604, DZ604
121kResistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolderR201, R201, R201, R402, R402, R402, R403, R403, R403, R611, R611, R611
1222pFCapacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolderC203, C203, C203, C204, C204, C204, C403, C403, C403, C404, C404, C404
12330Resistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolderR404, R404, R404, R406, R406, R406, R616, R616, R616, R618, R618, R618
124.7uCapacitor_SMD:C_1206_3216Metric_Pad1.42x1.75mm_HandSolderC613, C613, C613, C614, C614, C614, C617, C617, C617, C618, C618, C618
1247uFCapacitor_THT:CP_Radial_D12.5mm_P5.00mmC603, C603, C603, C608, C608, C608, C609, C609, C609, C610, C610, C610
12LED_REDLED_SMD:LED_0805_2012Metric_Pad1.15x1.40mm_HandSolderD402, D402, D402, D403, D403, D403, D607, D607, D607, D608, D608, D608
9680Resistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolderR407, R407, R407, R408, R408, R408, R409, R409, R409
9ES2ADiode_SMD:D_MiniMELF_HandsolderingD604, D604, D604, D605, D605, D605, D606, D606, D606
610RResistor_SMD:R_2512_6332MetricR607, R607, R607, R615, R615, R615
610RResistor_SMD:R_2512_6332Metric_Pad1.52x3.35mm_HandSolderR608, R608, R608, R617, R617, R617
615kResistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolderR609, R609, R609, R613, R613, R613
616MHzCrystal:Crystal_HC49-U_VerticalY201, Y201, Y201, Y401, Y401, Y401
61k2Resistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolderR610, R610, R610, R614, R614, R614
64700uFCapacitor_THT:CP_Radial_D12.5mm_P5.00mmC602, C602, C602, C621, C621, C621
647nFCapacitor_SMD:C_1210_3225Metric_Pad1.42x2.65mm_HandSolderC606, C606, C606, C607, C607, C607
64R7Resistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolderR602, R602, R602, R603, R603, R603
6IRFP260NPackage_TO_SOT_THT:TO-247-3_Horizontal_TabUpQ601, Q601, Q601, Q602, Q602, Q602
6RJ45KicadZeniteSolarLibrary18:RJ45_YH59_01J601, J601, J601, J602, J602, J602
3+BAT_INMountingHole:MountingHole_5.3mm_M5_Pad_ViaJ611, J611, J611
3+BAT_OUTMountingHole:MountingHole_5.3mm_M5_Pad_ViaJ613, J613, J613
3-BAT_INMountingHole:MountingHole_5.3mm_M5_Pad_ViaJ612, J612, J612
3-BAT_OUTMountingHole:MountingHole_5.3mm_M5_Pad_ViaJ614, J614, J614
31,5mRKicadZeniteSolarLibrary18:R_2512_6432Metric_ReversedR606, R606, R606
3100Resistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolderR411, R411, R411
310AFuse:Fuseholder_Cylinder-5x20mm_Stelvio-Kontek_PTF78_Horizontal_OpenF601, F601, F601
315AFuse:Fuseholder_Cylinder-5x20mm_Stelvio-Kontek_PTF78_Horizontal_OpenF602, F602, F602
3300uHKicadZeniteSolarLibrary18:Inductor_NocoupledL601, L601, L601
34k7Resistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolderR202, R202, R202
3500mAFuse:Fuse_1206_3216Metric_Pad1.42x1.75mm_HandSolderF501, F501, F501
350kResistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolderR601, R601, R601
390RResistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolderR612, R612, R612
3ATMEGA328P-PUPackage_DIP:DIP-28_W7.62mm_SocketU401, U401, U401
3BC847Package_TO_SOT_SMD:SOT-23Q604, Q604, Q604
3BC857Package_TO_SOT_SMD:SOT-23Q603, Q603, Q603
3CAN_HTestPoint:TestPoint_Pad_2.0x2.0mmTP207, TP207, TP207
3CAN_LTestPoint:TestPoint_Pad_2.0x2.0mmTP208, TP208, TP208
3DISABLEConnector_PinSocket_2.54mm:PinSocket_1x02_P2.54mm_VerticalJ402, J402, J402
3ENABLETestPoint:TestPoint_Pad_2.0x2.0mmTP402, TP402, TP402
3G5LE-1KicadZeniteSolarLibrary18:Relay_SPDT_SANYOU_SRD_Series_Form_CK601, K601, K601
3INA240A4DPackage_SO:SOIC-8_3.9x4.9mm_P1.27mmU602, U602, U602
3INTTestPoint:TestPoint_Pad_2.0x2.0mmTP209, TP209, TP209
3LM324Package_SO:SOIC-14_3.9x8.7mm_P1.27mmU603, U603, U603
3LM5104MNOPBPackage_SO:SOIC-8_3.9x4.9mm_P1.27mmU601, U601, U601
3LM7805KicadZeniteSolarLibrary18:TO-220-3_Horizontal_TabDown_SMDU301, U301, U301
3LM7812KicadZeniteSolarLibrary18:TO-220-3_Horizontal_TabDown_SMDU501, U501, U501
3MCP2515-xSOPackage_SO:SOIC-18W_7.5x11.6mm_P1.27mmU202, U202, U202
3MCP2551-I/SNPackage_SO:SOIC-8_3.9x4.9mm_P1.27mmU201, U201, U201
3PWMTestPoint:TestPoint_Pad_2.0x2.0mmTP401, TP401, TP401
3RXCANTestPoint:TestPoint_Pad_2.0x2.0mmTP204, TP204, TP204
3SCTestPoint:TestPoint_Pad_2.0x2.0mmTP205, TP205, TP205
3SCKTestPoint:TestPoint_Pad_2.0x2.0mmTP206, TP206, TP206
3SITestPoint:TestPoint_Pad_2.0x2.0mmTP201, TP201, TP201
3SOTestPoint:TestPoint_Pad_2.0x2.0mmTP202, TP202, TP202
3TXCANTestPoint:TestPoint_Pad_2.0x2.0mmTP203, TP203, TP203
3USARTConnector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ401, J401, J401
3pesd1canPackage_TO_SOT_SMD:SOT-23_HandsolderingD201, D201, D201

More from ZeniteSolar/MCB19

1
  • 2 layers172.9 × 81.5 mmMCB19, the printed circuit board in 3D

    MCB19

    ZeniteSolar/MCB19

    Modulo de carregamento das baterias auxiliares

    137 parts2GPL-3.0

Similar boards

  • 2 layers170.2 × 137.2 mmMCS19, the printed circuit board in 3D

    MCS19

    ZeniteSolar/MCS19

    Módulo de Carregamento do Sistema da embarcação solar Guarapuvu II (Zênite Solar)

    160 parts1GPL-3.0
  • 2 layers232.1 × 131.2 mmPanel, the printed circuit board in 3D

    Panel

    ZeniteSolar/MSC19

    Voltage or Current Sensor Module for CANBUS with ATmega328p

    313 partsGPL-3.0
  • 2 layers63 × 108 mmMSC25, the printed circuit board in 3D

    MSC25

    ZeniteSolar/MSC25

    Este projeto consiste em uma placa de circuito impresso (PCB) com firmware embarcado, projetada para realizar a leitura de alta precisão de um sensor de corrente de efeito Hall e transmitir os dados através do…

    61 parts
  • 2 layers239.3 × 121.3 mmPanel, the printed circuit board in 3D

    Panel

    ZeniteSolar/MT19

    Tachometer Module for CANBUS with ATmega328p

    252 parts2GPL-3.0
  • 2 layersMAB19 PANEL, the printed circuit board in 3D

    MAB19 PANEL

    ZeniteSolar/MAB20

    340 partsGPL-3.0
  • 2 layers122.6 × 52.7 mmZeniteTemplate2022, the printed circuit board in 3D

    ZeniteTemplate2022

    ZeniteSolar/MAC22

    Modulo de acionamento da contatora 2022

    63 parts
  • 2 layers248 × 174.4 mmPanel, the printed circuit board in 3D

    Panel

    ZeniteSolar/MCC_CAN_Shield

    294 partsGPL-3.0
  • 2 layers228 × 149.8 mmMIC19, the printed circuit board in 3D

    MIC19

    ZeniteSolar/MIC19

    Módulo de Interface do Controle da embarcação solar Guarapuvu II (Zênite Solar)

    300 partsGPL-3.0

Questions

How big is the MCB19 panel PCB?

It measures 256.5 × 172.9 mm and has 2 copper layers, 1.6 mm thick.

What parts does the MCB19 panel use?

411 parts, built around the ATMEGA328P-PU, MCP2551-I/SN, INA240A4D and LM324. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the MCB19 panel KiCad files?

From the ZeniteSolar/MCB19 repository on GitHub, at the commit this page was made from: the board is hardware/MCB19_panel.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.

Can I use the MCB19 panel design in my own project?

Its repository publishes it under the GPL-3.0 licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).