Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Matlab,guide and simulink

Subject: Matlab,guide and simulink

From: engin caglar

Date: 4 Dec, 2010 02:22:05

Message: 1 of 8

Hi..
I am responsible for control side of our graduate project which includes controlling 3 motors for 3 axes motion and processing data coming from a sensor.[3 motors + 1 sensor].I have created an interface using GUIDE.My question is how can i connect interface to simulink?.I have been told that if we use a data acquisition card,we can control motors and sensor data using simulink.So can you advise me about :

1)How to achieve this control process (running 3 servo motors and obtaining sensor data)

2) How to connect that control system to GUIDE interface? For example the user will enter 3 , 4 , 5 for x,y,z axes and push "start" button and the system will move to that position by running motors, and send back the sensor data at that position.

Can you give me some advice about this task and suggest me some "tutorials" ?
Thanks in advance

Subject: Matlab,guide and simulink

From: engin caglar

Date: 4 Dec, 2010 18:28:04

Message: 2 of 8

50 people read , and not even an answer?

Let me shorten my question (what im looking for is tutorial or book suggestion):
1)How to achieve this control process (running 3 servo motors and obtaining sensor data)

2) How to connect that control system to GUIDE interface? For example the user will enter 3 , 4 , 5 for x,y,z axes and push "start" button and the system will move to that position by running motors, and send back the sensor data at that position.

Can you give me some advice about this task and suggest me some "tutorials" ?
Thanks in advance

Subject: Matlab,guide and simulink

From: Walter Roberson

Date: 4 Dec, 2010 20:43:38

Message: 3 of 8

On 04/12/10 12:28 PM, engin caglar wrote:
> 50 people read , and not even an answer?

More than 50. 50 is just the number counted by the Mathworks interface
to the Usenet Newsgroup that really underlies the forum.

> Let me shorten my question (what im looking for is tutorial or book
> suggestion):
> 1)How to achieve this control process (running 3 servo motors and
> obtaining sensor data)

I have no idea; I have never used Simulink.

> 2) How to connect that control system to GUIDE interface?

I have no idea; GUIDE is such a pain to use in a predictable way that I
gave up after first seeing the code it generates. And connecting GUIDE
to Simulink is an even more obscure topic.


"He asked me a question, and I gave him an honest answer. I told him
that I don't know."

So now you have an answer. Did it *help* ?

Subject: Matlab,guide and simulink

From: engin caglar

Date: 4 Dec, 2010 21:26:04

Message: 4 of 8

I'm still waiting for answers with guidance.
(P.s : Not funny stuff from jokers who satisfy themselves)

Subject: Matlab,guide and simulink

From: Paulo Silva

Date: 4 Dec, 2010 22:33:04

Message: 5 of 8

I can give you a few tips

open_system('ModelName'); % opens a simulink model in the current directory
set_param('ModelName/Manual Switch','sw','1'); % closes a switch on you simulink model
set_param('ModelName/Gain','Gain', NewGain); % changes the Gain of a Gain block
Tsim = str2double(get(handles.edit1, 'String')); % get a value from a GUI textbox
sim('ModelName',[0 Tsim]); % Start the simulation of your model until Tsim (end time)

If you want to get data from your model to your GUI, for example you want to do a graph you can add a To Workspace simulink block connected to what you want to measure and also one To Workspace having for input the Clock (time), change its properties to some variable name like Value and plot it on a GUI axe like this:

axes(handles.axes1); % select on wich axe you want the graph

plot(time,Value); % do the graph

Hope this can help you but I don't have experience with data aquisition cards, sorry

Subject: Matlab,guide and simulink

From: Steven_Lord

Date: 5 Dec, 2010 00:58:01

Message: 6 of 8



"engin caglar" <e144605@metu.edu.tr> wrote in message
news:ideblc$q4p$1@fred.mathworks.com...
> I'm still waiting for answers with guidance.
> (P.s : Not funny stuff from jokers who satisfy themselves)

Keep in mind that you posted your message around 9 PM EST Friday night when
many of the reader had left work for the weekend and/or asleep (particularly
those readers in Europe.) Be patient if you don't receive a response within
15 minutes of posting!

Anyway, take a look at this section of the documentation and use it as a
template for your application.

http://www.mathworks.com/help/techdoc/creating_guis/f6-8865.html

--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlab.wikia.com/wiki/FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Subject: Matlab,guide and simulink

From: engin caglar

Date: 5 Dec, 2010 02:35:05

Message: 7 of 8

Thank you for your answer Paulo Silva.Your code worked for me (with a basic simulink model)
I will try it with data acquisition card and give feedback about it (maybe someone else will need such a solution)

Subject: Matlab,guide and simulink

From: engin caglar

Date: 5 Dec, 2010 02:37:04

Message: 8 of 8

Thanks for the advice and link, Steve Lord.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us