this is my first question so I'm sorry if the explanation will be a bit confused.
I'm trying to implement a Sliding Mode Control for an orbital rendezvous based on this paper . I'm considering a target on a circular orbit and a chaser equipped with 12 thrusters of thrust T, three for every corner as showed in the paper.
I made up my simulink model with the dynamics block (I'm using Hills equations) and the control block based on what's written in the paper: U=2T*sign(s) where T is the force of a single thruster and s is the switching function which tells the control whether the chaser is on the desired position and velocity.
Now, everything seems pretty straightforward here but I'm observing a very bizzarre behaviour from Simulink depending on my initial state X0=[x0,y0,z0,vx0,vy0,vz0] and the command (that I first impose as constant) Xd=[xd,yd,zd,vxd,vyd,vzd]: while in most of the cases the control converges and the ODEs are solved automatically with ODE45, in some cases the solver becomes ODE15s. While this shouldn't be a problem per se I don't understand this behaviour: how could Hills equations become stiff basing on initial conditions? Consider that the module of the components of the control vector U is either 0 or has a fixed absolute value since T is constant for the nature of the thrusters.
Anyway it would not be a problem if only matlab didn't stop at some point while integrating using ODE15s giving the following error:
"An error occurred while running the simulation and the simulation was terminated Caused by: Solver encountered an error while simulating model 'Sliding_mode_controller' at time 105.82931100325138 and cannot continue. Please check the model for errors. Nonlinear iteration is not converging with step size reduced to hmin (3.75981E-13) at time 105.829. Try reducing the minimum step size and/or relax the relative error tolerance."
An example of initial conditions for which this happens is with X0=[-5 0 0 0 0 0] and Xd=[0 0 0 0 0 0]. By changing it with X0=-5 0.1 0.1 0 0 0] the problem is not there anymore and the ODEs are solved using ODE45!
I didn't even try to reducing the minimum step size or relax the error tolerance since I think it would arrive to the same problem going on with the simulation.
I find this behaviour extremely weird and I have no idea on how to fix it. I should add that I modeled the dynamics using both simulink blocks and a matlab function using a state space representation (X'=AX+BU) and I obtain the same results. Furthermore I tried a different control (a simple PD) and it can successfully control the system.
It seems then that the problem is in the control but I have no clue on what it could be since I followed exactly what is described in the paper. My other hypotesis is that there is a huge mistake that I'm doing and I'm not aware of it.
Thank you for any help you can provide me!