From: MHS on
Hello People,

I am doing a project which is almost a text book project for engineering students. I am trying to control a DC motor on SIMPOWER.

I am using a H-Bridge with PWM for drive a standard DC motor from the Simulink -SimPower library. So far, my motor is running ok and on the scope I can see ideal responses. What I am trying to find is an switch/rotarydial/potentiometer that will vary the input voltage within the circuit. My intention is to observe the response on the scope.

I could not find any such devices. I am not an expert in MATLAB , so may I ask for any suggestion please?

Regards,
MH
From: Phil Goddard on
Unfortunately there aren't any really nice "dials" that come with Simulink.
(There used to be a blockset that contained them but for reasons beyond The MathWorks control they needed to be removed.)

The nearest thing is for you to use the "Slider Gain" block, which is in the "Math Operations" library.

Phil.
From: Jan Houska on
Hi,

MHS wrote:
> Hello People,
>
> I am doing a project which is almost a text book project for engineering
> students. I am trying to control a DC motor on SIMPOWER.
> I am using a H-Bridge with PWM for drive a standard DC motor from the
> Simulink -SimPower library. So far, my motor is running ok and on the
> scope I can see ideal responses. What I am trying to find is an
> switch/rotarydial/potentiometer that will vary the input voltage within
> the circuit. My intention is to observe the response on the scope.
>
> I could not find any such devices. I am not an expert in MATLAB , so may
> I ask for any suggestion please?

Simulink 3D Animation <http://www.mathworks.com/products/3d-animation>
may be of interest here. Please take a look e.g. at the "vrmaglev" demo
where you can click into the virtual world and control the position of
the levitating ball this way.

Best Regards, Jan


--
Jan Houska HUMUSOFT s.r.o.
houska(a)humusoft.com Pobrezni 20
http://www.humusoft.com 186 00 Praha 8
tel: ++ 420 284 011 730 Czech Republic
fax: ++ 420 284 011 740
From: MHS on
Thank you Phil & Jan.

Before I quit my plan, one more time, I am posting my issue, as a screen shot of what I want to do:

http://img682.imageshack.us/img682/2807/motorproblem.png

The image shows a simulink model where I would like to change the parameters (i.e. frequency) of the PWM generator.
From: Phil Goddard on
The following is not a trivial task, but all the pieces to get it to work are available:

- obtain (most likely via an internet search) an activeX control (assuming you are on Windows) of a dial that looks like you want/need.
- embed the activeX control into a MATLAB figure window using the function actxcontrol.
- use set_param (and probably get_param) in appropriate activeX control callback's to push new values of the dial into the appropriate SImulink block.
- use block callbacks (e.g. InitFcn, CopyFcn, DeleteFcn, etc.) to make the dial appear/disappear when the model is openned/closed/copied/etc.

Phil.