Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simulink: Two simulation steps within one

Status
Not open for further replies.

oldskier

Electrical
Apr 29, 2011
1
0
0
DE
Hello everyone,

Here is the problem: I have a simulink block-diagram scheme which represents a simple stepper motor control system. It consist of two parts - first is stepper itself with power source and controlled H-bridge, second part prepares control signals for that bridge. Input for the whole scheme is a sequence (1xN vector) of rotation values in degrees. Now how it should work: having the stepper motor step size (0.045 deg for example) system should compute how many steps should be done by stepper to achieve next position (next rotation value in sequence) and (let's say 2 steps should be done) output 2 corresponding control signals to H-bridge. The problem is, that if on let's say first simulation step motor should do two steps, that means that within one simulation step motor should do two simulation steps...

I tried to do that with For Loop, but it seems that For Loop performs all its iterations within one simulation step, which is not suitable in my case. Is it possible to solve such problem?

Many thanks in advace for an answer!

Best regards, Peter.
 
Replies continue below

Recommended for you

Status
Not open for further replies.
Back
Top