ABOUT CONTROLLERS :

how do they work?

Controllers are really complex little beasties. Their basic function is of course to control the speed of the motor, but they have evolved in the last few years to perform qutie alot of different functions. They began as fairly simple speed control units for dc motors, but over the last 5 or 6 years since ebikes have developed so rapidly they are continually evolving. Since brushless motors are generally superior to brushed motors for use in ebikes, most controllers are for brushless motors and a brushless motor is really an AC type motor ( altnerating current), so apart from having to control speed the controllers also have to perform in conjunction with hall sensors in the motor which act as switches ( they really replace commutators used in dc motors).

One very recent development ( 2009) is the availability of an 'off the shelf' programmable controller.

The basics:

Controllers for electric bikes have the following components:

1.mosfets
2.voltage converter (regulator)
3. pulse width modulation circuit (via an on board chip)
4. other parts are resistors, capacitors and diodes.


Basic components of a speed controller shown below:


 


Pulse Width Modulation (PWM):

This is provided by use of an integrated circuit or chip on the circuit board. What is PWM........glad you asked!
It is a method of varying the voltage that the motors 'sees' from the batteries, this controls the speed of the motor via the throttle.
I came across an old method of controlling  a dc motor some time ago and it helped me to understand how a pwm chip works so here it is:


The picture above shows a tube that rotates very quickly ( maybe 5,000rpm or more). It is made of a conducting area and a non-conducting area.
It has two graphite brushes which lie on the tube and can slide along it. For example say we put 12volts across the brushes with a battery and maybe a light in the circuit too. We start the tube spinning very quickly. At the top of the diagram you can see when the tube spins the brushes are always in contact with the conducting metal part (brown) and the light will shine brightly as it is getting 12volts (100% on).
If we slide the brushes along the tube at some times the brushes will be in contact with the metal conductor and the light will come on. At other times the brushes will be in contact with the non-conductive part of the tube and the light will go off. If the tube is rotating fast enough the light will appear to stay on but not as bright as it was with 12v, so the voltage that it 'sees' is in this case 80% of the original voltage (12v) which is 9.6volts.

Similarly sliding the brushes further along the period when the light is off increases and the voltage which the light 'sees' drops and so the brightness of the light diminishes till eventually the brushes only contact the non-conductive surface of the rotating tube and the light will of course be off.

So Pulse Width Modulation can be looked at like this. The pulse is really the period of 'on' when the electrons are flowing through the conductor in this example. The 'width' is referring to the time that the circuit is on or off, and the "modulation" of course refers to be able to vary this somehow.

In a controller the rotation of the tube is replaced by an oscillating circuit which instead of having an rpm, has a frequency. Usually the frequency is a bit less than 20,000Hertz. For the example above it would mean the tube would have to spin very fast indeed. A high frequency is used because it is a more efficient process at given frequencies (I think!!).

[ off topic: one hertz is one cycle per second, one rpm is one revolution (cycle) per minute. For the tube to be equivalent to a oscillating circuit of 20,000 Hz it would have to rotate at :    20,000 revolutions per second which is 20,000 *60 = 1,200,000 revolutions per minute (rpm)!, well there is really two on/off periods for each revolution so it would be 1,200,000/2 = 600,000 rpm which is just not possible to do]

The throttle on an ebike is used to vary the pwm cycle (also called the duty cycle...i think!) and hence control the speed of the motor. The throttle uses a linear hall sensor device to do that which I'll discuss in the throttle section at a later time.

The Mosfets:

Picture shows poor quality clone on left, good quality original irf mosfet on right



Mosfets are ingenious electronic devices which are really switches that can carry a very high current but require only a tiny amount of current to turn them on/off.
The mosfets need to be able to turn on/off very rapidly ( around 18,000 times per second). There have also been alot of developments in mosfets in the last few years also. Each mosfet has its own characteristics which determine its suitability for use at different voltages and amps. The quality and type of mosfet used is an
extemely important aspect of the reliability of a controller.

Previously controllers were mainly 6 mosfet type, but now they can come in 6, 12, 15 or 18 mosfet types. The more mosfets the higher the current the controller can handle.

