Skip to the content
2 layers172.9 × 81.5 mmMCB19, the printed circuit board in 3D

Modulo de carregamento das baterias auxiliares

Size
172.9 × 81.5 mm
Copper layers
2
Thickness
1.6 mm
Parts
137
Nets
68
Pads
398
Tracks, vias
1,308, 44
Pours
7
Routed
Yes
KiCad
KiCad 5 (file 20171130)
Created
2 Aug 2019
Updated
16 May 2025

Overview

MCB19 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 172.9 × 81.5 mm with 137 parts on 68 nets, routed with 1,308 tracks and 44 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 50 capacitors, 31 resistors, 14 diodes, 8 ICs and 8 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

137
QtyValueFootprintReferences
18100nFCapacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolderC201, C202, C205, C302, C303, C401, C402, C406, C407, C408, C409, C502, C503, C601, C605, C611 +2
10100nCapacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolderC615, C616, C619, C620, C622, C623, C624, C625, C626, C627
61uFCapacitor_Tantalum_SMD:CP_EIA-6032-20_AVX-F_Pad2.25x2.35mm_HandSolderC301, C304, C501, C504, C604, C628
6LL4148Diode_SMD:D_MiniMELF_HandsolderingD301, D401, D501, D601, D602, D603
510kResistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolderR203, R401, R410, R604, R605
412VDiode_SMD:D_MiniMELF_HandsolderingDZ601, DZ602, DZ603, DZ604
41kResistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolderR201, R402, R403, R611
422pFCapacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolderC203, C204, C403, C404
4330Resistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolderR404, R406, R616, R618
44.7uCapacitor_SMD:C_1206_3216Metric_Pad1.42x1.75mm_HandSolderC613, C614, C617, C618
447uFCapacitor_THT:CP_Radial_D12.5mm_P5.00mmC603, C608, C609, C610
4LED_REDLED_SMD:LED_0805_2012Metric_Pad1.15x1.40mm_HandSolderD402, D403, D607, D608
3680Resistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolderR407, R408, R409
3ES2ADiode_SMD:D_MiniMELF_HandsolderingD604, D605, D606
210RResistor_SMD:R_2512_6332MetricR607, R615
210RResistor_SMD:R_2512_6332Metric_Pad1.52x3.35mm_HandSolderR608, R617
215kResistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolderR609, R613
216MHzCrystal:Crystal_HC49-U_VerticalY201, Y401
21k2Resistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolderR610, R614
24700uFCapacitor_THT:CP_Radial_D12.5mm_P5.00mmC602, C621
247nFCapacitor_SMD:C_1210_3225Metric_Pad1.42x2.65mm_HandSolderC606, C607
24R7Resistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolderR602, R603
2IRFP260NPackage_TO_SOT_THT:TO-247-3_Horizontal_TabUpQ601, Q602
2RJ45KicadZeniteSolarLibrary18:RJ45_YH59_01J601, J602
1+BAT_INMountingHole:MountingHole_5.3mm_M5_Pad_ViaJ611
1+BAT_OUTMountingHole:MountingHole_5.3mm_M5_Pad_ViaJ613
1-BAT_INMountingHole:MountingHole_5.3mm_M5_Pad_ViaJ612
1-BAT_OUTMountingHole:MountingHole_5.3mm_M5_Pad_ViaJ614
11,5mRKicadZeniteSolarLibrary18:R_2512_6432Metric_ReversedR606
1100Resistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolderR411
110AFuse:Fuseholder_Cylinder-5x20mm_Stelvio-Kontek_PTF78_Horizontal_OpenF601
115AFuse:Fuseholder_Cylinder-5x20mm_Stelvio-Kontek_PTF78_Horizontal_OpenF602
1300uHKicadZeniteSolarLibrary18:Inductor_NocoupledL601
14k7Resistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolderR202
1500mAFuse:Fuse_1206_3216Metric_Pad1.42x1.75mm_HandSolderF501
150kResistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolderR601
190RResistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolderR612
1ATMEGA328P-PUPackage_DIP:DIP-28_W7.62mm_SocketU401
1BC847Package_TO_SOT_SMD:SOT-23Q604
1BC857Package_TO_SOT_SMD:SOT-23Q603
1CAN_HTestPoint:TestPoint_Pad_2.0x2.0mmTP207
1CAN_LTestPoint:TestPoint_Pad_2.0x2.0mmTP208
1DISABLEConnector_PinSocket_2.54mm:PinSocket_1x02_P2.54mm_VerticalJ402
1ENABLETestPoint:TestPoint_Pad_2.0x2.0mmTP402
1G5LE-1KicadZeniteSolarLibrary18:Relay_SPDT_SANYOU_SRD_Series_Form_CK601
1INA240A4DPackage_SO:SOIC-8_3.9x4.9mm_P1.27mmU602
1INTTestPoint:TestPoint_Pad_2.0x2.0mmTP209
1LM324Package_SO:SOIC-14_3.9x8.7mm_P1.27mmU603
1LM5104MNOPBPackage_SO:SOIC-8_3.9x4.9mm_P1.27mmU601
1LM7805KicadZeniteSolarLibrary18:TO-220-3_Horizontal_TabDown_SMDU301
1LM7812KicadZeniteSolarLibrary18:TO-220-3_Horizontal_TabDown_SMDU501
1MCP2515-xSOPackage_SO:SOIC-18W_7.5x11.6mm_P1.27mmU202
1MCP2551-I/SNPackage_SO:SOIC-8_3.9x4.9mm_P1.27mmU201
1PWMTestPoint:TestPoint_Pad_2.0x2.0mmTP401
1RXCANTestPoint:TestPoint_Pad_2.0x2.0mmTP204
1SCTestPoint:TestPoint_Pad_2.0x2.0mmTP205
1SCKTestPoint:TestPoint_Pad_2.0x2.0mmTP206
1SITestPoint:TestPoint_Pad_2.0x2.0mmTP201
1SOTestPoint:TestPoint_Pad_2.0x2.0mmTP202
1TXCANTestPoint:TestPoint_Pad_2.0x2.0mmTP203
1USARTConnector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ401
1pesd1canPackage_TO_SOT_SMD:SOT-23_HandsolderingD201

More from ZeniteSolar/MCB19

1
  • 2 layers256.5 × 172.9 mmMCB19 panel, the printed circuit board in 3D

    MCB19 panel

    ZeniteSolar/MCB19

    Modulo de carregamento das baterias auxiliares

    411 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 PCB?

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

What parts does the MCB19 use?

137 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 KiCad files?

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

Can I use the MCB19 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).