Thread Subject: C2000 DSP and Simulink : using a memory-stored variable as a block parameter

Subject: C2000 DSP and Simulink : using a memory-stored variable as a block parameter

From: Kevin

Date: 6 Mar, 2008 10:17:03

Message: 1 of 8

Hello,

I've been toying with the C2000 toolbox for a little while
now, but I'm hitting a wall on this one.

What I'm trying to do is a PID controler whose parameters
can be changed by an external source or using a RTDX channel.
In fact this problem might arise for every block whose
parameters can't be specified from the outside.

Now I could create the controler with basic Simulink blocks,
but I want to use to more efficient PID-Controler from the
DMC library.

Since the C2000 doesn't have a workspace, I tried to use the
"Memory Copy" block from the Link for Code Composer Library
with no results since the parameters must come from the
workspace.

Is there a way to tell the block the the value of a
parameters must be taken from memory and not from the workspace?

Subject: C2000 DSP and Simulink : using a memory-stored variable as a block parameter

From: Antonin Ancelle

Date: 6 Mar, 2008 13:18:36

Message: 2 of 8

Hi Kevin,

I am going to send you a direct email with a burst model of a PI controller
where you can dynamically change the parameters.
It has no D component, but you can easily add it if you have a need for it.
It is more conventional than the TI version in the sense that the P
component is not cascaded with the I.

On the TI version if you put P = 0, the rest will be 0 regardless of what I
or D component you have.

I will let you play with it.

Good luck,

Antonin.


"Kevin " <kedecuyp@mathworks.com> wrote in message
news:fqogav$eol$1@fred.mathworks.com...
> Hello,
>
> I've been toying with the C2000 toolbox for a little while
> now, but I'm hitting a wall on this one.
>
> What I'm trying to do is a PID controler whose parameters
> can be changed by an external source or using a RTDX channel.
> In fact this problem might arise for every block whose
> parameters can't be specified from the outside.
>
> Now I could create the controler with basic Simulink blocks,
> but I want to use to more efficient PID-Controler from the
> DMC library.
>
> Since the C2000 doesn't have a workspace, I tried to use the
> "Memory Copy" block from the Link for Code Composer Library
> with no results since the parameters must come from the
> workspace.
>
> Is there a way to tell the block the the value of a
> parameters must be taken from memory and not from the workspace?


Subject: C2000 DSP and Simulink : using a memory-stored variable as a block parameter

From: Kevin

Date: 6 Mar, 2008 14:08:01

Message: 3 of 8

Thank you very much! You're being very helpful

But just for further developpements, is it possible to
dynamically change block parameters on the DSP without
creating custom blocks?

"Antonin Ancelle" <antonin.ancelle@mathworks.com> wrote in
message <fqoqve$498$1@fred.mathworks.com>...
> Hi Kevin,
>
> I am going to send you a direct email with a burst model
of a PI controller
> where you can dynamically change the parameters.
> It has no D component, but you can easily add it if you
have a need for it.
> It is more conventional than the TI version in the sense
that the P
> component is not cascaded with the I.
>
> On the TI version if you put P = 0, the rest will be 0
regardless of what I
> or D component you have.
>
> I will let you play with it.
>
> Good luck,
>
> Antonin.
>
>
> "Kevin " <kedecuyp@mathworks.com> wrote in message
> news:fqogav$eol$1@fred.mathworks.com...
> > Hello,
> >
> > I've been toying with the C2000 toolbox for a little while
> > now, but I'm hitting a wall on this one.
> >
> > What I'm trying to do is a PID controler whose parameters
> > can be changed by an external source or using a RTDX
channel.
> > In fact this problem might arise for every block whose
> > parameters can't be specified from the outside.
> >
> > Now I could create the controler with basic Simulink blocks,
> > but I want to use to more efficient PID-Controler from the
> > DMC library.
> >
> > Since the C2000 doesn't have a workspace, I tried to use the
> > "Memory Copy" block from the Link for Code Composer Library
> > with no results since the parameters must come from the
> > workspace.
> >
> > Is there a way to tell the block the the value of a
> > parameters must be taken from memory and not from the
workspace?
>
>

