Skip to content

Commit

Permalink
minor edits
Browse files Browse the repository at this point in the history
  • Loading branch information
khaledghobashy committed May 6, 2020
1 parent a927b56 commit 9115d56
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion simenv/simulations/controled_acceleration.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@
TR = 254


controller = speed_controller(40, dt)
controller = speed_controller(60, dt)

def torque_function(t):
P_ch = num_model.Subsystems.CH.P_rbs_chassis
Rd = num_model.Subsystems.CH.Rd_rbs_chassis
if t >= 3:
controller.desired_speed = 0
factor = controller.get_torque_factor(P_ch, Rd)
return factor

Expand Down
2 changes: 1 addition & 1 deletion simenv/simulations/controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def get_torque_factor(self, P_ch, Rd_ch):
self._last_err = err

factor = P + I + D
if factor > 1.2:# or factor < -1.2:
if factor > 1.2 or factor < -1.2:
self._sum_int -= err * self.dt

factor = clamp(factor, -1.2, 1.2)
Expand Down

0 comments on commit 9115d56

Please sign in to comment.