How to configure Belt Drive block for Hardware-in-the-Loop simulation?

To run a Hardware-in-the-Loop (HIL) simulation, I need to generate C++ code file from the circuit in the figure, which represents a model of a conveyor belt (Solver=ode14x):
The Simulink simulation works fine, but when I transfer the generated C++ code in the HIL platform, the host computer crashes with DRIVE_VERIFIER_detected_violation error. Note that when I replace the Belt Drive block with the Simple Gear block, the HIL simulation is then OK. Current setting of Belt Drive block:
  • Drive type: Open belt
  • Belt type: Flat band
  • Longitudinal stiffness: 1e+4 [N/m]
  • Longitudinal damping: 1e+5 [N/(m/s)]
  • Pre-tension: 21 [N]
  • Pulley radius (Pulley A and B): 0.1 [m]
  • Friction velocity threshold: 0.001 [m/s]
Any idea? I thank you in advance.

 Accepted Answer

The "Friction velocity threshold" parameter is usually the culprit here. This is usually a small region used to avoid numerical instability by linearly varying the friction force over the range [-0.001 0.001] m/s instead of adding a "jump" right at 0. What if you try increasing this value to make the slope of this force less steep around 0?
Alternatively, it could be that the stiffness and damping of the belt are adding some very fast dynamics that are hard to solve given your local solver time step. You could try either increasing the time step or reducing the stiffness and damping.
In both cases above, of course, you want to verify that you're not significantly affecting your simulation results.
- Sebastian

3 Comments

Firstly many thanks for your prompt answer. I have tried all the parameter variations that you suggested, and more. But unfortunately the system still gives DRIVE_VERIFIER_DETECTED_VIOLATION error in the HIL platform. Here is the list of the tests that I did, changing parameters one by one, keeping unvaried the others:
  1. Increasing the "Friction velocity threshold" from 0.001, to 0.01 m/s ---> error in HIL. Then 0.1 m/s ---> error in HIL
  2. Increasing the Sample Time from 1ms to 5ms ---> error in HIL. Then to 10ms ---> error in HIL
  3. Reducing stiffness and damping to 1e+4 and 1e+4 ---> error in HIL. Then 1e+3 and 1e+4 ---> error in HIL. (With the default values 1e+4 and 1e+3 ---> error in Simulink)
Then I tried to change simultaneously some parameters, as following:
  1. Sample time=10ms=0.01s; default values of stiffness and damping: 1e+4 and 1e+3; friction threshold=0.01m/s ---> error in HIL
  2. Sample time=10ms=0.01s; default values of stiffness and damping: 1e+4 and 1e+3; friction threshold=0.05m/s ---> error in HIL.
  3. I tried even: Sample time=50us=0.00005s; default values of stiffness and damping: 1e+4 and 1e+3; friction threshold=0.01m/s ---> error in HIL.
  4. Sample time=50us=0.00005s; default values of stiffness and damping: 1e+4 and 1e+3; friction threshold=0.001m/s ---> error in HIL.
I decided to consider the following model from MathWorks: http://www.mathworks.com/matlabcentral/answers/104510-modeling-v-belts-and-chain-drives-in-simmechanics Even this model, where I have necessarily changed Solver to ode14x with sample time=1ms, gives the above error in HIL platform.
Hmm... Do you have any damping in the Revolute Joint block, or have you tried added a rotational damper in parallel with the Torque Source? Maybe the HIL simulation doesn't like runaway acceleration in an undamped system?
Hello Sebastian, the system was already damped, via Revolute Joint:Gear --> Internal Mechanics --> Damping Coefficient= 1 [N*m/rad/s], in order to have output = 2.7 [rad/s], when input is Step going from 0 to 2.7, at Step time=1. I have tried the option of a added Rotational Damper (with C connected to Mechanical Rotational Reference 2 and R connected to R of Rev-Rot Interface), with Damping coefficient=0.001, then =0.01, and 0.1. But always unsuccessfully. At this point, since I agree with you that the problem should be on steep acceleration at Step time=1 second, I changed input to a signal like the following one, extending the simulation time from 10s to 100s:
but unfortunately the HIL simulation still gives error. In particular it is a "div by zero" error, as notified by the latest version of the HIL sw that I have just updated.
Have a nice day.

Sign in to comment.

More Answers (0)

Categories

Find more on General Applications in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!