Subject: C2000 DSP and Simulink : using a memory-stored variable as a

From: Praetorian

Date: 6 Mar, 2008 16:06:51

Message: 4 of 8

On Mar 6, 7:08 am, "Kevin " <kedec...@mathworks.com> wrote:
> Thank you very much! You're being very helpful
>
> But just for further developpements, is it possible to
> dynamically change block parameters on the DSP without
> creating custom blocks?
>
> "Antonin Ancelle" <antonin.ance...@mathworks.com> wrote in
> message <fqoqve$49...@fred.mathworks.com>...> Hi Kevin,
>
> > I am going to send you a direct email with a burst model
> of a PI controller
> > where you can dynamically change the parameters.
> > It has no D component, but you can easily add it if you
> have a need for it.
> > It is more conventional than the TI version in the sense
> that the P
> > component is not cascaded with the I.
>
> > On the TI version if you put P = 0, the rest will be 0
>
> regardless of what I
>
> > or D component you have.
>
> > I will let you play with it.
>
> > Good luck,
>
> > Antonin.
>
> > "Kevin " <kedec...@mathworks.com> wrote in message
> >news:fqogav$eol$1@fred.mathworks.com...
> > > Hello,
>
> > > I've been toying with the C2000 toolbox for a little while
> > > now, but I'm hitting a wall on this one.
>
> > > What I'm trying to do is a PID controler whose parameters
> > > can be changed by an external source or using a RTDX
> channel.
> > > In fact this problem might arise for every block whose
> > > parameters can't be specified from the outside.
>
> > > Now I could create the controler with basic Simulink blocks,
> > > but I want to use to more efficient PID-Controler from the
> > > DMC library.
>
> > > Since the C2000 doesn't have a workspace, I tried to use the
> > > "Memory Copy" block from the Link for Code Composer Library
> > > with no results since the parameters must come from the
> > > workspace.
>
> > > Is there a way to tell the block the the value of a
> > > parameters must be taken from memory and not from the
> workspace?

Hi Kevin,
There is no direct way to do that. But in case of the TI C2000 library
PID controller the workaround is quite simple since the block diagram
of the PID is given on the help page for that block. Just use blocks
from the IQmath library to re-create the PID, except you'd have input
ports for all the parameters you want to change, and then From Memory
blocks feeding those inputs.

HTH,
Ashish.

Subject: C2000 DSP and Simulink : using a memory-stored variable as a block parameter

From: Antonin Ancelle

Date: 6 Mar, 2008 17:06:24

Message: 5 of 8

There are multiple ways:

Read about "tunable parameters" in the doc.
Also looks for settings in the configset for "parameters".
You can assign the parameters struct to a volatile struct and therefore
change the parameters.
You can also replace a parameter variable to a known variable name.

I tried to send you an email at <kedecuyp@mathworks.com> but this didn't
work.
Let me know if you want that PID model.

Thanks,

Antonin.


"Kevin " <kedecuyp@mathworks.com> wrote in message
news:fqots1$jo5$1@fred.mathworks.com...
> Thank you very much! You're being very helpful
>
> But just for further developpements, is it possible to
> dynamically change block parameters on the DSP without
> creating custom blocks?
>
> "Antonin Ancelle" <antonin.ancelle@mathworks.com> wrote in
> message <fqoqve$498$1@fred.mathworks.com>...
>> Hi Kevin,
>>
>> I am going to send you a direct email with a burst model
> of a PI controller
>> where you can dynamically change the parameters.
>> It has no D component, but you can easily add it if you
> have a need for it.
>> It is more conventional than the TI version in the sense
> that the P
>> component is not cascaded with the I.
>>
>> On the TI version if you put P = 0, the rest will be 0
> regardless of what I
>> or D component you have.
>>
>> I will let you play with it.
>>
>> Good luck,
>>
>> Antonin.
>>
>>
>> "Kevin " <kedecuyp@mathworks.com> wrote in message
>> news:fqogav$eol$1@fred.mathworks.com...
>> > Hello,
>> >
>> > I've been toying with the C2000 toolbox for a little while
>> > now, but I'm hitting a wall on this one.
>> >
>> > What I'm trying to do is a PID controler whose parameters
>> > can be changed by an external source or using a RTDX
> channel.
>> > In fact this problem might arise for every block whose
>> > parameters can't be specified from the outside.
>> >
>> > Now I could create the controler with basic Simulink blocks,
>> > but I want to use to more efficient PID-Controler from the
>> > DMC library.
>> >
>> > Since the C2000 doesn't have a workspace, I tried to use the
>> > "Memory Copy" block from the Link for Code Composer Library
>> > with no results since the parameters must come from the
>> > workspace.
>> >
>> > Is there a way to tell the block the the value of a
>> > parameters must be taken from memory and not from the
> workspace?
>>
>>
>


