I'm having some trouble simulating the behaviour of a bidirectional buck-boost converter for battery charging purposes. The circuit looks as follows:
I would like to create an averaged state-space presentation for the converter using the following state vector: x = [iL,vC1,vC2]T, the input being u = [io,vi]T (so inputting the battery current and bus voltage), and output y = [ii, vo]T. Here lies the problem, however, as the bus voltage is equal to one of my states, vC1. I want to use the bus voltage as an input when I am charging the battery, but I would like to model the converter as a standalone state-space equation so I can use it later in a bigger project.
In general I am familiar with averaged state-space presentations but the fact that I need to have an input that's equal to one of my states is confusing me... I could take ii (bus current) as the input instead, but doing so I wouldn't be able to make sure that the bus voltage stays at my predefined level. Also, I think it might be problematic to have both ii and io as inputs, would it not? because in the steady-state, you'd end up with an overdetermined system (knowing io, ii and Duty).
Any thoughts on this or a good book recommendation would be highly appreciated!