Skip to content

Commit 749ebff

Browse files
committed
fixes #125
1 parent 8b93279 commit 749ebff

3 files changed

Lines changed: 22 additions & 4 deletions

File tree

course/robot_control/intro_to_prop_control.rst

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,18 @@ Naturally, you recognize there's a difference between where you want to be (70 m
2222
(65 mph). This difference is the called the **error**, and in this case, it's 5 mph. It's easily calculated by
2323
the formula:
2424

25-
.. code-block:: python
25+
.. tab-set::
2626

27-
error = setpoint - process_variable
27+
.. tab-item:: Python
28+
29+
.. code-block:: python
30+
31+
error = setpoint - process_variable
32+
33+
.. tab-item:: Blockly
34+
35+
.. image:: media/set_error.png
36+
:width: 300
2837

2938
Knowing the error isn't enough. How should you, the driver, react to it? This is where the concept of Proportional
3039
control comes into play.
@@ -34,9 +43,18 @@ brakes, you adjust your speed based on your error: how far you are from your des
3443

3544
A measure called **control output** tells you much to adjust. It's calculated as:
3645

37-
.. code-block:: python
46+
.. tab-set::
47+
48+
.. tab-item:: Python
49+
50+
.. code-block:: python
51+
52+
control_output = Kp * error
53+
54+
.. tab-item:: Blockly
3855

39-
control_output = Kp * error
56+
.. image:: media/control_output.png
57+
:width: 300
4058

4159
where Kp is a constant called the **proportional gain** and acts as a scaling factor for the error.
4260

19.9 KB
Loading
23.2 KB
Loading

0 commit comments

Comments
 (0)