> For the complete documentation index, see [llms.txt](https://docs.cennso.com/components/smc/latest/llms.txt) (all documentation: [llms.txt](https://docs.cennso.com/llms.txt)). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cennso.com/components/smc/latest/troubleshooting/load-control-rejection-bang-bang.md).

# Rejection ratio oscillates between 0 and 1

The proportional-integral-derivative (PID) controller's per-tick delta is large enough that a single tick of error drives the rejection ratio to either bound (`0` or `1`) before the next tick can update the error signal. The output then bang-bangs between zero and full rejection.

## Symptoms

- **ergw_adaptive_rejection_ratio** swings between `0` and `1` every few ticks.
- The structured log shows `delta_i` magnitudes comparable to or larger than the current rejection ratio.
- Operators see request error rates that lurch from zero to severe and back.

## Possible causes

- The integral gain `ki` is too large for the current traffic shape.
- A misconfigured derivative gain `kd` amplifies high-frequency noise into the integral term.

## Solution

To stabilize the controller, lower the integral gain:

1. Set the integral gain to the design-guide recommendation:

    ```bash
    curl -X PATCH -H 'content-type: application/merge-patch+json' \
         -d '{"rejector":{"ki":0.2}}' \
         http://{SMC_POD}:9090/oam/v1alpha/load_control/config
    ```

2. Watch **ergw_adaptive_rejection_ratio** for at least one minute. If it still oscillates, lower further:

    ```bash
    curl -X PATCH -H 'content-type: application/merge-patch+json' \
         -d '{"rejector":{"ki":0.1}}' \
         http://{SMC_POD}:9090/oam/v1alpha/load_control/config
    ```

3. If the structured log shows `delta_d` values comparable in magnitude to `delta_i`, also reduce the derivative gain to dampen the tick-over-tick noise:

    ```bash
    curl -X PATCH -H 'content-type: application/merge-patch+json' \
         -d '{"rejector":{"kd":0.0}}' \
         http://{SMC_POD}:9090/oam/v1alpha/load_control/config
    ```

4. Persist the working values in `loadControl.rejector.ki` and `loadControl.rejector.kd` in the Helm values.

The controller becomes slower to converge with a smaller `ki` but stops bang-banging.

## Read more

- [Adaptive load control technical reference — PID controller](https://docs.cennso.com/components/smc/latest/reference/load-control.md#pid-controller-rejector)
- [Adaptive load control technical reference — Tuning guidance](https://docs.cennso.com/components/smc/latest/reference/load-control.md#tuning-guidance)
