News    The Project    Technology    RoboSpatium    Contribute    Subject index    Download    Responses    Games    Gadgets    Contact   

<<< Power output         Atoms >>>

Construction details of the model motor

Video about the electric motor


With a simple hommede motor I would like to demonstrate some base principles of electric motors. The rotor is made of a disc with permanent magnets while the stator consists of electromagnets.
A fundamental feature is the arrangement of the permanent magnets on a disc, by what the electromagnets of the stator are formed straight (round bars), thus they are easy to build.

Key data

The model motor was built using a few tools as a saw, a drilling machine and some glue. The used materials are:

Material Dimensions Usage
Aluminum bar 20 x 3 x 1000mm Mounting brackets of rotor
Thread rod M10, 120mm long Rotor spindle
Nuts M10
+ 2 cap nuts M10
Attachments rotor spindle
Wooden plate 200 x 100 x 10mm Ground plate
Steel bar (or steel nail) Diameter 1mm Rotor bearing
Plastic tube 40mm diameter, 35mm long Attachment electromagnets of stator
Iron wire 2-3mm Diameter Stand support of stator
Screws + nuts + grommets M4, different length Attachments
Enameled copper wire 0.20mm2, 110m coil Coil winding stator
Round iron bar 8mm diameter, 1m long Core material of electromagnets
Aluminum plate 1 x 100 x 100mm Sensor disc
Magnets 20 x 5 x 2mm (16 pieces) N44H Rotor magnets
Acrylic glass plate 100 x 200 x 3mm Stator discs

Those materials were not combined to a motor with perfect concentricity, but with the help of this construction we are able to check and demonstrate some base principles of electric motors.
Each of the electromagnets consists of a round iron bar with a diameter of 8mm, a length of 37mm and approximately 300 windings of insulated copper wire (0.20mm2). When connecting one of the coils to a DC voltage of 5V, a current of approximately 800mA is running through the wire. 12 electromagnets form the stator of this stepper motor.

Drawing of model motor Even though the drawing implies the motor was incredibly accurate, it is in fact built using the "rule of thumb".
There is room for improvisation and your own ideas.
Components of model motor Components of model motor Components of model motor

Number of magnetic poles

As described above, the stator is made of 12 electromagnets. The simplest case would be to use a rotor disc with one magnet and to enable the electromagnets clockwise or counterclockwise. This control mode can be realized by using three or more electromagnets at the stator. Because of the fact that three electromagnets are sufficient to control the direction of the rotor, we can also use four magnets at the rotor disc and four groups per three inductors at the stator. By enabling one inductor per group, the torque of the motor will be quadrupled:

Single pole motor Quadrupple pole motor

Cogging torque

The core material of the electromagnets is iron. Ferro- or ferrimagnetic materials are used in electric motors to concentrate magnetic fields so that the resulting forces are boosted. Fores are acting between the core material and the permanent magnets of the rotor even if the electromagnets are disabled. The permanent magnets of the rotor and the round iron bars of the inductors are attracting each other resulting in a varrying torque depending on the angle of rotation. The model motor is composed of 12 electromagnets ( = 30° / inductor ) and four permanent magnets ( = 90° / magnet ) resulting in points of minimal respectively maximal attraction each 30°. When turning the rotor with the electromagnets disabled, you can feel the detent or "no-current" torque which is also called cogging torque.
By adding more magnets to the rotor disc, the cogging torque can be reduced drastically. In case of this model motor we need four additional magnets. While first magnets are congruent to the inductors, each of the additional magnets has to be positioned between two inductors. Consequently the angle between two magnets is 45°:
Cogging torque, 4 permanent magnets Cogging torque, 8 permanent magnets
The action of forces at the first animation is highly idealized using a sinusoidal shape, which won't match the practical experience, because the shapes of permanent and electro magnets affect the resulting curve. Consequently the torque is not canceled out at the second drawing.


Instead of different polarities between electromagnets and permanent magnets, the rotor can also be moved by using a uniform polarity:

Repulsive motor control Rotor movement with repellent forces.
The electromagnets of the stator are repelling the permanent magnets of the rotor disc if the north poles of the permanent magnets are facing the north pole of the electromagnets. At the drawing we are looking at the front of the electric motor. The south poles of the permanent magnets are pointing out of the screen, the north poles into the screen. The magnetic north poles of the electromagnets are pointing out of the screen, which is why they are repelling the magnets of the rotor disc (or the disc repells the stator). The repellent forces result is a torque. The electromagnets are enabled in such a way that they push the rotor.

Control electronics model motor

Control board, top Control board, bottom


