Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

A Problem in Simulink with sample time

Status
Not open for further replies.

naalald

Full Member level 4
Joined
Dec 2, 2006
Messages
216
Helped
30
Reputation
54
Reaction score
5
Trophy points
1,298
Activity points
2,627
simulink discrete-time integrator problem

Hi,
I want to simulate a DS modulator in simulink. When I use,
Input frequency = 85/8192
Sample time = 1
like the values in the Schreier toolbox, everything is ok. But when I use,
Input frequency = 85
Sample time = 1/8192
The modulator does not work. I guess the problem is something to do with the simulink and the blocks, which may ignore or round the numbers when they are so small. I set the sample time for one block and for other blocks I set -1 for inherited.
Any suggestions?
 

hi naalald,

i'm simulating a SD modulator with sampling time 1/900000 and input frequency 49.8hz, and it works well. you say your modulator doesn't work, what's that?
 

Thanks jiangxb,
Could you please explain how you set the sample time in different blocks of simulink and the other settings for them if there is anything important that I have not taken into consideration? For example rounding or data type settings.
 

hi naalald,

i set sampling time 1/900000 in one block, and -1 for others.(if you use some self-defined block, the sampling time should be set to 1/900000)
the rounding and data type are default.
if you model the bandwidth of integrator, check it and ensure that it's several times larger than the sampling frequency.
 

Hi jiangxb, Thanks for your reply,
I have not modeled the bandwidth of the integrator (I've used a discrete-time integrator block) but the problem is it's sample time. I've set the input (a sine wave) sample time e.g 1/8192 and the other blocks -1 except the first integrator that an error occurs when I set it -1 it says it's sample time should be a discrete integer I set it 1/8192 but it does not work. I don't know why!
 

set the sampling time of all integrator 1/8192 and try again.

your integrator is delay or delay free? you should ensure that there is one delay at least around the loop.
 

    naalald

    Points: 2
    Helpful Answer Positive Rating
few things:
in your first post, the two settings are very different, but you seem to imply they are the same (f is in rad/s in simulink)

f = 85 and Ts = 1/8192 gives a ~13 Hz sine with ~1300 samples per period
f = 85/8192 and Ts=1 gives a sine of .0017 Hz and ~600 samples per period

Which is the one you want?

Connecting sine ouput to discrete time integrator with sample time -1 gives me no problems. Can you isolate just these two in your system and try?
-b
 

hi bulx

well, these two settings are same relatively with ~600 samples per period.
 

Thank you very much for your replies,
jiangxb, I tested setting all blocks sample time 1/8192 but it didn't work. The integrators are delayed as in the figure.





bulx, they are the same in sampling. I can't isolate them.
 

hi naalald,

the constrain condition in your modulator is g1=0.5(g1 is gain of the first integrator) and g2 is arbitrary, otherwise the operation of modulator will work abnormally.
 

High jiangxb, Thanks,
In fact with these gains the modulator works in the sampling time = 1 but it does not work in sampling time = 1/8192
The problem is that in sampling time = 1/8192 the output of the first integrator is extremely small (~ 1e-3) and this causes the modulator to malfunction, while in sampling time = 1 the output of the first integrator is around 1.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top