• Hello ES! We could use some help to get us past the finish line on building the new knowledgebase for the forum.
    Can you donate? Please see our fundraising page. Thank you!

Knowledgebase

Controller Terms 101 | Controllers 01/29/25 3mo ago  neptronix

Basic motor wiring

Controllers are generally split into two camps:
Bafang/Ebikes.ca style
Old school / cheap
image




This type of controller tends to have waterproof higo-style connectors and has proprietary wiring layouts as a result. These look a lot nicer, but are hard to adapt parts from different controllers to, so it's recommend that you buy matching accessories, or insist on a wiring diagram.

Many bafang controllers using this style connectors have a fairly standardized layout, allowing some things like throttles and ebrake levers to easily be swapped. 
image

These will typically have colored wires that generally match from controller to controller.

The individual pins can be ejected from the plastic connector and re-ordered, making it easy to swap parts from controller to controller.

Fun fact: the bulky white connector for hall sensors is typically referred to as 'white head' by Chinese vendors. 

Both types will have, at a minimum, these wires:
  1. 3 phase connectors to the motor ( usually, but not always colored green, yellow, and blue )
  2. a motor hall sensor connector with 5 pins, and maybe a 6th pin ( usually white ) for temperature or speed sensing.
  3. a throttle or pedal assist sensor connector
  4. a battery connector
  5. ebrake lever connections
All but a single % of brushless ( modern ) motors will have the same 3 phase connections and 5 hall wires.

Basic controller programming terminology

Term What it does & notes
Battery current This determines the maximum amperage drawn from the battery at any given time, regardless of low or high RPM.
Phase current This is the maximum current delivered to the motor - and since electric motors produce most of their torque around 0 RPM, more current than during cruise is required to start an electric motor up.

At low RPM, motor controllers convert a high battery voltage into a lower voltage but higher current in order to utilize this low RPM torque potential. For this reason, phase current is typically 2.25x-2.5x the battery current.

Changing the multiplier of battery current will alter the low to mid RPM torque curve. For example, Battery current x 2.0 will produce a fairly flat torque curve, but battery current x 3.0 will make the vehicle feel more like a rocket off the line.

This value is very important for motors with gears; gears do not like large jolts of power from a stop, so the safest tuning for these kinds of motors is a flatter torque curve.

But a direct drive hub motor doesn't have this consideration, so it can be well abused!
Ebrake An ebrake is a regular brake lever with a sensor that detects when the brake is being engaged. A typical controller cuts power when the ebrake lever is depressed, and if regenerative braking is enabled, it will also start regenerative braking.

This is an important safety feature. There are some failure modes with throttles that can lead to wide open throttle. On a powerful vehicle, this is incredibly dangerous. An ebrake can be the only thing capable of stopping the vehicle when a throttle is faulty since many motors can overpower the mechanical brakes!
Regenerative braking battery current This is the maximum current that can flow into the battery during regenerative braking. It's important to have this value equal or lower to the maximum charge rate the battery can accept.

If this value is exceeded, the battery lifespan will suffer. If this value is greatly exceeded, the battery's BMS may trip as a result, suddenly stopping braking by turning the battery off.
Regenerative braking phase current This is similar to motor phase current, it determines the maximum amperage that can be converted to the battery's voltage. This also increases braking force at low speeds. Like phase current, this is typically 2.5x the regenerative braking battery current by default on most controllers.
Drive mode
( FOC, Square, Sine )
Square wave, aka trapezoidal drive, is the original drive mechanism for ebike controllers. It blasts choppy, rectangular looking output into a motor and makes the most noise. The throttle is essentially a speed control in this mode and feels more like an on-off switch than a gasoline throttle's response.
Cheap controllers typically use square wave drive.

Sine wave is a modified square wave, whose output looks more like a curve. As a result, this runs much quieter, however, it's not capable of modulating the power via the throttle based on torque like FOC.

FOC stands for field-oriented control.
FOC uses complex math to deliver ultra-smooth power, typically producing a few % better efficiency than sine/square, while also producing virtually no motor noise.

