Main Content

CC-CV Charging (Proportional Control)

Constant-current constant-voltage charging algorithm with proportional control

Since R2025a

Libraries:
Simscape / Battery / BMS / Current Management

Description

The CC-CV Charging (Proportional Control) block implements a constant-current (CC), constant-voltage (CV) charging algorithm for a battery with proportional control. To implement the CC-CV charging algorithm with proportional-integral control, see the Battery CC-CV block.

This block supports single-precision and double-precision floating-point simulation.

Note

To enable inherited single-precision floating-point simulation, the data type of all inputs and parameters, except for the Sample time (-1 for inherited) parameter, must be single.

To configure the block for discrete time, set the Sample time (-1 for inherited) parameter to a positive, nonzero value. To inherit the sample time from an upstream block, set the Sample time (-1 for inherited) parameter to -1.

This diagram illustrates the overall structure of the block:

Internal structure of the CC-CV Charging (Proportional Control) block

Equations

This block implements the CC-CV algorithm in constant-current and constant-voltage modes. This figure shows the operation of these modes:

Operation mode of CC-CV algorithm. The blue line shows the charge current, the red line shows the voltage, the green line shows the charge capacity.

This equation defines the battery charging current that the block outputs at the discrete-time instant k:

ichg(k)={Maximumchargecurrent,ifbatteryischargingandvmax<vthresholdKp(vthresholdvmax)+ichg(k1),ifbatteryischargingandvmaxvthreshold0,ifbatteryisnot charging

where

  • ichg(k) is the charging current at time instant k.

  • ichg(k-1) is the charging current at the previous time instant.

  • vmax is the voltage of the highest cell.

  • vthreshold is the maximum allowable cell voltage.

  • Kp is the value of the Controller proportional gain parameter.

Ports

Input

expand all

Whether to enable battery charging, specified as 1 (enabled) or 0 (disabled).

Voltage of the battery cells, specified as a scalar for a single cell or a vector for multiple cells.

If you select the Specify CellVoltage input as [Min,Max] parameter, you must specify a minimum and a maximum value for this port, for example CellVoltage=[CellVoltageMin,CellVoltageMax].

Limit of the current that the battery uses for charging, specified as a scalar.

Maximum allowable cell voltage, specified as a scalar.

Output

expand all

Charging current command, returned as a scalar.

Parameters

expand all

To edit block parameters interactively, use the Property Inspector. From the Simulink® Toolstrip, on the Simulation tab, in the Prepare gallery, select Property Inspector.

Option to specify the value at the CellVoltage input port as a vector of minimum and maximum values. If you clear this parameter, you must specify an individual value for the input port. The block then calculates the minimum and maximum values internally.

Proportional gain, Kp, of the controller.

Time between consecutive block executions. During execution, the block produces outputs and, if appropriate, updates its internal state. For more information, see What Is Sample Time? and Specify Sample Time.

For inherited discrete-time operation, specify this parameter as -1. For discrete-time operation, specify this parameter as a positive integer.

Extended Capabilities

expand all

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Version History

Introduced in R2025a