RobotLocomotion / drake

Model-based design and verification for robotics.
https://drake.mit.edu
Other
3.29k stars 1.26k forks source link

Acrobot run lqr can trip a zero crossing limit #494

Closed RussTedrake closed 8 years ago

RussTedrake commented 10 years ago

examples/Acrobot/runLQR (unknown issue)

error_id = Simulink:Engine:SolverConsecutiveZCNum
error_message = At time 0.0031402301010290856, simulation hits (1000)
consecutive zero crossings. Consecutive zero crossings will slow down the
simulation or cause the simulation to hang. To continue the simulation, you
may 1) Try using Adaptive zero-crossing detection algorithm or 2) Disable
the zero crossing of the blocks shown in the following table. 
--------------------------------------------------------------------------------
Number of consecutive zero-crossings : 1000
          Zero-crossing signal name : Sf0
                         Block type : S-Function
                         Block path :
'FeedbackSystem_063580813592711784/DrakeSys'
--------------------------------------------------------------------------------
You can turn off this message by using the MATLAB command: 
set_param('FeedbackSystem_063580813592711784','MaxConsecutiveZCsMsg','none'); 

is_segfault = 0

                           < M A T L A B (R) >
                 Copyright 1984-2012 The MathWorks, Inc.
                   R2012b (8.0.0.783) 64-bit (glnxa64)
                             August 22, 2012

To get started, type one of these: helpwin, helpdesk, or demo.
For product information, visit www.mathworks.com.

To reproduce this test use rng(1529762569,'twister')

[Warning: Disabling autosave for simulink blocks (to avoid generating a lot
of
*.mdl.autosave files in your directory.  If you aren't a regular Simulink
user
and don't want this disabled, comment out this section in addpath_drake.
To disable this warning in the future, add
  warning('off','Drake:DisablingSimulinkAutosave')
to your matlab startup.m] 
[> In addpath_drake at 74
 In addpath_drake at 4] 
[Warning: successive zero crossings] 
[> In WarningManager>WarningManager.warnOnce at 21
 In DynamicalSystem.simulate at 177
 In DrakeSystem.DrakeSystem>DrakeSystem.simulate at 481
 In runLQR at 9] 
Error using DynamicalSystem/simulate (line 96)
At time 0.0031402301010290856, simulation hits (1000) consecutive zero
crossings. Consecutive zero crossings will slow down the simulation or
cause the simulation to hang. To continue the simulation, you may 1) Try
using Adaptive zero-crossing detection algorithm or 2) Disable the zero
crossing of the blocks shown in the following table. 
--------------------------------------------------------------------------------
Number of consecutive zero-crossings : 1000
          Zero-crossing signal name : Sf0
                         Block type : S-Function
                         Block path :
'FeedbackSystem_063580813592711784/DrakeSys'
--------------------------------------------------------------------------------
You can turn off this message by using the MATLAB command: 
set_param('FeedbackSystem_063580813592711784','MaxConsecutiveZCsMsg','none'); 

Error in DrakeSystem/simulate (line 481)
       [varargout{:}] = simulate@DynamicalSystem(obj,varargin{:});

Error in runLQR (line 9)
 xtraj=simulate(sys,[0 4],[pi;0;0;0]+0.05*randn(4,1));

<test_name>examples/Acrobot/runLQR</test_name>
<error_id>Simulink:Engine:SolverConsecutiveZCNum</error_id>
<error_message>At time 0.0031402301010290856, simulation hits (1000)
consecutive zero crossings. Consecutive zero crossings will slow down the
simulation or cause the simulation to hang. To continue the simulation, you
may 1) Try using Adaptive zero-crossing detection algorithm or 2) Disable
the zero crossing of the blocks shown in the following table. 
--------------------------------------------------------------------------------
Number of consecutive zero-crossings : 1000
          Zero-crossing signal name : Sf0
                         Block type : S-Function
                         Block path :
'FeedbackSystem_063580813592711784/DrakeSys'
--------------------------------------------------------------------------------
You can turn off this message by using the MATLAB command: 
set_param('FeedbackSystem_063580813592711784','MaxConsecutiveZCsMsg','none'); 

</error_message> 
strcmp(test_name,'examples/Acrobot/runLQR') && strcmp(error_id,'Simulink:Engine:SolverConsecutiveZCNum')
RussTedrake commented 8 years ago

related to #313

RussTedrake commented 8 years ago

just spent a bunch of time on this. found a few things:

sherm1 commented 8 years ago

it does not happen when i feedback combine using simulink, only when i use the FeedbackSystem class. so i believe my implementation of zeroCrossings in that class is inferior to the zero crossing implementation in the matlab saturation block

Are you referring to the C++ FeedbackSystem class here or is this still in Matlab?

RussTedrake commented 8 years ago

all matlab here. just trying to clean the servers enough to finish my PR.