**FSM details**

javascript`1 "Entered state INIT" 1 "Log: 'Initializing environment...'" 1 "Log: 'Environment initialized !'" 1 "Log: 'Initializing battery IC...'" 1 "Log: 'Battery IC initialized !'" 1 "Log: 'Configuring battery IC...'" 2 "Log: 'Battery IC configured !'" 2 "Log: 'Initializing SoH...'" 2 "Log: 'SoH initialized !'" 2 "Log: 'Waiting for BQ cells readings...'" 2 "Log: 'Initializing SoC...'" 3 "Log: 'SoC initialized !'" 3 "Log: 'State fields initialized!'" 3 "Log: 'Battery initialization complete!'" 3 "Left state INIT" 3 "Entered state IDLE" 3 "Log: 'transitioning from INIT to IDLE'" 5 "Left state IDLE" 5 "Entered state CHARGE" 2858 "Log: 'Charge leaves charge-and-balance mode'" 2858 "Log: 'Charge enters rebalance mode'" 3161 "Log: 'Battery not fully charged'" 3161 "Log: 'Charge leaves rebalance mode'" 3161 "Log: 'Charge enters charge-and-balance mode'" 3347 "Log: 'Battery is fully charged'" 3347 "Log: 'Charge leaves charge-and-balance mode'" 3347 "Log: 'Charge enters rebalance mode'" 3649 "Log: 'Battery not fully charged'" 3649 "Log: 'Charge leaves rebalance mode'" 3649 "Log: 'Charge enters charge-and-balance mode'" 3761 "Log: 'Battery is fully charged'" 3761 "Log: 'Charge leaves charge-and-balance mode'" 3761 "Log: 'Charge enters rebalance mode'" 4064 "Log: 'Battery not fully charged'" 4064 "Log: 'Charge leaves rebalance mode'" 4064 "Log: 'Charge enters charge-and-balance mode'" 4142 "Log: 'Battery is fully charged'" 4142 "Log: 'Charge leaves charge-and-balance mode'" 4142 "Log: 'Charge enters rebalance mode'" 4445 "Log: 'Battery not fully charged'" 4445 "Log: 'Charge leaves rebalance mode'" 4445 "Log: 'Charge enters charge-and-balance mode'" 4503 "Log: 'Battery is fully charged'" 4503 "Log: 'Charge leaves charge-and-balance mode'" 4503 "Log: 'Charge enters rebalance mode'" 4866 "Log: 'Charge enters charge-and-balance mode'" 4916 "Log: 'Battery is fully charged'" 4916 "Log: 'Charge leaves charge-and-balance mode'" 4916 "Log: 'Charge enters rebalance mode'" 5484 "Log: 'Battery not fully charged'" 5484 "Log: 'Charge leaves rebalance mode'" 5484 "Log: 'Charge enters charge-and-balance mode'" 5533 "Log: 'Battery is fully charged'" 5533 "Log: 'Charge leaves charge-and-balance mode'" 5533 "Log: 'Charge enters rebalance mode'" 6361 "Log: 'Battery not fully charged'" 6361 "Log: 'Charge leaves rebalance mode'" 6361 "Log: 'Charge enters charge-and-balance mode'" 6410 "Log: 'Battery is fully charged'" 6410 "Log: 'Charge leaves charge-and-balance mode'" 6410 "Log: 'Charge enters rebalance mode'" 7457 "Log: 'Battery not fully charged'" 7457 "Log: 'Charge leaves rebalance mode'" 7458 "Log: 'Charge enters charge-and-balance mode'" 8933 "Log: 'Battery not fully charged'" 8933 "Log: 'Charge leaves rebalance mode'" 8933 "Log: 'Charge enters charge-and-balance mode'" 8966 "Log: 'Battery is fully charged'" 8966 "Log: 'Charge leaves charge-and-balance mode'" 8966 "Log: 'Charge enters rebalance mode'" 9268 "Log: 'Battery is balanced'" 9268 "Log: 'Last Charge FSM state: rebalance'" 9268 "Left state CHARGE" 9268 "Entered state IDLE" 9268 "Log: 'transitioning from CHARGE to IDLE'"`

💡

We have a little bit of unbalancing, but it’s negligible, as cells were a little bit unbalanced at the begin.
Battery bounce between

`Charge And Balance`

and `Rebalance`

until all cells are balanced, then end the charge.
The algorithm flow is respected without any issue !