# MATLAB Simulink: designing a 2nd order sliding controller

Tags:
1. Jul 5, 2017

### Payam30

Hi,
I've had obtained a mathematical model for the slip controller issue.

As you see I have the diffequation for the slip. and the input that force the system to zero error is provided as well. Now it's time to implement it in simulink or matlab.
I took a look at the example provided on mathwork. Here is a screen shot

The controller is supposed to force \lambda to a certain value. The optimal input is provided as well. So the reference block should be \lambda_desired. That's correct and then it goes to SMC and it gives the input to the system. What is that system? is it the dynamics of the slip? I have only the dynamics in mathematical way and no transfer function. You see that the dynamics of the slip is:

where T is the input . g is constant. R supposed to be observed by a observer. \lambda is slip and J is inertia. \mu is friction and assumed to be constant. \omega is the rotational speed on the wheel. How do I convert this to transfer function. I really need help since I ve done a lot and stuck in this. Please help me with this.

2. Jul 5, 2017

### FactChecker

I don't understand a lot of the specifics of your problem, but I have a general comment:
In many applications of Simulink, you do not know the transfer functions of some of the physics and they would be tremendously complicated. You use a Simulink diagram to implement the equations for the dynamics of the slip and run simulations to get results. There are tools to obtain Bode plots and estimate parameters.

Last edited: Jul 6, 2017
3. Jul 6, 2017

### Payam30

As you see in the picture, the input should go to the dynamic. The dynamic of the slip is :
$\dot{\lambda} = (- \frac{g}{R\omega} + \frac{Rmg(\lambda -1)}{\omega J})\mu - \frac{(\lambda -1)}{\omega J}T$
So this is the case:
Reference value ---> SMC -----> dynamics --->output
the output will get feedback to the SMC. My question is. I don't have any transfer function of the dynamics so how do I do this? how to I implement the dynamics in simulink

4. Jul 6, 2017

### FactChecker

That equation for $\dot{\lambda}$ can be represented as a signal network with blocks for signal summing, multiplication, inversion, etc. Feed the result of that network into an integration block to obtain $\lambda$ and use that signal in the network as needed.

5. Jul 6, 2017

### Payam30

You mean that I should solve the differential equation instead of using the transfer funktion? That could work...

6. Jul 6, 2017

### FactChecker

Yes. Simulink is used in a great number of simulations where the transfer function is not known but the equations can be represented in signal networks. It provides tools that can be used to analyse the system (Bode plots, etc.)

7. Jul 14, 2017

### Payam30

You were right. I did following scheme:

The SMC is as following:
$$u = u_d - \frac{K}{b} sat(\frac{\sigma}{\theta})$$
I have actually problem with founding $\theta$. This is the boundry thickness. anyone with insights in SMC.

8. Aug 2, 2017

### Payam30

Solved. Thanks