12 transistors are used to switch the same number of electromagnets. Without using a H-bridge, the current through the inductors runs in one direction, thus the polarity of the electromagnets never changes. The control electronic is designed for a supply voltage of 5V DC. The power transistors can be connected to a voltage source up to 45V, but the copper wire of the electromagnets would melt in seconds if you would try to do so. For demonstration purposes, LEDs show the switching state of each transistor. If a LED is illuminated, the transistor below it is turned on and a current runs through the connected electromagnet. The LEDs can be disabled by a jumper.
Two potentiometers (throttle and brake), one push button (forward/reverse gear) and three infrared photo sensors (rotor angle) are used as input devices. The state of the photo sensors is displayed by three red LEDs; one red and one green LED indicate the selected direction of rotation. Those LEDs can be disabled by a jumper, too. Three more jumpers can be used to activate different software modes of the microcontroller.
The control and steering functionality is provided by an ATmega8A microcontroller.

Parts list of control electronics

I used only parts I had in stock. Old computer mainboards or power supplies are a good source for electrolytic capacitors and jumpers.

Device Quantity Usage
Board 1 Base
IC-socket 28pins 1 Socket microcontroller
Microcontroller ATmega8A 1 Main computer
Mosfet BD175 12 Power transistor
Potentiometer 1MΩ 2 Throttle and brake
Push button 1 Switch forward/reverse gear
Jumper 6 Disabling LEDs
select software mode
Green LEDs 13 Indicator power transistors state
Indicator forward/reverse gear
Red LEDs 4 Indicators photo sensor
Indicator forward/reverse gear
Mosfets MPF910 5 Amplifier LEDs
Diods N4004 12 Freewheeling diodes
Resistor 180Ω 16 Series resistor LEDs
Resistor 2.7kΩ 3 Amplifier photosensor LEDs
TCST2000 3 Photo sensors
Capacitor 0.1μF 1 ADC
Resistor 58Ω 1 ADC
Electrolytic capacitor 4700μF 3 Voltage supply
Ribbon cable 12-wires 2 x
approximately 20cm
Cabling stator inductors
Different colored wires ??? Cabling control electronic
Luster terminal 15 Connections stator and photo sensors
Copper wire ??? Conductive paths circuit board

Wiring scheme control electronics

Circuit layout motor control Mainboard control electronics:
Click at the preview to see the full view of the drawing.
Circuit layout light sensors Photo sensors:
The wiring of the photo sensors is done without a circuit board. The devices are soldered straightforward.
Click at the preview to see the full view of the drawing.

Revolution counter

Some experiments around this motor are done with a revolution counter, which is based on an ATmega8A, too. The number of revolutions is displayed either by a LED-bar or as a binary number and the counter is connected in parallel to one of the photo sensors. Revolution counter, top view Revolution counter, bottom view

Part list revolution counter

Device Quantity Usage
Board 1 Base
IC-socket 28pins 1 Socket microcontroller
Microcontroller ATmega8A 1 Calculator
Resistor 1kΩ 12 Series resistor LEDs
Green LEDs 8 Display number of revolutions
Yellow LEDs 2 Display number of revolutions
Red LEDs 2 Display number of revolutions
Jumper 1 Select display mode
Luster terminal 1 Connection photo sensor

Wiring scheme revolution counter

Circuit layout revolution counter Mainboard revolution counter:
Click at the preview to see the full view of the drawing.

Control software model motor


The brain of the control electronics is an ATmega8A microcontroller with 3 counters, one 6 channel analog digital converter (ADC) and 23 programmable input output lines. This device controls the 12 electromagnets of the stator, the photo sensors of the rotor, the switches and the potentiometers of throttle and brake.

System requirements of the software

If you are sitting in front of a 64bit computer, equipped with 4 gigabytes (4,000,000,000,000Bytes) of memory, 2.5GHz (2,500,000,000Hertz) double core processor and terabyte hard disc (1,000,000,000,000,000bytes) while reading these pages (because these are the minimal requirements for your operating system), you might be astonished about the resources of the microcontroller used here:
The ATmega8A provides 8kilobytes (8,000bytes) self-programmable memory in cooperation with one kilobyte of RAM and 32 working registers. The speed can be set up to 8MHz (8,000,000Hz) and the calculation is done in a 8bit System.

Sequence of enabling the electromagnets

To get the switching sequence of the electromagnets, the used rotor disc (number of permanent magnets), selected rotational direction and polarity of the inductors has to be considered. With 12 electromagnets at the stator and 8 magnets at the rotor disc, the resulting sequence is 1-3-2 at forward rotation and 1-2-3 at reverse rotation.
The current position of the rotor is detected by two photo sensors.

