scripts/speed_controller.py - add voltage output limiting
This commit is contained in:
parent
aa6744d2ac
commit
d78ac03500
1 changed files with 6 additions and 1 deletions
|
@ -74,7 +74,7 @@ def rpm_control():
|
||||||
|
|
||||||
#slow down rotating if over maximum
|
#slow down rotating if over maximum
|
||||||
if actual_rpm > float(get_variable(variable_max_rpm)):
|
if actual_rpm > float(get_variable(variable_max_rpm)):
|
||||||
set_output(actual_set_U - 1)
|
set_output(actual_set_U - 0.1)
|
||||||
print("max_rpm_reached")
|
print("max_rpm_reached")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -83,6 +83,11 @@ def rpm_control():
|
||||||
print("control_set: 0")
|
print("control_set: 0")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if actual_set_U > float(get_variable(variable_max_U)):
|
||||||
|
set_output(float(get_variable(variable_max_U)))
|
||||||
|
print("Maximum out voltage")
|
||||||
|
return
|
||||||
|
|
||||||
#algorithm for RPM control
|
#algorithm for RPM control
|
||||||
if (requested_rpm - float(get_variable(variable_control_step_rpm))) > actual_rpm:
|
if (requested_rpm - float(get_variable(variable_control_step_rpm))) > actual_rpm:
|
||||||
set_output(actual_set_U + float(get_variable(variable_control_step_U)))
|
set_output(actual_set_U + float(get_variable(variable_control_step_U)))
|
||||||
|
|
Loading…
Add table
Reference in a new issue