Blog · 2026-11-10

What determines when an automatic transmission shifts?

Stefan Bogdanescu

Founder & Senior Architect

What Determines When an Automatic Transmission Shifts?

If you are building a microcontroller-based automatic bicycle, you likely assume the shifting logic mirrors a standard automotive transmission: maintain a target RPM range and shift up or down as needed. While that intuition holds some truth for highway driving, it breaks down under high torque loads like gravity feeding a bike downhill. To implement this correctly, you need to understand the hierarchy of inputs the Transmission Control Unit (TCU) evaluates, not just which sensor provides the primary trigger.

The core logic is rarely a simple if (rpm > threshold) statement. Instead, it is a weighted decision process involving engine speed, vehicle velocity, throttle position, and load conditions. In a car, you might observe the transmission holding a gear until the engine hits 5,000 or 6,000 RPM during acceleration. This isn't an arbitrary limit; the TCU calculates the optimal shift point based on the current gear ratio and the desired torque curve. However, once you apply heavy throttle—such as merging onto a highway—the system prioritizes maintaining power delivery over strict RPM adherence. It will allow RPM to climb higher than its "normal" shift table if it detects the driver demands full torque.

For your bicycle application, the downhill scenario presents a specific challenge regarding load and throttle input. On a manual bike, you stop pedaling, reducing engine load to near zero. An automatic transmission must replicate this behavior by distinguishing between "coasting" and "accelerating." Most automotive ECUs use a combination of throttle position sensor (TPS) data and wheel speed sensor inputs to make this determination. If the TPS reads low while vehicle speed increases due to gravity, the TCU interprets this as a coasting event. It will execute a series of upshifts rapidly to keep the engine in its most efficient operating range, effectively "matching the speed" rather than fighting gravity with high RPM.

Implementing this on a microcontroller requires careful state management. You cannot simply rely on a fixed RPM threshold because a bike's final drive ratio differs significantly from a car's. Your code needs to model the drivetrain dynamics. A robust approach involves calculating the required gear ratio based on current velocity and target engine speed, but always gating these calculations against load conditions.

Consider this pseudocode logic for your control loop:

// Assume variables: currentRPM, vehicleSpeed, throttlePosition, gear, driveMode

void shiftLogic() {
    // Determine if the system is under load (accelerating) or coasting
    bool isCoasting = (throttlePosition < COAST_THRESHOLD);
    
    // Define base RPM targets for each gear
    float targetRPM[6] = {2000, 3000, 4500, 6000, 7000, 8000};
    
    if (isCoasting) {
        // Priority: Efficiency. Shift up to keep RPM low while maintaining momentum.
        // Check if current RPM is below the target for the next gear minus a buffer
        if (currentRPM < targetRPM[gear] - 200 && gear < MAX_GEAR) {
            shiftUp();
        }
    } else {
        // Priority: Torque. Allow RPM to rise before shifting to maintain acceleration.
        // Only shift up if RPM exceeds the high-end target significantly
        if (currentRPM > targetRPG[gear] + 1500 && gear < MAX_GEAR) {
            shiftUp();
        }
    }
    
    // Downshifting is triggered by low speed or high load demand
    if (vehicleSpeed < MIN_SPEED_FOR_GEAR[gear] || requestHighTorque()) {
        shiftDown();
    }
}

The critical distinction here is the isCoasting flag. By checking throttle position against a threshold, your system mimics the behavior of a human rider stopping to pedal. If you ignore this and strictly follow an RPM curve, the transmission might hold a lower gear while coasting downhill, causing the engine to rev high unnecessarily or even stall if the load drops too quickly without a corresponding speed increase.

When integrating these sensors into your firmware, ensure you handle noise filtering appropriately. Throttle position on a bike can be erratic if using variable reluctance sensors without proper debouncing logic in your interrupt handlers. Furthermore, remember that transmission shift points are not static; they vary based on temperature and oil pressure if you are designing for robustness. For a prototype, hardcoding conservative RPM buffers is safer than relying on complex lookup tables until you have empirical data from the field.

Ultimately, the decision to shift is a balance between efficiency, power delivery, and stability. Your microcontroller must weigh these factors dynamically, recognizing that what works for a car merging onto a highway will not work for a bicycle descending a hill without pedaling.