Ignition timing

Depending on the rotor speed and the direction of rotation it can be beneficial to shift the timing of enabling / disabling the electromagnets. Caused by the inductance of the electromagnets the current running through their windings is increasing slowly. The force acting between the electromagnets and the permanent magnets depends on the magnetic flux, thus on the current running through the windings. The higher the current, the higher the torque of the motor. At high rotational speeds, the turn on time of an inductor is short, by what the current running through the copper wire doesn't reach it's maximum. By altering the timing, the turn on time can be enlarged at higher rotational speed. If an inductor is enabled prior to it's normal timing, the time span is sufficient to reach the maximum current through the windings of the coil. Thereby a higher torque is generated at high rotational speeds. Compared to combustion engines, the "ignition timing" of the electric motor is adjusted. In doing so, the turn on time of electromagnets can overlap.

Current and voltage over timing Extension of the on-time:
At the top of this drawing, the current through the inductor is plotted against the on-time. Below the first plot, the attached voltage at the inductor is plotted as blue line and the red respectively green line give the voltages at the inductors to the left and right. By turning on the inductor ahead of time (right side), the maximum current through the inductor is increasing. The on-times of neighboring electromagnets overlap.
Besides extending the on-time, t1 and t2 can be shifted similarly, whereby the current through the inductor doesn'T varry, but the point in time, where the maximum magnetic flux is reached shifts.
Ignition timing of the software can be activated by two jumpers connected to pin 26 and pin 27 of the microcontroller.

Forward / reverse gear

The selection of the rotation direction of our experimental motor is done by a push switch. It has to be guaranteed that the rotation direction can't be altered while the motor is rotates.
Another safety function concerning the reverse switch is the fact that it has to be pushed for more than one second to change the rotational direction.

Throttle / Brake

What happens, if throttle and brake are actuated simultaneously? One of the pedals must have a higher priority than the other one.
The execution of the brake functionality is skipped, if the throttle pedal is actuated (throttle is prioritized).

Speed control

Driving with constant speed is very comfortable and first of all very energy-efficient. It is done by an automatic speed control, which must be disabled while throttle or brake are actuated!
The preselected speed is stored in the register value SetSpeed, the currently detected speed uses the register value ActualSpeed. If throttle or brake pedal are actuated, the value of ActualSpeed is copied into the value SetSpeed. By braking or accelerating, the preselected speed is readjusted. The speed control is enabled or not by the jumper connected to pin 26. If the jumper is set (=switch closed), the speed control is active. The state of the jumper is stored in the register value ControlBits (bit 3). The execution of the speed control is skipped while throttle or brake pedal are actuated.

Remarks on the sensor disc

The sensor disc is designed to use two photo sensors. Four different steps can be encoded at that way:

Sensor disc Microcontroller input Values in program
Inner radius Outer radius Voltage at pin 3 PortD Voltage at pin 4 PortD Bit 1 Bit 2
Massive Massive 0V (low) 0V (low) 0 0
Massive Gap 0V (low) 5V (high) 0 1
Gap Gap 5V (high) 5V (high) 1 1
Gap Massive 5V (high) 0V (low) 1 0

Ensure that between two steps of the sensor disc, just one of the photo sensors changes it's state! If a photo sensor is at an edge of the sensor disc, it will jump multiple times between ON and OFF. If just one of the photo sensors changes it's state, the position of the sensor disc can still be detected accurately (either at the left or the right of the edge). If both photo sensors would change their state simultaneously, the position of the disc could not be detected reliably:

Sensor disc At the upper drawing, the upper photo sensor jumpes between 0 and 1. For this reason the calculated position of the rotor jumps between the values 3 and 4, which matches the real position (it is between step 3 and 4). At the middle drawing both photo sensors oscillate between 0 and 1, whereby the calculated position can be 1, 2, 3 or 4. The position of the sensor disc can't be calculated reliably by the software. The disc should be designed as shown at the lower drawing.

real sensor disc Sensor disc attached to motor You can get the source code of at the column downloads.

Performance data of the experimental motor

Measurement setup

Two digital multimeter were used to record the input voltage and the current running through the stator. The resulting electric input power can be calculated using formula [3.8]. The revolution speed was detected by using the self-made revolution counter. The motor was slowed down with a cord being wrapped around the rotor axis. The force acting on the cord was measured indirectly by a kitchen scale. The displayed weight, multiplied by the gravitational acceleration (9.81m/s2) results in the force acting on the rotor axis. With the help of a sliding caliper, the diameter of the rotor axis was determined to be 25mm. To calculate the mechanical output power, revolution speed, force and diameter are needed. With the definitions of torque ([2.14]), mechanical work ([2.10]) and mechanical power ([2.13b]) we get:

