mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-11 17:14:41 +00:00
doc/parameters: document stop types in table
Make more explicit how the stop types gradually add more resistance to motion.
This commit is contained in:
@@ -59,6 +59,31 @@
|
||||
.. autoclass:: pybricks.parameters.Stop
|
||||
:no-members:
|
||||
|
||||
The following table show how each stop type adds an extra level of
|
||||
resistance to motion. In these examples, ``m`` is a
|
||||
:class:`Motor <pybricks.ev3devices.Motor>` and
|
||||
and ``d`` is a :class:`DriveBase <pybricks.robotics.DriveBase>`. The
|
||||
examples also show how running at zero speed compares to these stop types.
|
||||
|
||||
+--------+------------+--------+-------------+---------------+-----------------------------------------+
|
||||
| | Type | | Friction | | Back | | Speed | | Angle kept | | Examples |
|
||||
| | | | EMF | | kept at 0 | | at target | |
|
||||
+========+============+========+=============+===============+=========================================+
|
||||
| Coast | + | | | | | ``m.stop()`` |
|
||||
| | | | | | | ``m.run_target(500, 90, Stop.COAST)`` |
|
||||
+--------+------------+--------+-------------+---------------+-----------------------------------------+
|
||||
| Brake | + | + | | | | ``m.brake()`` |
|
||||
| | | | | | | ``m.run_target(500, 90, Stop.BRAKE)`` |
|
||||
+--------+------------+--------+-------------+---------------+-----------------------------------------+
|
||||
| | + | + | + | | | ``m.run(0)`` |
|
||||
| | | | | | | ``d.drive(0, 0)`` |
|
||||
+--------+------------+--------+-------------+---------------+-----------------------------------------+
|
||||
| Hold | + | + | + | + | | ``m.hold()`` |
|
||||
| | | | | | | ``m.run_target(500, 90, Stop.HOLD)`` |
|
||||
| | | | | | | ``d.straight(0)`` |
|
||||
| | | | | | | ``d.straight(100)`` |
|
||||
+--------+------------+--------+-------------+---------------+-----------------------------------------+
|
||||
|
||||
.. autoclass:: pybricks.parameters.Color
|
||||
:no-members:
|
||||
|
||||
|
||||
@@ -85,20 +85,6 @@ class Stop(_PybricksEnum):
|
||||
|
||||
Keep controlling the motor to hold it at the commanded angle. This is
|
||||
only available on motors with encoders.
|
||||
|
||||
The stop type defines the resistance to motion after coming to a
|
||||
standstill:
|
||||
|
||||
+-----------+-------------+------------------------------------------+
|
||||
|Parameter | Resistance | Physical meaning |
|
||||
+===========+=============+==========================================+
|
||||
|Stop.COAST | low | Friction |
|
||||
+-----------+-------------+------------------------------------------+
|
||||
|Stop.BRAKE | medium | Friction + Torque opposite to motion |
|
||||
+-----------+-------------+------------------------------------------+
|
||||
|Stop.HOLD | high | Friction + Torque to hold commanded angle|
|
||||
+-----------+-------------+------------------------------------------+
|
||||
|
||||
"""
|
||||
|
||||
COAST = 0
|
||||
|
||||
Reference in New Issue
Block a user