Power.mo 689 B

1234567891011121314151617181920212223242526
  1. model Power
  2. parameter Real J = 0.085;
  3. parameter Real b = 5;
  4. parameter Real K = 7.45;
  5. parameter Real R = 0.15;
  6. parameter Real L = 0.036;
  7. parameter Real V_abs = 12;
  8. Real V;
  9. output Real displacement;
  10. output Real armature_current;
  11. output Real speed;
  12. input Real tau;
  13. input Real u;
  14. input Real d;
  15. equation
  16. V = if u > 0.5 then V_abs
  17. else if d > 0.5 then -V_abs
  18. else 0.0;
  19. J * der(speed) + b * speed = K * armature_current - tau;
  20. L * der(armature_current) + R * armature_current = V - K * speed;
  21. der(displacement) = speed;
  22. annotation(
  23. experiment(StartTime = 0, StopTime = 1, Tolerance = 1e-6, Interval = 0.002)
  24. );
  25. end Power;