Motor Controller - the drivetrain's brain

The motor controller is the drivetrain's intelligence. It converts battery DC into the three-phase AC the motor needs, meters output based on throttle input, and can even recharge the battery during braking.

Sine-wave controller with e-bike wiring harness
Sine-wave controller with cable harness (IMAGE: controller.webp)

What does a motor controller do?

A motor controller (often called an ESC, Electronic Speed Controller, or simply a "controller") is the brain of the drivetrain. Its job is to receive direct current (DC) from the battery and convert it into three-phase alternating current (AC) that drives the PMSM motor. At the same time, the controller reads throttle input and adjusts output accordingly, from standstill to full speed.

The motor controller is the component that truly governs the motor: how fast it should rotate, how much force it should deliver, and how smooth acceleration should feel. Controller quality therefore has a major impact on how the vehicle feels to ride.

From DC to three-phase AC

The battery supplies direct current (DC) at a given voltage (for example 72 V in GBIKE 1), but a PMSM (permanent magnet synchronous motor) requires three-phase alternating current (AC) to rotate. The controller contains electronics that rapidly switch current to the motor's three phase windings in sync, so the rotor is pulled around by rotating magnetic fields.

A three-phase system means the motor has three separate windings (U, V, W) distributed around the stator. By feeding them with alternating currents that are 120° phase-shifted a rotating magnetic field is created that drives the rotor magnets. The controller must know motor position (through sensors or sensorless estimation) to time phase currents correctly.

H-bridges and PWM - fundamentals of power control

The controller uses power electronics in the form of H-bridges (or half-bridges per phase) built from MOSFET transistors or similar components. Each phase typically has two switches: a high-side that connects the phase to battery positive, and a low-side that connects it to negative. By rapidly switching these with PWM (Pulse Width Modulation) the controller can generate effective alternating current in each phase.

PWM means the switches are turned on and off many thousands of times per second (typically 8-20 kHz or higher). By varying duty cycle (the share of time a switch is on), average voltage and current in the phase can be controlled. Higher duty cycle gives more power, lower duty cycle gives less. Thanks to motor inductance, current is smoothed and becomes relatively even despite rapid switching.

  • H-bridge: Electronic switching circuit (MOSFET-based) that lets current flow both directions through a load (phase winding).
  • PWM: Fast on/off switching to control average voltage/current - the foundation of modern power electronics.
  • Switching frequency: Higher frequency gives smoother current and less audible noise, but more switching losses (heat).

Square wave vs sine wave - quality and comfort

There are two main ways to control a BLDC/PMSM motor with a controller: square wave control (also called trapezoidal or six-step commutation) and sine wave control (also called FOC - Field-Oriented Control). The key difference is how phase currents are shaped over time.

Square wave (trapezoidal)

Square-wave controllers are simpler and cheaper. They apply full current to two phases at a time and switch every sixty electrical degrees (hence "six-step"). This creates a stepwise rotating magnetic field.

  • Advantages: simple electronics, low cost, and high peak power.
  • Drawbacks: jerky low-speed behavior, more noise (whine/cogging), lower efficiency, and higher motor heat.

Square-wave control is common in budget kits or applications where smoothness is less critical. Acceleration often feels "steppy" and the motor can sound louder, especially at low speeds.

Sine wave (FOC)

Sine-wave controllers (often implemented with FOC, Field-Oriented Control or vector control) shape phase currents as sine curves synchronized with rotor position. This creates a smooth rotating magnetic field without steps.

  • Advantages: smooth and quiet operation, better efficiency, higher low-rpm torque, lower heat, and better control of motor behavior.
  • Drawbacks: higher cost and more complex algorithms (requires a faster microprocessor).

FOC controllers continuously read motor position (via Hall sensors or sensorless through back-EMF) and compute optimal currents at every instant. The result is a ride feel similar to a powerful combustion engine: smooth, linear, and responsive.

Summary: Square wave vs Sine wave

Square wave

  • Simple, low cost
  • Jerky, noisy
  • Lower efficiency
  • Common in budget kits

Sine wave (FOC)

  • Advanced, higher cost
  • Smooth, quiet
  • Better efficiency
  • Standard in high-quality kits

Phase current and battery current - the power balance

It is important to understand the difference between phase current (current through the motor windings) and battery current (current from the battery to the controller). They are not the same thing.

Phase current is the alternating current flowing through the motor's three phases. Under full load it can be very high (for example 300 A peak and beyond in powerful motors). This current creates the magnetic field that drives the motor, and its magnitude determines motor torque according to M = Kt · Ifas.

Battery current is the direct current drawn from the battery. By conservation of energy, the following holds (ignoring losses):

Pbatteri ≈ Pmotor
Ubatteri · Ibatteri ≈ Ufas,rms · Ifas,rms · 3