The mosfets are very small switching devices which allow a very small current to be used to switch a large current on and off. There are brushed and brushless motors. All these motors are 3 phase motors ( 3 phase is an efficient way to run a motor invented by Nicholas Tesla at about the turn of the century). The controller for a brushed motor is somewhat simpler than that of a brushless motor and hence also smaller in size usually.
But both controllers use mosfets. In a brushed motor the mosfets are used to turn the large current to the motor on and off in synchronisation with the pwm cycle (duty cycle), this also occurs in a brushless motor. But a brushless motor doesn't have a commutator to switch the current to make the motor turn so mosfets (and hall sensors in the motor) are used to do the switching.


How does a mosfet work?...........(glad you asked!)

A mosfet is a very small component with three legs (metal pins). One of the legs goes to the negative battery terminal or earth, another one goes to the the positive battery terminal via the motor. A very large current can flow through these two legs in some cases 30 or 40amps. Because it is such a small component and can have such large currents flowing through them they can get quite hot so they are always joined to a heat sink to dissipate this heat (yes it does mean some loss of efficiency!). The other leg (called the gate) is joined to the pwm circuit chip (in brushed motors) and is joined to the pwm circuit and also the motor hall sensors in a brushless motor. When a very tiny current goes through this leg (only a few milliamps), or you can say when a very small voltage is applied to it (<10v usually) it allows the large current to flow through the other two legs. Hence its called the gate, it opens and closes the other two legs too allow high current to flow.

Mosfets are extremely sensitive devices, they will often be associated with controller failure in some way. Once they are put in place on a circuit and heatsinked they are very reliable ( assuming from a good quality supplier, there are many clones of good brand mosfets around), but there are some factors which can influence them into failing. They have maximum current and voltage limits. So if you try to run say a 24v controller on 48volts its likely you would damage the mosfets because they may not be rated to handle 48volts.
Another factor involved with their failure is the gate voltage. If they do not get enough voltage to be turned fully on (fully open) they can get very hot.
So a failure of some component on the circuit board which determines the voltage going to the gate of the mosfet could cause the mosfet to overheat.
One other thing that can be associated with mosfet failure is what is called voltage spikes. When a motor is turned off suddenly say a motor wire comes off accidentally, there can be a large voltage spike created (especially if the motor is under load at the time) which can be higher than what the mosfet is rated for and can cause its failure (so always make sure your thick wires to the motor are very secure).

One important part of a controller is the driver circuit, its the circuit that switches the mosfets on and off, below is an example of a driver circuit used on a newer style controller. This controller uses only one gate resistor for each mosfet pair, ideally each mosfet requires an individual resistor, a bit of a design flaw in the controller pic shown below.

 

Voltage Regulator:
A controller board has two main sections:
1. high voltage/high amp section which is directly connected to the mosfets, really the battery and motor are directly linked via the mosfets.
2. low voltage circuit board: most of the board is made up of low voltage circuitry, which requires usually 12volt or less to run, also it requires only a tiny
amount of current to run the circuit board ( about 60mA). The battery voltage has to be dropped down to a low voltage and this is done via a regulator.

The voltage regulator is a device about the same size and shape as a mosfet which converts the battery voltage to a lower voltage so the pwm chip and any other low voltage devices can be run from the battery power. They are sometimes also heatsinked (so may sit next to the mosfets) or may sit alone on the circuit board and not be heatsinked. They  also supply power for the hall sensors. Throttles use hall sensors also and derive their power ( 5 volts) from the controller via the regulator.
LM317T is a common regulator used in lower voltage controllers, higher voltage controllers require different voltage regulation methods.

Other things about Controllers:

Controllers always have some maximum current rating. It is usually written on the controller somewhere what the maximum current rating is. This means the controller has been designed to allow the motor to use a given amount of current and hence the motor will deliver a certain amount of torque depending on the current rating of the controller.

Its extremely easy to vary the maximum current of a controller, usually the controller will have a safety margin built in, so increasing the max amps is usually not a problem unless the controller does not have good wind flow for cooling or the outside temperature is very hot.

[postscript: max. current can be adjusted by adding taking away solder from buzz bar (or other suitable method) have done some experiments with this, current can be reduced to any value by increasing resistance across buzz bar conversely decreasing resistance of buzz bar the  max. amps can be increased........alot!  Increasing max. amps will mean mosfets will get hotter than normal and they may need additional heatsinking to absorb/dissipate the extra heat. Increasing amps will increase max. torque of motor but wont effect top speed]


Adjusting Maximum Amps of a controller

How To Adjust the Maximum Amps of a Controller

Hey! I'm not suggesting that everyone go out and ooooomph up their controllers!!!! there might actually be some people out there who want to limit
the power of the controller so that the ebike is street legal!...........

