Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

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

75 views
Skip to first unread message

Kevin

unread,
Mar 6, 2008, 5:17:03 AM3/6/08
to
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?

Antonin Ancelle

unread,
Mar 6, 2008, 8:18:36 AM3/6/08
to
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 " <kede...@mathworks.com> wrote in message
news:fqogav$eol$1...@fred.mathworks.com...

Kevin

unread,
Mar 6, 2008, 9:08:01 AM3/6/08
to
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...@mathworks.com> wrote in
message <fqoqve$498$1...@fred.mathworks.com>...

Praetorian

unread,
Mar 6, 2008, 11:06:51 AM3/6/08
to
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.

Antonin Ancelle

unread,
Mar 6, 2008, 12:06:24 PM3/6/08
to
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 <kede...@mathworks.com> but this didn't
work.
Let me know if you want that PID model.

Thanks,

Antonin.


"Kevin " <kede...@mathworks.com> wrote in message

news:fqots1$jo5$1...@fred.mathworks.com...

Kevin

unread,
Mar 6, 2008, 12:29:03 PM3/6/08
to
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...@mathworks.com> wrote in

message <fqp8ah$cgh$1...@fred.mathworks.com>...

proph star

unread,
Mar 17, 2008, 7:23:05 AM3/17/08
to
"Kevin " <kede...@mathworks.com> wrote in message
<fqogav$eol$1...@fred.mathworks.com>...

proph star

unread,
Mar 17, 2008, 7:24:05 AM3/17/08
to
"Kevin " <kede...@mathworks.com> wrote in message
<fqogav$eol$1...@fred.mathworks.com>...
0 new messages