my simulink diagram is out of control... is there a better way to do this?

I'm trying to make a simulink block diagram modeling a swinging pendulum. Every time the pendulum position (theta) swings past 0.3 rad, I want to kick it back with a pulse that integrates to 0.88. Creating a standard size pulse that is triggered by the position signal coming out of my state space block ended up being harder than I thought, and I made something that works but it seems unnecessarily complicated (see below). Main problem-- as soon as the pulse starts, the position signal almost immediately goes below 0.3 rad again, and this caused most code I could find for triggered pulses to fail. Does anyone have a suggestion for a better way to do this? Thanks!

Categories

Find more on Simulink in Help Center and File Exchange

Asked:

on 10 Jun 2015

Answered:

on 11 Jan 2016

Community Treasure Hunt

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

Start Hunting!