Control using Cold Gas Propulsion System

I am designing a CubeSat mission for technology demonstration of proximal operations and docking in space. For preliminary analysis, I designed a non linear translational relative motion model with force on chaser satellite as an input. As I got down to model the propulsion system, I found myself confused. Some information about the model:

  • Linearised the non linear model around 0 relative position and 0 relative velocity to obtain Clohessy Wiltshire Equations. The input is considered to be Force, so the B matrix is essentially 1/m* [zeros(3,3);eye(3)]. This model is used for computing LQR gain. (The simulation model is still non linear)
  • Thruster produces almost constant thrust (Fnominal), what is controlled is the valve status (ON/OFF) in a PWM fashion
  • Thuster configuration I decided is a tetrahedron with thrust vector directions meeting at center of mass of CubeSat. This ensures that no moment is produced; only translational control

Now if I model the actuator
f = Bu where

f is 3x1 vector of forces and u is the 4x1 vector of valve states (0 or 1)
The B matrix here comes from placement of thrusters and is equal to

B = (1/srt(3))*[1,1,-1,-1;1,-1,-1,1;-1,1,-1,1]

Now this approach seemed a bit confusing as at every time step, we compute for valve status. From literature, I understand that we usually use a PWM signal for controlling a cold gas propulsion system

So I changed the definition of u to be force commanded to each thruster fthruster(4x1)
Now If I add a control allocator; a pseudo-inverse of this B matrix I can compute
fthruster from u = (B+)*f where f comes from the feedback controller (LQR)

This is then fed to Ton,i = Tpwm*(|fthruster,i|/Fnominal) which produces a Ton vector (4x1)
representing time for which the thruster will be ON and is compared with a sawtooth wave to generate PWM signal to the dynamics block.

I am a bit confused with this approach, and it isnt working on simulation. It is not converging the states to 0. Also the control allocator is demaning negative thrust from thrusters which is not physically realisable; should I keep the thrusters that get negative fthruster demands OFF?

I tried testing these blocks separately and these are the outputs. The Propulsion system is modelled as a static gain (Fnominal) multiplied by the B matrix defined earlier which converts fthruster to force vector (3x1)

https://preview.redd.it/cv2mktk1hf9e1.png?width=1509&format=png&auto=webp&s=bc55eedeae52893493ceffede31ffa7cf50be870

TLDR; Confused with control using PWM for Cold Gas Propulsion Systems where thrust is consant and you are basically controlling the impulse. Also not able to figure out control allocation between different thrusters.

Any help or direction to any sources will be highly appreciated. Thanks!