02-10-2015 08:01 AM
Hi everyone,
I have been trying to implement sliding mode control in LABVIEW , and i think the best option is to use Mtahscript. But i don't have any idea how to do it...
As in MATLAB i had created a model containing two blocks of plant and controller and wrote their equations accordingly, BUT i don't have any idea how to implement it in LABVIEW. Anyone who have used LABVIEW/MAthscript for sliding mode cotroller designing, plz help me finding solution.
Thanks in advance.
Kind regards
02-11-2015 10:48 AM
The preferred way to simulate a system in LabVIEW is to use the Control and Simulation Loop (part of the Control Design and Simulation Module) where the 'solver' integrates the system over time. A good example is the shipping example:
C:\Program Files (x86)\National Instruments\LabVIEW 2014\examples\Control and Simulation\Case Studies\Automotive\ABS Control\Control of Vehicle Motion - ABS.vi
Here is picture of the diagram, so you have an idea.
Now, if you do not have the simulation loop, then you can just use LabVIEW For Loop and try to create the integration funcions that would make this system to work... This is a bit more work but also doable...
02-11-2015 11:57 PM
Thanks Barp for your kind reply,
I do have the control and simulation Loop. But the point that i want to ask is, how to implement Sliding mode control in it, as there are blocks for controller design like PID etc , but i haev to design controller using Sliding mode control technique. I have implemented Sliding mode control in MATLAB/Simulink using S function, but i don't know how to implement it LABVIEW.
02-12-2015 08:29 PM
Well... as you can see in my picture above, you do not necessarily need a S-function. If your S-function is m-based, then you can use the Mathscript node to define the nonlinear equations and, then, use the 'integrator' from Simulation Palette to integrate the signal (if you have derivative).
However, if your S-function is C based, then you can try to use another function in Simulation called External Model Interface. You will need to create a DLL and code your features into it. But probably you have all this code already and I think it can be somewhat easy to do... Here is the documentation:
http://zone.ni.com/reference/en-XX/help/371894D-01/lvsimconcepts/sim_using_emi/
If you still have difficulty to do this after you look into my information, it would help if you could create a simple schematic or some paper that describes what you are trying to do.
Hope this helps,
04-07-2019 04:20 AM
Can you give me file example ABS Brake, please?
@Barp wrote:
The preferred way to simulate a system in LabVIEW is to use the Control and Simulation Loop (part of the Control Design and Simulation Module) where the 'solver' integrates the system over time. A good example is the shipping example:
C:\Program Files (x86)\National Instruments\LabVIEW 2014\examples\Control and Simulation\Case Studies\Automotive\ABS Control\Control of Vehicle Motion - ABS.vi
Here is picture of the diagram, so you have an idea.
Now, if you do not have the simulation loop, then you can just use LabVIEW For Loop and try to create the integration funcions that would make this system to work... This is a bit more work but also doable...
04-07-2019 10:48 PM
This example is shipping with the LabVIEW Control Design and Simulation Module and you can find the example and its subVIs in the folder:
C:\Program Files (x86)\National Instruments\LabVIEW <version>\examples\Control and Simulation\Case Studies\Automotive\ABS Control\
Does that work for you?