In this drive mode, the throttle can act like a torque modulator, which is more predictable and similar to a gasoline motor throttle.

FOC controllers tend to be more expensive due to their high complexity. 
Sensored / Sensorless Motors with hall sensors are able to precisely determine where they are in the motor's rotation cycle, whether at low RPM or high RPM, therefore they can provide control across the power band.

Sensorless mode works poorly at low RPM, because the controller has to assume where the motor is in the cycle based on electromagnetic hints, and has a very hard time doing this at low RPM range, so you may experience stuttering and/or lower torque around 0 RPM. However, sensorless works great in the mid to high RPM range.

If your motor has working hall sensors, you should use sensored mode.
Low Voltage Cutoff At this voltage, the controller will stop supplying current to the motor, to protect the battery from being overdischarged, which can damage it.

Battery cells have a max voltage they can be charged and discharged to before they take increasing amounts of damage as they get further into the extremes.
And a damaged lithium battery is a dangerous lithium battery.

A characteristic of most batteries is that after 90% of the energy is spent, the cell rapidly dives to 0 volts. So having a low voltage cutoff set around the voltage of the battery being fully discharged is an important safety feature.

A Complete Guide to 18650 Battery Voltage

Typically a BMS will also have this kind of protection, so low voltage cutoff in a controller is a redundant safety feature.
High Voltage Cutoff The same idea, except we're using this value to prevent the battery from being overcharged while using regenerative braking. The BMS should also prevent this from happening.
Pedal assist / torque assist This is an alternative to using a throttle that determines the amount of power to deliver based on pedal power.

Pedal assist uses a ring of magnets and a hall sensor that fires little pulses to the controller, the controller counts the RPM, and outputs power to the motor based on how fast you are pedaling.

This is not a great drive method - typically it will be laggy to start and stop, and feel unnatural since it doesn't take leg torque into the equation.

Torque assist uses both the speed of pedaling and your leg's torque to determine how much power to output to the motor. This leads to a much more natural power modulation. A majority of people prefer this over pedal assist.
Flux weakening / phase advance Flux weakening ( FOC controllers ) and phase advance ( square/sine controllers ) is a controller feature that can increase the max RPM of a motor by fighting the natural back electro-magnetic force ( BEMF ) of the motor.

This setting can add a couple MPH to an EV with the caveat that more amps/watts must be consumed to achieve the higher speed.
There is also a minor efficiency loss involved in using this feature.

For more, read: https://endless-sphere.com/sphere/threads/compact-field-oriented-controller-asi-grin-limited-run.65031/page-

Your controller will have many settings in addition to these. Consult your controller manual, or search ES for more information on all the different parameters!

Major components inside a controller:

Component
What it does Picture
MOSFET
( metal oxide field effect transistor)



Takes DC current, chops it up into 3 phases, and acts like a valve to control the power output.

The MOSFET handles most of the current, and also makes most of the heat in a controller, so their amperage and voltage ratings are important - how many MOSFETs, what type they are, and how good the air cooling/heatsink is determines a controller's power rating.
image
Capacitor Buffers the resulting choppy power to smooth out voltage spikes that occur naturally as a function of chopping power into a square wave.

The voltage rating of a capacitor ( 50v, 63v, 80v, etc ) typically determine the absolute  maximum voltage a controller can handle. They, or the MOSFETs, are the first to go when their limits are substantially exceeded.
image
MCU
( motor controller unit )
This is the CPU of the controller; it determines how much current, when, and on which of the motor's 3 phases to send power to in the motor's rotation cycle, using hall sensors or other measurement devices to determine where the motor is in it's cycle of rotation.

Note: some controllers can run in sensorless mode, too.

Note2: The switching rate of the MCU ( KHz ) determines how fast of a motor the MCU can drive without stuttering because it cannot keep up with the rate the motor is spinning.

Controllers built for direct drives ( 100's of RPMs ) typically cannot drive exceptionally fast spinning mid drives or geared motors ( 1000's of RPMs ), but an RC controller ( designed for 10,000's of RPMs ) with a super high switching rate can drive anything.
image