Need advice for using simulink for control of basic system
Need advice for using simulink for control of basic system
(OP)
Hello,
I have been told that simulink is a fairly good and easy way to design control systems.
What I'm trying to do should be very easy. I have a very simple system that I already have code to handle outputs and inputs to the physical equipment. The system consists of sensors, etc which have either an on or an off function.
What I want to do is be able to use simulink to control this system. It would be simple things like if sensor 1 is on, turn on motor 1. if sensor 2 is on do this, etc.
Everything I have found is more complex than what I need (involving transfer functions, various equations and so on).
If anyone could point me in the right direction as to what to look, read, or whatever, it would be much appreciated.
I have been told that simulink is a fairly good and easy way to design control systems.
What I'm trying to do should be very easy. I have a very simple system that I already have code to handle outputs and inputs to the physical equipment. The system consists of sensors, etc which have either an on or an off function.
What I want to do is be able to use simulink to control this system. It would be simple things like if sensor 1 is on, turn on motor 1. if sensor 2 is on do this, etc.
Everything I have found is more complex than what I need (involving transfer functions, various equations and so on).
If anyone could point me in the right direction as to what to look, read, or whatever, it would be much appreciated.





RE: Need advice for using simulink for control of basic system
So what I want to do is something along the lines of:
if (x == 1 and y == 0){ //arbitrary condition
output1 = 1; //turn on something
}
if(some condition){
}
if(some other condition){
}
The inputs from sensors would be checked every 0.1 second and compared against these conditions.
RE: Need advice for using simulink for control of basic system
xnuke
"Live and act within the limit of your knowledge and keep expanding it to the limit of your life." Ayn Rand, Atlas Shrugged.
Please see FAQ731-376: Eng-Tips.com Forum Policies for tips on how to make the best use of Eng-Tips.
RE: Need advice for using simulink for control of basic system
Just requires that you know how to program in m-code.
You can even extract the states from a DE sing an S-function.
For example: your
"if (x == 1 and y == 0){ //arbitrary condition
output1 = 1; //turn on something
"
can be written almost exactly as it is in the embedded function. The 'x' and 'y' can be inputs to the function.
Fe
RE: Need advice for using simulink for control of basic system
Thanks a lot. I'll look into it.
@FeX32
That is true. However, I need some way to control how often and how long it takes for each sampling rate. My reason (hopefully not misguided) for looking into Simulink is to do just that.
e.g. the input needs to be read every x seconds, and should not take longer than x seconds to sample again. So other computations cannot delay the time to update the inputs.
RE: Need advice for using simulink for control of basic system
Click fixed time step and choose a time step 'x' that you are referring to.
Fe
RE: Need advice for using simulink for control of basic system
However there are toolboxes available for all sorts of things, and blocks for sample and hold, for example.
Cheers
Greg Locock
New here? Try reading these, they might help FAQ731-376: Eng-Tips.com Forum Policies http://eng-tips.com/market.cfm?
RE: Need advice for using simulink for control of basic system
Everyone else: thank you as well.
Yeah, simulink isn't exactly parallel, however I'm pretty sure what it does is good enough for my purposes. Right now I just want to get it to work (Having problems loading C++ dll's). I'll keep the sample and hold blocks in mind and look into it once I figure out what I'm doing wrong.
RE: Need advice for using simulink for control of basic system
You might want to look at Labview, or something similar, since that's what Labview is actually designed for.
TTFN
FAQ731-376: Eng-Tips.com Forum Policies
RE: Need advice for using simulink for control of basic system
Trust me, I wouldn't be using MATLAB if I had a choice. Unfortunately, I'm writing this for someone who wants it in MATLAB so that he can integrate it with his MATLAB programs for statistical data analysis. Although, I'm starting to wonder if that's necessary...
RE: Need advice for using simulink for control of basic system
TTFN
FAQ731-376: Eng-Tips.com Forum Policies