I was visiting a controller factory in China seeing about getting some controllers made. It was a small factory with few people working there.
At the end of discussing different aspects of controllers I asked how they adjusted the maximum amps of a controller. I was thinking it was internally controlled by the resistance of the mosfets. The owner of the factory pointed to the thick piece of wire on the circuit board.............

The torque of a hub motor is controlled by the maximum amps that can be supplied to the motor by the controller. (compare with the speed of a motor is controlled by the voltage its run at). The more amps you have the more torque you have, better for hill climbing and quick starts and for heavy loads. The down side is you will have less range from your batteries.

By adjusting the maximum amps of a controller its very likely the controllers mosfets will get hotter than normal, also the motor will get hotter than normal. So the temperature of the controller box and the motor should be checked when going up a long steep hill or any time when the motor is under load for a period of time. It may well be the controller you adjust to get more torque will be fine with higher amps going through it but the temperature should be noted just in case the controller is getting to hot. Also the motor will most likely get warmer and it should be checked that it doesn't get too hot also.

The mosfets in controllers can handle up to about 150degrees celcius, so the box can get quite warm, it wont get to 150degrees as the heat has to travel some distance to get to the outside but it can get quite warm without damaging the mosfets.. The aluminium box of a controller acts as a heatsink taking heat away from the mosfets to the outside air. Before doing this experiment make sure you have plenty of heat transfer compound at the rear of the mosfets where they are in contact with the aluminium case. Some controllers will have an aluminium block that the mosfets are in contact with. It also acts to absorb the heat the mosfets create. An adequate amount of heat transfer compound ( a white paste available from electronics suppliers in small tubes and quite cheap). If you are concerned the mosfets will be damaged by the extra heat of having extra amps you can always add an additional block of aluminium in thermal contact with the mosfets, the bigger the block of aluminium the better its protection to the mosfets. But not all aluminium has the same thermal properties so best to use some aluminium that you know is designed to be used as a heatsink.

If a mosfet was used without any heatsinking at all it would fail very quickly (as I found out some time ago!), heatsinking is 100% necessary when using mosfets.

How  to adjust max amps:

1. Identify the BUZZBAR ( correct name is a SHUNT) wire in the controller. ( will redo pics one day so that the wire is called shunt, but buzzbar will do for time being)
The buzzbar will be quite easy to recognise, if there are two buzzbars, one small and one large, then its the larger one you need to adjust, I have no idea what the small buzzbar is for (note in the diagram below there are two buzzbars next to each other, the larger one is the one which controls maximum amps). Its the resistance of this the buzzbar which controls the maximum amps the controller can deliver too the motor.



Below are a series of pictures just of one controller showing the buzzbar

   

2. Small Increase in Max Amps
I suggest that first you make just a small increase in the maximum amps of the controller. This can be done by adding solder to the two ends of the buzzbar where they join onto the circuit board. Adding a small amount of solder lowers the resistance of the buzzbar and increases the max amps of the controller. On the pictures below i've already added solder to the ends of the buzzbar. Usually there is only a relatively small amount of solder at each end of it.

 
 
Note: if your using lithium or nimh batteries and you want to decrease the maximum amps of your controller to suit the batteries maximum current rating you can remove solder from the buzzbar where it connects to the circuit board to increase the resistance and hence decrease max amps the controller can supply to the motor.

   3.  Larger increases in maximum amps

To get a larger increase in max amps I solder an extra piece of wire across the buzzbar. The type of wire is not critical but just something that can handle say 15 or 20amps.

  

Below shows where I've connected an extra piece of wire at one end of the buzzbar ( the extra piece of wire still has some insulation on one end which will be removed before I solder it to the other end of the buzzbar).
It also has to be connected to the other end of the buzzbar and then the whole wire should be covered in solder so that it makes good contact all along the buzzbar (probably not really necessary thats just the way I've been doing it).



The two pictures below show the buzzbar after the additional piece of wire has been added and soldered to the buzzbar.



So now instead of their being a thin piece of wire with high resistance there is a thick wire (really two wires) soldered all along it, and it has a lower resistance, so the amps go up.................alot!

Make sure your controller and motor are ok with regard to how hot they get, keep a close eye on them initially, you might have to reduce the amount of solder if they get too hot.




4. A Fancy Schmancy Set Up

I haven't tried this but just had an idea while talking to a customer about increasing amps. You could put a switch on the handlebars to a wire which is parallel to the buzz bar. Fairly high amp (low resistance) wire would be needed (probably around 20amp current rating). You could then convert the controller to high amp mode only when needed on steepest hills or other situations where needed. Otherwise you might find your using up alot of amps un-necessarily by accelerating too hard or not pedalling at all (come on you've got to pedal a bit!! thats what bikes are for!)