At low speeds, back-EMF is low, so the controller can deliver high phase current at low phase voltage and battery current remains relatively low. At higher speeds, back-EMF rises, phase voltage approaches battery voltage, and battery current increases to deliver the same power. Battery current is therefore often lower than peak phase current at low speeds, but can become high at high speeds and full throttle.

Example

If the motor draws 150 A phase current at low speed but back-EMF is only about 20 V per phase, power can be around 3 · 20 V · 150 A ≈ 9 kW. With a 72 V battery, battery current is then about 9000 W / 72 V ≈ 125 A (plus losses). At higher speed with higher back-EMF, battery current can increase further.

Control strategies: torque-based vs speed-based throttle

How the controller interprets throttle input determines how the vehicle feels to ride. There are two main strategies: torque-based and speed-based control.

Speed-based throttle control (cruise-control-like)

Speed-based control means the throttle sets a target speed that the controller attempts to maintain. If you twist to 50% throttle, it aims for a certain speed (for example 25 km/h), and at 100% it aims for top speed. The controller automatically increases or decreases power to reach that target, regardless of load, slope, or wind.

This strategy is common in low-cost controllers because it is easier to implement. But it gives an unpredictable, unnatural ride feel. Acceleration can feel "synthetic": the vehicle pulls hard until it reaches target speed, then suddenly drops power. On climbs, the motor may unexpectedly apply full power to hold speed, while downhill it may provide little or no power. It does not feel like riding a real motor.

Torque-based throttle control (natural riding)

Torque-based control means the throttle sets how much torque (force) the motor should produce. 50% throttle gives 50% of available peak torque, 100% gives 100% torque. Acceleration then becomes proportional to throttle input, similar to a combustion engine or an e-bike with a torque sensor.

This strategy gives a predictable and intuitive ride feel, much like a combustion engine. The rider has direct control over force, and the vehicle accelerates smoothly and linearly. Uphill, the vehicle naturally slows unless you add throttle; downhill, it speeds up until back-EMF limits it. You control force, not speed. This is the standard in high-quality controllers and provides the best ride experience.

Summary: Torque-Based vs Speed-Based

Speed-based

  • Controls target speed
  • Less natural feel
  • Unpredictable acceleration
  • Common in low-cost controllers

Torque-based

  • Controls torque (force)
  • Natural and predictable feel
  • Linear acceleration
  • Standard in high-quality controllers

Regenerative Braking - Recharging During Braking

An advanced sine-wave controller can also support regenerative braking (regen) This means the motor can act as a generator during braking and send energy back to the battery. For this to work, the motor must be direct-drive (no freewheel), and the controller must reverse current flow.

During regen, the controller reads brake input (from lever sensors or when the rider releases throttle), reconfigures the H-bridges, and lets wheel rotation drive the motor as a generator. The generated AC is then rectified back to DC and fed into the battery. At the same time, generator effect creates magnetic resistance that slows the wheel in a smooth, controlled way without mechanical wear.

Regen is especially useful in hilly terrain (long descents) or city traffic with many stops. It reduces brake pad wear, extends range, and makes the ride smoother. There are limits: regen does not work at very low speeds (below about 10-15 km/h), and if the battery is full the system cannot accept more energy (see our article on regenerative braking).

GBIKE 1: A High-Quality Sine-Wave Controller

The GBIKE 1 kit is equipped with a sine-wave controller (FOC controller) with torque-based throttle control. This is an intentional choice to deliver the best possible ride experience: smooth, quiet, efficient, and predictable.

Sine Wave for Smoothness and Efficiency

Thanks to sine-wave control (FOC) you get smooth, quiet operation without the jerky feel of cheap square-wave controllers. Acceleration is linear and comfortable from standstill to top speed. The motor also runs more efficiently, giving longer range and lower heat buildup, especially important for a direct-drive hub motor where cooling is limited.

Torque-Based Throttle for Natural Riding

The GBIKE 1 controller uses torque-based control, meaning the throttle directly controls motor torque. This gives a predictable, intuitive feel, similar to a combustion engine. Twist the throttle, the motor delivers proportional force, and the vehicle accelerates smoothly. No strange "cruise control" effects, no unpredictable power delivery. Just clean, direct control.

Sizing and Limits

The controller is rated for 72 V nominal (84 V fully charged) and can handle continuous current up to about 45 A from the battery, with short peaks up to around 80 A for acceleration. This yields a theoretical peak power of about 72 V × 80 A ≈ 5,760 W (5.8 kW) (electrical) during short accelerations.

Phase currents to the motor can be higher than battery current at low speeds (thanks to buck conversion in the controller), which gives strong standstill torque. This is one advantage of FOC: intelligent phase-current control for maximum efficiency and performance.