f



Simulink rate transition block

Do I have to have a unit delay when upsampling the output of a slow
subsystem? I have an s-function that can generate a discrete output
at time t=0,1,2,3,... which I want to compare (in a scope) with
native Simulink blocks that output at say 0, 0.1, 0.2, 0.3,... This
requires a rate transition on the s-function output. I would expect
my s-function output to be held at f(0) until t=1 then step up.
However, the rate transition block won't pass through my f(0) value
until t=0.1 and it is always 0.1s behind from then on. If the
s-function output is available at t=0, why can't it be used then? My
s-function has no states, only UPDATE and OUTPUT sections, with
direct feedthrough set on the only input port. Is there an
alternative to the rate transition / unit delay block that will do
this? I've tried to get around it by setting the output port sample
time within the s-function, but without success (same or new problems
- I can elaborate if required).
Thanks, Rob
0
9/13/2004 2:43:30 AM
comp.soft-sys.matlab 211266 articles. 14 followers. lunamoonmoon (258) is leader. Post Follow

2 Replies
1517 Views

Similar Articles

[PageSpeed] 17

No you don't need the full delay.  If you unclick both the "ensure
data integrity" and "ensure deterministic data transfer" checkboxes
you get no delay.  If you unclick only the second one you get a less
than full delay (play around with it).  Or you can run your system as
"single-tasking" and get no delay (for completeness sake I prefer not
to do this but rather to use the rate transition block).  These rate
transition options are in here for code generation purposes and
because oftentimes test hardware has delays in it to allow for
computation time.

Todd Newswander
Systems, Controls, & Aerospace Engineering
Parker Control Systems Division
tnewswander@parker.com


"Rob Curtin" <pleasepost@replyon.net> wrote in message news:<eee98d5.-1@webx.raydaftYaTP>...
> Do I have to have a unit delay when upsampling the output of a slow
> subsystem? I have an s-function that can generate a discrete output
> at time t=0,1,2,3,... which I want to compare (in a scope) with
> native Simulink blocks that output at say 0, 0.1, 0.2, 0.3,... This
> requires a rate transition on the s-function output. I would expect
> my s-function output to be held at f(0) until t=1 then step up.
> However, the rate transition block won't pass through my f(0) value
> until t=0.1 and it is always 0.1s behind from then on. If the
> s-function output is available at t=0, why can't it be used then? My
> s-function has no states, only UPDATE and OUTPUT sections, with
> direct feedthrough set on the only input port. Is there an
> alternative to the rate transition / unit delay block that will do
> this? I've tried to get around it by setting the output port sample
> time within the s-function, but without success (same or new problems
> - I can elaborate if required).
> Thanks, Rob
0
9/13/2004 6:09:10 PM
Thanks Todd,

I've done some more testing and summarised the results:

IN MULTI TASKING MODE
With both checkboxes ticked, I get one "long step" (ie, s-function
step) delay.
With only "ensure data integrity" or no checkboxes ticked, I get one
"short step" (ie, fundamental stepsize) delay.
During the delay period, the output shows the Rate Transition Block
initial condition (in dialog box) if "ensure data integrity" is
checked, else it outputs zero.

IN SINGLE TASKING MODE
With both checkboxes ticked, I get one "long step" (ie, s-function
step) delay.
With only "ensure data integrity" ticked, I get one "short step" (ie,
fundamental stepsize) delay.
With no checkboxes ticked, I get no delay.

IN AUTO TASKING MODE
Behaviour is as per MULTI if the s-function has a different rate to
the model, else as per SINGLE.

So, the answer appears to be that I need to run in single tasking
mode to get direct comparisons on a scope.
Alternatively, I could post-process the s-function data to remove the
delay and plot in a figure window.
This will do for now, though it's not ideal.

Regards, Rob

Todd Newswander wrote:
>
>
> No you don't need the full delay. If you unclick both the "ensure
> data integrity" and "ensure deterministic data transfer" checkboxes
> you get no delay. If you unclick only the second one you get a
> less
> than full delay (play around with it). Or you can run your system
> as
> "single-tasking" and get no delay (for completeness sake I prefer
> not
> to do this but rather to use the rate transition block). These
> rate
> transition options are in here for code generation purposes and
> because oftentimes test hardware has delays in it to allow for
> computation time.
>
> Todd Newswander
> Systems, Controls, & Aerospace Engineering
> Parker Control Systems Division
> tnewswander@parker.com
>
>
> "Rob Curtin" <pleasepost@replyon.net> wrote in message
> news:<eee98d5.-1@webx.raydaftYaTP>...
>> Do I have to have a unit delay when upsampling the output of a
> slow
>> subsystem? I have an s-function that can generate a discrete
> output
>> at time t=0,1,2,3,... which I want to compare (in a scope) with
>> native Simulink blocks that output at say 0, 0.1, 0.2, 0.3,...
> This
>> requires a rate transition on the s-function output. I would
> expect
>> my s-function output to be held at f(0) until t=1 then step up.
>> However, the rate transition block won't pass through my f(0)
> value
>> until t=0.1 and it is always 0.1s behind from then on. If the
>> s-function output is available at t=0, why can't it be used
then?
> My
>> s-function has no states, only UPDATE and OUTPUT sections, with
>> direct feedthrough set on the only input port. Is there an
>> alternative to the rate transition / unit delay block that will
> do
>> this? I've tried to get around it by setting the output port
> sample
>> time within the s-function, but without success (same or new
> problems
>> - I can elaborate if required).
>> Thanks, Rob
>
0
9/14/2004 4:14:46 AM
Reply: