You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: sets/technic/42114-volvo-articulated-hauler/powered-up-remote/index.md
+54-7Lines changed: 54 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,7 @@ maintainer:
5
5
name: "Repkovsky"
6
6
image:
7
7
local: "42114_88010.jpg"
8
+
credit: "LEGO"
8
9
description:
9
10
"Control the Volvo articulated hauler with the Powered Up Remote!"
10
11
video:
@@ -15,24 +16,70 @@ code: "#program"
15
16
---
16
17
17
18
18
-
# Program
19
+
# Manual and automatic switching mode
19
20
20
-
The program for controlling Technic Volvo Articulated Hauler with remote control is more complicated than the other remote control programs because of the 3-gear gearbox, which works both in manual and automatic mode. Manual switching gears requires not only detection whether remote button is pressed or not, but rather detection of button pressing (or releasing) moment itself. This is realized using class '''Key'''. Automatic gearbox needs to detect proper time for switching gear up or down. This is possible by measuring speed of XL motor, when it is running. If the speed is systematically very low, the gear is decreased. If the speed is systematically close to maximum, the gear is increased. To make speed measurement robust to random variations, values obtained from speed sensor are filtered using simple [exponential smoothing|https://en.wikipedia.org/wiki/Exponential_smoothing]. Threshold values of speed, measurement time and smoothing constant are defined by constants `HI_SPEED, LO_SPEED`, `STABLE_SPEED_TIME` and `SMOOTHING`. If the automatic gearbox does not change gears even if Hauler reaches full speed, `HI_SPEED` should be decreased. Speed tracking, keeping the current state of gearbox and handling the remote/hub LEDs was implemented in the class '''Gearbox'''.
21
+
The program for controlling Technic Volvo Articulated Hauler with remote
22
+
control is a bit more complicated than the other remote control programs
23
+
because of the 3-gear gearbox, which works both in manual and automatic mode.
24
+
25
+
Manual gear switching requires not only detection whether the remote button is
26
+
pressed or not, but also detection of the button press (or release) moment
27
+
itself. This is realized using the ``Key`` class.
28
+
29
+
The automatic gearbox needs to detect the proper time for switching the gear
30
+
up or down. This is possible by measuring the speed of XL motor, when it is
31
+
running. If the speed is systematically very low, the gear is decreased.
32
+
If the speed is systematically close to maximum, the gear is increased.
33
+
34
+
To make speed measurement robust to random variations, values obtained from
Threshold values of speed, measurement time and smoothing constant are defined
38
+
by the constants `HI_SPEED, LO_SPEED`, `STABLE_SPEED_TIME` and `SMOOTHING`.
39
+
If the automatic gearbox does not change gears even if Hauler reaches full
40
+
speed, `HI_SPEED` should be decreased. Speed tracking, keeping the current
41
+
state of gearbox and handling the remote/hub LEDs was implemented in the
42
+
``Gearbox`` class.
21
43
22
44
# Driving and switching gears
23
45
24
-
By default left controller controlls left/right steering, and right controller determines direction of driving. This can be changed easily by setting constant `LEFT_STEER_RIGHT_DRIVE` to False.
46
+
By default, the left controller controls the left/right steering, and the right
47
+
controller determines the direction of driving. This can be changed easily by
48
+
setting the constant `LEFT_STEER_RIGHT_DRIVE` to False.
25
49
26
-
Gearbox can be used in two modes, as in the original LEGO smartphone app: *automatic* and *manual*. You can switch between the modes by pushing the green button on the remote. *Automatic* is default starting mode, but this can be easily changed by modifying constant `INIT_GEARBOX_AUTO`.
50
+
The gearbox can be used in two modes, as in the original LEGO smartphone app:
51
+
*automatic* and *manual*. You can switch between the modes by pushing the green
52
+
button on the remote. *Automatic* is default starting mode, but this can be
53
+
easily changed by modifying constant `INIT_GEARBOX_AUTO`.
27
54
28
-
In the *automatic* mode, gears are changed when program detects that motor's speed is too slow or close to maximum speed. Current gear is indicated by the color of the remote's LED - 1: cyan, 2: blue, 3: magenta. To enable dumper (remote's LED: green), press right red button on the remote. To go back to driving mode, press left red button. If drive is idle for time longer than defined in constant `GEAR_RESET_TIMEOUT`, the gear is set to 1.
55
+
In the *automatic* mode, gears are changed when program detects that motor's
56
+
speed is too slow or close to maximum speed. The current gear is indicated by
57
+
the color of the remote's LED:
58
+
1. Cyan
59
+
2. Blue
60
+
3. magenta
61
+
62
+
To enable dumper (remote LED: green), press the right red button on the remote.
63
+
To go back to driving mode, press left red button. If drive is idle for time
64
+
longer than defined in constant `GEAR_RESET_TIMEOUT`, the gear is set to 1.
29
65
30
-
In the *manual* mode gear is decreased by pressing left red button, and increased with right red button. Gearbox positions are indicated by the color of LED: 1: yellow, 2: orange, 3: red, Dumper: green.
66
+
In the *manual* mode, the gear is decreased by pressing left red button, and
67
+
increased with right red button. Gearbox positions are indicated by the color
68
+
of LED:
31
69
32
-
Sometimes gearbox tends to jam. If the target angle of gear selector is not reached within the time defined by `GEAR_SWITCH_TIMEOUT` (1.5sec by default), the automatic gearbox reset is performed. Hub's LED changes to red, while gearbox is recalibrated, setting gear to 1.
70
+
1. Yellow
71
+
2. Orange
72
+
3. Red
73
+
74
+
Sometimes gearbox tends to jam. If the target angle of gear selector is not
75
+
reached within the time defined by `GEAR_SWITCH_TIMEOUT` (1.5 sec by default),
76
+
the automatic gearbox reset is performed. The hub LED changes to red, while
77
+
the gearbox is recalibrated, which sets the gear to 1.
0 commit comments