POut = m * g * n * d * π

Where is:
POut - mechanical output power, m - mass in kilogram, g - gravitational acceleration,
n - revolutions per second, d - diameter of the rotor in meter, π - 3.14

When input and output power are known, the efficiency is given by formula [4.3]:

Motor test bench Used equipment:
Two digital multimeter, a kitchen scales, a sliding caliper (not at the picture) and the self-made revolution counter.

Measurement values

At the table below you can find the measurement values and the calculated efficiency.

Input power Output power Result
in Volts
in Ampere
in Watt
in Gram
in Newton
Revolution speed
per Minute
Revolution speed
per Second
in Meter
in Watt
in Percent
5.14 0.81 4.16 24 0.235 70 1.17 0.0784 0.0216 0.518
5.09 1.37 6,97 43 0.422 120 2.00 0.0784 0.0662 0.949
5.14 0.77 3.96 22 0.216 180 3.00 0.0784 0.051 1.283
5.08 2.08 10.57 63 0.618 190 3.17 0.0784 0.1536 1.453
5.08 1.94 9.86 48 0.471 406 6.77 0.0784 0.2500 2.535
5.10 1.20 6.12 24 0.235 441 7.35 0.0784 0.135 2.213
5.09 1.57 7.99 24 0.235 491 8.18 0.0784 0.151 1.886
Jumper 1 activated, turn on and turn off shifted
5.15 0.71 3.66 24 0.235 346 5.77 0.0784 0.106 2.905
5.09 1.34 6.82 37 0.363 893 14.88 0.0784 0.423 6.209
5.11 0.96 4.91 25 0.245 983 16.38 0.0784 0.315 6.408
5.09 1.47 7.48 37 0.363 1209 20.15 0.0784 0.573 7.666
Jumper 2 activated, overlapping switch times
5.11 0.98 5.01 28 0.275 220 3.67 0.0784 0.079 1.579
5.08 2.04 10.36 66 0.647 230 3.83 0.0784 0.194 1.875
5.08 2.30 11.68 70 0.687 376 6.27 0.0784 0.338 2.891
5.09 1.46 7.43 35 0.343 562 9.37 0.0784 0.252 3.391

That couldn't be worse! Where has all the input power gone?

Well, this experimental motor was built on the fly. The dimensions were given by the available materials and the sparse usage of tools lead to a very poor mechanical accuracy of the motor. If you have watched the video, you will have noticed that the motor is wavering considerably. Let's have a closer look at the weak points.

Core material

The core material of the electromagnets is made of a massive piece of ordinary iron. As mentioned in the chapter about core loss, the usage of a stack of soft iron would be much better to minimize the eddy currents. The used iron is not magnetically soft, which increases the core loss, too.

Coil winding

While connecting one of the electromagnets to a DC voltage of 5V, a current of approximately 0.9A is running through the copper wire. So the ohmic resistance is about 5.56Ω and a power of 4.5W is converted into heat while this current is running. When looking at the recorded values, you can see that the current running through the stator is very close to its maximum:

No. Stator current Number of enabled electromagnets Current per electromagnet
1.) 0.81 1 0.81
2.) 1.37 2 0.69
3.) 0.77 1 0.77
4.) 2.08 4 0.52
5.) 1.94 4 0.49
6.) 1.20 2 0.60
7.) 1.57 3 0.52
8.) 0.71 1 0.71
9.) 1.34 3 0.45
10.) 0.96 2 0.48
11.) 1.47 4 0.37

Air gap

Air gap between inductors and permanent magnets The poor manufacturing quality of the experimental motor leads to a huge air gap between stator and rotor discs, Thus a large portion of energy is lost because of the poor coupling between the magnetic fields of the electromagnets and the permanent magnets!

Sensor disc

The sampling rate of the sensor disc is very rough. The smaller the distance between two states of the photo sensors becomes, the more precise the timing of the electromagnets can be adjusted. As you can see at the results of the measurements, the timing is essential for a good efficiency.


While one of the transistors is turned on, a voltage of 0.25V can be detected and a current of 0.9A is running through the device. Hence the resistance of the enabled transistor is 0.28Ω and 0.2W of electrical power are roasted inside of it. Transistors with a lower ON-resistance are helpful to increase the efficiency.

<<< Power output         Atoms >>>

News    The Project    Technology    RoboSpatium    Contribute    Subject index    Archives    Download    Responses    Games    Links    Gadgets    Contact    Imprint   

Twitter YouTube Hackaday Patreon TPO