I'm currently working on designing a controller for stabilizing a self balancing bicycle that uses Control Moment Gyroscope for balancing. A simmechanics model of the self balancing bicycle was developed using Simscape Multibody. I'm trying to develop a MPC controller using the MPC toolbox. The MPC cannot linearize the simmechanics model. So, I collected precession torque as Input and Roll angle as output to make a SISO State space model. This is then fed into the system identification app to get a State Space with Identified Parameters. The idss correlation with collected data is 99.5% with one step prediction focus. Now, when I'm implementing the idss on simulink using idmodel block, the output of idmodel is not as expected. I'm planning to use the idss to tune my MPC controller. If the idss roll angle output doesn't match with the roll angle data of the model, then my controller cannot be tuned properly. I tried the transfer function as well. It doesn't work.So I require help in designing a controller using a simscape model.
The Simmechanics model is attached below. Thank you very much and I'm looking forward to hearing from you.