How to Test what is the maximum amps of your controller:
To measure the maximum amps your motor can use ( or looking at it another way: the maximum amps your controller can provide to the motor). Basically you need to measure the amps coming out of your batteries with an ammeter or multimeter and then you need to apply a load to the motor while its running at full power. You can either just go for a ride and see your max amps on the ammeter puting the motor under load will get you to max amps (a steep hill). Or you can simply run the wheel flat out off the ground and then apply some pressure to the tyre, simply letting it drop slowly onto the ground so that the pressure against the wheel increases (wheel slows down ) as its lowered further onto the ground.
Interestingly max. amps doesn't occur when the motor almost stalls, it occurs at a certain rpm at a certain load.
Also for some strange reason I dont understand I seem to get slightly different results from going for a ride and testing on the ground while bike is stationary, it could be the extra load of a person sitting on the bike causing it, not sure.

There are now also controllers which you can program the maximum amps via a computer connection.

 

Regenerative Braking Controllers:

I only have a basic knowledge of the regenerative braking systems used in newer style  controllers. They use a complex IC circuit which has a gate, a wire is used with a switch to vary the logic on the gate which then switches the mosfet configuration from 6 mosfets to 3 mosfets. The pwm cycle is then used to turn on/off  these 3 mosfets which induces a current which is then directed to flow back to the batteries (directing the flow back to the batteries is also achieved by switching the mosfets on/off in a particular sequence. I assume that variable regenerative controllers would vary the pwm cycle to achieve more control over the regenerative current.

In simpler terms: the controller induces a current which is generated by the motor which flows back to the batteries, in the process it slows the vehicle.
Ebike controllers tend to have quite powerful regen braking, its usually just on or off, and activated by the brake handle microswitch. The amount of regen given back to the batteries though is quite small, usually quite a bit less than 10%. It will hardly effect your range  but does make a good brake.

Another very recent development is 'off the shelf ' controllers with proportional regenerative braking via the throttle, in the past it has been all on or all off type.

Hall Sensors:

Throttles use linear hall sensor devices to vary the voltage (from 0-4volts approx.) which is then used to vary the pwm cycle to control motor speed.
(more in throttle section later). The output of the hall sensor depends on the proximity of the sensor to a magnetic field, the magnetic field is supplied by a small neodymium magnet, its proximity to the hall sensor is varied when the throttle is twisted.
Brushless motors use non-linear (switching) hall effect sensors to make the motor run (brushed motors dont use them they have a commutator).
They are glued into position inside the motor very close to the motor magnets, when a magnetic pole goes past a hall sensor it is switched on and off and this switching is used to make a very small current/voltage go to the mosfets which are in turn switched on and off in a given sequence so the  brushless motor can run correctly ( a brushed motor can be run without a controller as it has a commutator in it, a brushless motor you cannot run without a controller as it depends on the switching hall sensors to switch when current is on or off).

One thing to note is that brushless motor can be either 60 or 120 degree electrical spacing with regards to the hall sensors, some newer controllers will auto detect which way the motor hall sensors are installed. In the past its required to know which way the hall sensors are installed to match a controller to the motor.

Sensorless Controllers:

Another recent development has been the introduction of sensorless controllers which can run a brushless motor without using the hall sensors. There are a few different types of sensorless controller that I'm aware of. They use the backemf from the motor windings to perform switching of mosfets.
There seem to be two types:
1. ones that require the motor to be moved a small amount before the controller will begin to work ( quite annoying at times this type)
2. ones that will start the motor without the need for the motor to be rotated at all ( required for geared motors with freewheeling mechanisms in the motor),
generally I think its preferred to have 'instant start' type sensorless controller ( type 2) and this is the type I sell via this website.

Initially I think they were introduced as a simple way to match a controller to a motor, especially if the motor hall sensor spacing was not known, but auto detect type controllers have now become available, so sensorless type controllers seem to have limited use. Though some very small geared brushless motors are made with no hall sensors installed and will only work with a sensorless type controller.

 

 

 


back to home page
Copyright 1998-2006 by Brett White on all images/text/information and graphical materials on this website.