Subject: C2000 DSP and Simulink : using a memory-stored variable as a block parameter

From: Kevin

Date: 6 Mar, 2008 17:29:03

Message: 6 of 8

Could you try to send it at kedecuyp$ulb.ac.be (replacing $
by @) ? Thanks in advance

I will try your other suggestions tomorrow

"Antonin Ancelle" <antonin.ancelle@mathworks.com> wrote in
message <fqp8ah$cgh$1@fred.mathworks.com>...
> There are multiple ways:
>
> Read about "tunable parameters" in the doc.
> Also looks for settings in the configset for "parameters".
> You can assign the parameters struct to a volatile struct
and therefore
> change the parameters.
> You can also replace a parameter variable to a known
variable name.
>
> I tried to send you an email at <kedecuyp@mathworks.com>
but this didn't
> work.
> Let me know if you want that PID model.
>
> Thanks,
>
> Antonin.
>

Subject: C2000 DSP and Simulink : using a memory-stored variable as a block parameter

From: proph star

Date: 17 Mar, 2008 11:23:05

Message: 7 of 8

"Kevin " <kedecuyp@mathworks.com> wrote in message
<fqogav$eol$1@fred.mathworks.com>...
> Hello,
>
> I've been toying with the C2000 toolbox for a little
while
> now, but I'm hitting a wall on this one.
>
> What I'm trying to do is a PID controler whose parameters
> can be changed by an external source or using a RTDX
channel.
> In fact this problem might arise for every block whose
> parameters can't be specified from the outside.
>
> Now I could create the controler with basic Simulink
blocks,
> but I want to use to more efficient PID-Controler from
the
> DMC library.
>
> Since the C2000 doesn't have a workspace, I tried to use
the
> "Memory Copy" block from the Link for Code Composer
Library
> with no results since the parameters must come from the
> workspace.
>
> Is there a way to tell the block the the value of a
> parameters must be taken from memory and not from the
workspace?

Subject: C2000 DSP and Simulink : using a memory-stored variable as a block parameter

From: proph star

Date: 17 Mar, 2008 11:24:05

Message: 8 of 8

"Kevin " <kedecuyp@mathworks.com> wrote in message
<fqogav$eol$1@fred.mathworks.com>...
> Hello,
>
> I've been toying with the C2000 toolbox for a little
while
> now, but I'm hitting a wall on this one.
>
> What I'm trying to do is a PID controler whose parameters
> can be changed by an external source or using a RTDX
channel.
> In fact this problem might arise for every block whose
> parameters can't be specified from the outside.
>
> Now I could create the controler with basic Simulink
blocks,
> but I want to use to more efficient PID-Controler from
the
> DMC library.
>
> Since the C2000 doesn't have a workspace, I tried to use
the
> "Memory Copy" block from the Link for Code Composer
Library
> with no results since the parameters must come from the
> workspace.
>
> Is there a way to tell the block the the value of a
> parameters must be taken from memory and not from the
workspace?

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

Tag Activity for This Thread
Tag Applied By Date/Time
please i have t... proph star 17 Mar, 2008 07:25:11
simulink Kevin 6 Mar, 2008 05:20:06
rtw Kevin 6 Mar, 2008 05:20:05
c2000 Kevin 6 Mar, 2008 05:20:05
rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com