Skip to content

Commit

Permalink
Fix bug in speed_rate limitation in wiregrid_actuator/drivers/Actuato…
Browse files Browse the repository at this point in the history
…r.py (#579)

* update wiregrid_actuator.rst

* add speedrate parameter in insert/eject() in wiregrid_actuator
  • Loading branch information
sadachi5 authored Nov 29, 2023
1 parent 288fb5c commit 24a77aa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
7 changes: 4 additions & 3 deletions docs/agents/wiregrid_actuator.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ The main functions are ``insert()`` and ``eject()``.
In the both of the functions, after the inserting/ejecting, the stopper locks the actuators again.
However, the motor power is not turned ON or OFF during the both functions.

The parameter details are here:

- speedrate: Actuator speed rate [0.0, 5.0] (default: 1.0)

**Test Functions**
- check_limitswitch(): Check ON/OFF of the limit switches
- check_stopper(): Check ON/OFF (lock/unlock) of the stoppers
Expand All @@ -100,9 +104,6 @@ The parameter details are here:
- distance: Actuator moving distance [mm] (default: 10)
- speedrate: Actuator speed rate [0.0, 5.0] (default: 0.2)

.. warning::
DO NOT use ``speedrate > 1.0`` if ``el != 90 deg``!


Hardware Configurations
```````````````````````
Expand Down
8 changes: 4 additions & 4 deletions socs/agents/wiregrid_actuator/drivers/Actuator.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,12 @@ def move(self, distance, speedrate=0.1):
msg = 'Actuator:move(): WARNING!: Did NOT move due to STOP flag.'
print(msg)
return False
if speedrate < 0. or speedrate > 1.:
if speedrate < 0. or speedrate > 5.:
print('Actuator:move(): WARNING!: '
'Speedrate should be between 0 and 1.')
'Speedrate should be between 0 and 5.')
print('Actuator:move(): WARNING!: '
'Speedrate is sed to 0.1.')
speedrate = 0.1
'Speedrate is set to 1.0.')
speedrate = 1.0
speed = \
int(speedrate * (self.speed_max - self.speed_min) + self.speed_min)
# distance_count is an absolute value
Expand Down

0 comments on commit 24a77aa

Please sign in to comment.