I have problem with derivative of an Input to Simulink-PS Converter

조회 수: 12 (최근 30일)
Zohreh Keshavarz Bagheri
Zohreh Keshavarz Bagheri 2017년 9월 8일
답변: Brandon Eidson 2017년 9월 11일
I am trying to use a sinusoidal function as an input to a prismatic joint in simscape. The sinusoidal function is to feed through Simulink-PS converter to a Prismatic joint. The Simulink-PS converter include input and the first two derivatives. In case if I only have the first derivative (velocity) of the sinusoidal function as input to Simulink-PS converter, the position is to be calculated by integration and the second derivative (acceleration) is to be calculated by derivation. I noticed that when I use the derivative block with Simulink-PS converter, the second derivative (acceleration) is little different from the expected acceleration. It seems there is a delay between the real acceleration and the one which is derived from the derivative block and S-PS converter.
Could you please suggest how to correct this issue? I really appreciate your suggestions.

답변 (2개)

Sebastian Castro
Sebastian Castro 2017년 9월 11일
The Derivative block is very sensitive to the time steps your simulation is taking, and is usually not recommended.
I'd suggest changing the Simulink-PS Converter block to use the "Filter input, derivatives calculated" option. Then you pass in the position and let the block calculate smooth, filtered derivatives with a time constant that makes sense for your application.
- Sebastian

Brandon Eidson
Brandon Eidson 2017년 9월 11일
Sebastian's comments are important. I'd like to also add that the difference in the derivatives is expected. Simulink's solver solves for states and outputs sequentially from block-to-block while Simscape compiles all the states/equations and solves simultaneously. This is why the Simscape derivative output appears to be able to "look ahead" to have the correct derivative a time-step sooner.
I have attached a model that illustrates this difference. In the "StopFcn" callback, a plot is created of the Simscape Position, Simulink Velocity (i.e., the output of the "Derivative" block), and the Simscape Velocity. I have used a fixed-time step of 0.1 seconds so the values easy to compare. Notice that at time = 0.1 seconds, the output of the Simulink Derivative block is simply (Position(0.1) - Position(0))/0.1. This is due to the sequential nature of Simulink's solver. But the Simscape solver simultaneously solves for the position and velocity using other model equations/states (like force/acceleration). This allows it to pinpoint the correct velocity at 0.1 seconds.

카테고리

Help CenterFile Exchange에서 Simulation Setup에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by