[scicos] Re: [scilab-Users] scicos mosfet gate voltage
Masoud-NAJAFI
masoud.najafi at inria.fr
Thu Jan 24 10:46:39 CET 2008
Sylvestre Ledru a écrit :
> Hello Ram,
>
> If you don't get an answer from this mailing list, you can try
> scicos at inria.fr
>
> Sylvestre
>
> Le jeudi 24 janvier 2008 à 09:45 +0100, Shriram Sampat a écrit :
>
>> hello guys,
>>
>> yesterday i sent an email regarding my project and reqmt to connect
>> electrical and linear blocks.
>>
>> I want to control the gate voltage of a MOSFET(scicos electrical block)
>> with the output of a linear PID controller blocks. If i try to connect,
>> i now get an error message "port at origin has type 1 and port at end
>> has type 2".
>>
>> Can anyone help me in this ?
>>
>> Thanks
>>
>> Ram
Hi Ram,
Electrical blocks are considered as components (or implicit blocks in
contrast with explicit Scicos blocks), so their ports act as real
electrical ports, i.e., their do not have predefined directions.
These block are wirtten with the Modelica language, for example the
model the electrical pin is:
connector Pin
Real v;
flow Real i;
end Pin;
and the model of an electrical resistor is
model Resistor
Pin p, n;
parameter Real R "Resistance";
equation
R*p.i = p.v - n.v;
0=p.i +n.i;
end Resistor;
Note that unlike ordinary programming languages, there is no causality
between variables.
Now, lets return to your question. In order to control the gate voltage
of a Mosfet by a PID, the PID output signal should be first transformed
into an electrical signal. You can do this using the CVS ( Controlled
Voltage Source) block in the Electrical palette. Then connect the "-"
pin of CVS to the Ground and "+" pin to the gate of the Mosfet.
I wish it can help.
Masoud
ps: you can find some documentation about Modelica at
http://www.scicos.org/scicosmodelicaref.html
www.modelica.org
More information about the users
mailing list