Project

General

Profile

PWM Output » History » Version 1

Adam Klama, 06/21/2026 03:26 PM

1 1 Adam Klama
# PWM Output
2
3
## Overview
4
A **PWM Output** drives a hardware pin with a pulse-width-modulated signal. It is
5
the most common output type, used to control solenoids, proportional valves,
6
lamps/LEDs, fans, and other actuators where the average power is set by the duty
7
cycle.
8
9
It runs in one of two modes:
10
- **PWM mode** — you command a **duty cycle**; the pin switches at the configured
11
  frequency.
12
- **Current mode** — the output regulates to a commanded **current** (closed-loop),
13
  which is what most proportional solenoids need for repeatable behaviour.
14
15
## Prerequisites & hardware
16
- Wire the actuator between the output pin and its return per the controller pinout;
17
  observe the channel's current rating.
18
- Fit a **flyback/freewheel path** for inductive loads (solenoids, relays) if the
19
  channel does not provide one.
20
- For current-controlled solenoids, use **Current mode** and set the
21
  **current limit** to the actuator's rating.
22
23
## Add it in the app
24
1. Add a new output and choose **PWM Output** as the type.
25
2. Select the **pin** and give it an **alias** (e.g. `Line Pressure Solenoid`).
26
3. Choose **Mode**, set the **frequency**, and configure **peak & hold** if the
27
   actuator needs it.
28
4. Drive the output from a map/driver that supplies the duty or current command.
29
30
## Settings reference
31
> Schema: `config/PwmConfiguration.proto`.
32
33
| Setting | Meaning | Unit | Range / values | Notes |
34
|---|---|---|---|---|
35
| **Mode** | Control strategy | — | `PWM`, `Current` | `PWM` = command duty cycle; `Current` = closed-loop current regulation. |
36
| **Frequency** | PWM switching frequency | Hz | 100 – 4000 | Higher = quieter/smoother; match the actuator's recommended frequency. |
37
| **Invert** | Inverts the output polarity / duty | — | on / off | Use when the load is wired active-low or logic is reversed. |
38
| **Current limit** | Maximum output current | mA | uint32 | Protects the actuator and driver; used as the regulation target ceiling in Current mode. |
39
| **Peak & hold** | Enables a peak-then-hold drive profile | — | on / off | Pull a solenoid in at high current, then hold it with less — saves power/heat. |
40
| **Peak value** | Current/duty during the peak phase | mA or % | sint32 | Applied for the peak time at engage. |
41
| **Peak time** | Duration of the peak phase | ms | sint32 | How long the peak value is applied before dropping to hold. |
42
| **Hold value** | Current/duty during the hold phase | mA or % | sint32 | Steady-state level once engaged. |
43
| **Proportional hold** | Scales the hold level proportionally | — | on / off | Hold tracks the command rather than a fixed level. |
44
45
## Common settings
46
PWM Output also uses the shared settings — alias and pin. See [Common IO Settings](Common_IO_Settings).
47
48
## Example — peak-and-hold shift solenoid
49
1. Type **PWM Output**, alias `Shift Solenoid A`, on the solenoid's pin.
50
2. **Mode = Current**, **Current limit** = solenoid rating.
51
3. **Peak & hold on**: Peak value = high pull-in current, **Peak time** ≈ 30–60 ms,
52
   **Hold value** = lower steady current.
53
4. **Frequency** per the solenoid data sheet (commonly 1–2 kHz).
54
5. Command it from the shift logic/map.
55
56
## Troubleshooting
57
- **Actuator buzzes / audible whine:** raise the **frequency** above the audible
58
  range or to the actuator's recommended value.
59
- **Solenoid won't pull in but holds weakly / vice-versa:** revisit **peak value**
60
  and **peak time**.
61
- **Output runs backwards / always on:** check **Invert**.
62
- **Overheats or trips:** check the **current limit** and that hold current isn't
63
  set too high.
64
65
## Related
66
- [Analog Output](Analog_Output) — for an analog voltage instead of PWM.
67
- [Tacho Output](Tacho_Output) — generated tacho/frequency signal.