powerwindow.sa 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. import PowerWindowModel
  2. semantic adaptation controller_sa
  3. for fmu controller
  4. input ports armature_current -> obj_detected, passenger_up, passenger_down, driver_up, driver_down, next
  5. output ports up, down
  6. control rules { triggered by signal == true or t >= get_next_time_step(controller) }
  7. in rules with crossing absolute tolerance = 1e-8 and relative tolerance = 0.0001, no hold {
  8. armature_current >! 5 -> obj_detected := true;
  9. otherwise(armature_current) -> obj_detected := false;
  10. }
  11. out rules with zero order hold {
  12. "up" -> up := 1;
  13. "stop" -> { up := 0; down := 0; };
  14. "down" -> down := 1;
  15. delay at up and down;
  16. }
  17. semantic adaptation window_sa
  18. for fmu window
  19. out rules {
  20. reaction_torque := -reaction_torque;
  21. }
  22. semantic adaptation window_obstacle_sa
  23. for fmu window_sa, obstacle
  24. multiply rate 10 times with first order interpolation
  25. successive substitution starts at height with absolute tolerance = 1e-8 and relative tolerance = 0.0001
  26. semantic adaptation plant_sa
  27. for fmu power, window_obstacle_sa
  28. successive substitution starts at reaction_torque with absolute tolerance = 1e-6 and relative tolerance = 1e-6