PCB Sources

Here are some companies who will fab boards from uploaded Gerber files which can be produced in Fritzing. I have no idea about the quality of these services but I’m collecting them for future reference.


Some ideas:

  • apt install easyspice executable is /usr/bin/easy_spice.

  • apt install ngspice ngspice-doc and then have a look at: file:///usr/share/doc/ngspice-doc/html/manual.html

  • apt install gspiceui

  • apt install simulide

  • apt install kicad

  • apt install fritzing - very cool. Many good commercial components in database. Breadboard, schematic, and PCB views. Couldn’t figure out a simulation mode.

  • qucs-s For some reason qucs-s isn’t in the normal repos but the devs are keeping Debian in mind.

  • Gnucap - used as an engine by others like gspiceui.

E Series Of Preferred Numbers

Why are electronic components mostly sized in strange ways? There is a sense to it which attempts to not cluster produced sizes in such a way that would provide big errors in some ranges. The increments are logarithmic in some clever way.

For example, the E24 scale divides an order of magnitude into 24 values like this.

1.0, 1.1, 1.2, 1.3, 1.5, 1.6, 1.8, 2.0, 2.2, 2.4, 2.7, 3.0, 3.3, 3.6, 3.9, 4.3, 4.7, 5.1, 5.6, 6.2, 6.8, 7.5, 8.2, 9.1

This keeps any value you could need withing 5% tolerance of what is commonly available in these increments. This is why you often see resistors for 470 Ohms and 510 Ohms but not 490 Ohms. Or a capacitor of 560uF instead of something easier for humans to remember.


Value Bands

When there are four marking bands, the first three bands specify the value. The first band’s color value is multiplied by 10. The second band’s value is added to that. The third band’s value is the exponent that 10 is raised to which should be multiplied by the previous total.

For five band resistors, the first three compose a three digit number, the fourth is the multiplier, and the fifth is the tolerance. Note that the tolerance is usually separated with more space than the other bands.



  • BRN BLK RED = (BRN*10 + BLK) * 10^ RED = 1000 Ohms

  • YEL VIO BRN = (YEL*10 + VIO) * 10^ BRN = 47 * 10 = 470 Ohms

Tolerance Bands

The 4th band of a 4 band resistor indicates its accuracy. Gold at 5% seems like the most common.

GRY .05% VIO .10% BLU .25% GRN .5% BRN 1% RED 2% GLD 5% SLV 10%

A unit without a tolerance band should still be implicitly within 20%. Gold and silver are by far the most commonly used tolerances, gold being almost ubiquitous in my experience. Much less commonly gold and silver can also be order of magnitude signifiers - .1 an .01 respectively.

Digikey has a nice chart and calculator.

What if you get a very weird resistor, bigger than usual, and it has a yellow band outside of the gold band? For example, I have one that is BRN GRN BLK GLD YEL. I don’t know for sure but that seems like it may be one of these wire wound non-inductive resistors.

Ohmmeter Testing

Sounds easy, right? But I’ve had moments of confusion so here’s a conclusive summary and some examples of how this works with my meter (and many others).

The values that the meter shows are in the units that match the dial’s setting. So if it’s set at the 2K setting, that will be in "K" or kilo Ohms. If you have it set on 20M that will read in mega Ohms. If you have it on the 200 setting, the one with the audible low resistance continuity signal, it will read directly in Ohms. The values on the settings represent the maximum value that range can accommodate; so the 2000K setting can handle a 2 mega Ohm value but will produce kilo Ohm readings.

Let’s say I have a resistor that has YEL VIO BLK BLK BRN or possibly (reversed) BRN BLK BLK VIO YEL. But we’re not sure if the violet is really gray or blue or who-knows-what. It’s helpful to start with a best guess, in this case 4-7-0-(10*0) +/-1% Ω.

How should that appear on a meter? It would be nice if it came up as 470 Ω. But it mostly will not. My typical meter has settings for "20M", "2000K" (i.e.2M), "200K", "20K", "2K", and "200". If I suspect my resistor is 470 Ω then I should go to the smallest setting that is larger than the value. 200 is less than 470 so that won’t work; "2K" is larger than 470 so that’s the one to try. If the color band guess was correct, the reading should be something like ".468".

How about another: BRN GRY BLK YEL BRN, or maybe BRN YEL BLK GRY BRN? Maybe the GRY or YEL is wrong — hard to tell being microscopic and badly printed. The first interpretation should be "180 * 10,000 +/-1%" or 1.8M Ω. The second way to read it is "140 * 100,000,000 +/-1%" which is 14G Ω, a bit high.

Let’s assume the 1,800,000 Ω or 1800 kOhms. This is just under the 2000K setting so use that. The reading comes in between 1350 and 1430. That’s not what was expected! The problem with this measurement is that I’m holding the leads of the meter in my hands and my body has a certain (pretty high) resistance that for values like this are non-negligible. After connecting the resistor to clips so that it can be measured without touching it, the reading bops around from 1783 to 1805 which is what is expected.

How about BRN ORG BLK BLK BRN, possibly BRN BLK BLK ORG BRN. This one seems most reasonable to assume 130 Ω. Setting it upon the meter, I get a "1 ." which means it’s not even close. Maybe the other way was right after all — 100 * 1e3 which is 100k Ω. This means that the dial must be set to "200K". Then the reading comes up "100.2" which seems to confirm it.

What about BRN RED BLK BLK BRN or BRN BLK BLK RED BRN. The first way is 120 Ω and the second way is 10K Ω. On the 20K setting I get 10.01 which confirms the second reading.

Note that HF chokes can look exactly like resistors. I had some with 4 bands BRN BLK BRN SLV that were definitely not 90-100 Ω. They measured more like 3 Ω. So if your resistance is absurdly low for the markings, consider that the component may not be a resistor.

Series And Parallel

In series, resistors just add up in a pretty intuitive way.

In parallel resistance takes this form.

1/Rtotal = 1/R1 + 1/R2 + 1/R3

In GeoGad this is easily computed. Here are two 8 Ω resistors plus a 4 Ω.

[8 8 4] inv sum inv

Answer is 2 Ω.

Here is how to compute the equivalent resistance of five 470 Ω resistors in parallel.

470 5 :* inv sum inv

Answer is 94 Ω.


Diodes restrict the flow of current to a particular direction - they are the electronic equivalent of check valves.


Since polarity is a diode’s one job, they are definitely polarized.

  • Anode + Positive side

    • Fat part of diagram triangle

  • Cathode - Negative side

    • Band painted/screened on body

    • Colored glass end

    • Pointy part of diagram triangle plus vertical line

Specific Diodes

  • 1N4001 - used to rectify wall current so designed to be plenty fast switching for 60Hz.

  • 1N4148 - switching time down to 4 nanoseconds, very fast.

Zener Diodes

These are also called breakdown diodes. They conduct in one direction unless the voltage is over a threshold when their blocking stops functioning. This allows them to protect sensitive low voltage components from surges of high voltage. The symbol for zener diodes is like a regular diode but there are little extensions off the cathode bar; ironically, these extensions are isomorphic to an S and not a Z.

Light Emitting Diodes (LEDs)


  • Anode + Positive side

    • Round lens case at base

    • Fat part of diagram triangle

    • Longer lead - not always reliable

    • Thin blade on leadframe inside plastic lens package (usually)

    • On LED light strips I’ve seen long gray dashes on white a wire jacket

    • Soldered to square shaped pad on PCB

  • Cathode - Negative side

    • Flat spot on lens case at base

    • Dot painted/screened on lens or lens holder

    • Pointy part of diagram triangle plus vertical line

    • Shorter lead - not always reliable

    • Thicker blade, called the post, on the leadframe inside plastic lens package (usually)

    • Contains the semiconductor die with any reflective cavity features

    • Soldered to round shaped pad on PCB, when other one is square shaped

Voltage Drop

Often shown on datasheets as Vf (forward voltage). This is the voltage lost from the power supply’s or battery’s nominal value. I’ve been told that these are reasonable values.

  • red = 1.7V, my red jumbos measured at 0.5V

  • yellow/green = 2.2V

  • white = 3.6V

That is a load of bollocks and you should either not care what it is, or measure it yourself.

Measuring Directly With A Power Source And Voltmeter

Normally the LEDs I acquire come from random cannibalized sources and I do not know the Vf drop. Amazingly, you can check it empirically by turning it into a de facto solar panel. Hook the LED up to a multimeter on DC low range (2V on mine - not 20V or 200mV, etc). Hold the LED very near a very bright light (normal 7 watt household LED light bulb works fine) and the multimeter should reflect the voltage drop useful for LED resistance calculations.

Put negative lead of LED on negative terminal of the battery. Measure the voltage from the positive lead of the LED to the positive lead of the battery. Subtract this value from the voltage between the two battery terminals. This will be the LED’s voltage drop.

Ideal Operating Current

It’s good to know this based on the rating as they were purchased. But if you don’t know it’s reasonable to assume that the reference current is usually 0.020A i.e. 20mA. 25-30mA is usually maximum continuous current.

Calculating LED Resistor Values

LEDs and diodes generally need a resistor (or some kind of resistance) to keep the circuit from essentially being a short.

Resistance = (Voltage_PS - Voltage_LED) / Desired_Current
Current = (Voltage_PS - Voltage_LED) / Resistance
Resistance = (12 - Voltage_LED) / .020A



The charge a capacitor can store is the capacitance times the voltage. Somehow Farads times Volts equals Coulombs. That means that Farads times Volts divided by seconds equals Amps.

The energy in a capacitor is the capacitance multiplied by voltage, squared, divided by two.

Capacitors in parallel are equivalent to the sum of the individual components. The total capacitance in series is the inverse of the sum of the inverse capacitances. So if you have a 240pF capacitor and a 560pF the total capacitance would be calculated from this equation.

1/Ct = 1/Ca + 1/Cb = Cb/Ca * Cb + Ca/Ca*Cb = (Ca + Cb) / Ca * Cb
Ct = Ca * Cb / (Ca + Cb)
C = 240 * 560 / (240 + 560) = 134400 / 800 = 168pF

In general it is a good practice to add decoupling (aka "bypass") capacitors in parallel (the bypass) with the power supply to every IC to protect it from fluctuations. For ICs, a sane value is usually 0.1 μF. Capacitors are also useful for smoothing out chops in DC current produced by a diode rectifier (where 2 diodes guide the current one polarity, and then 2 other ones take it for the reverse polarity).

Note that while it may seem sensible to think of a capacitor as something with capacitance, they may additionally have other properties. Equivalent series resistance or ESR is the resistance of the capacitor itself. This resistance can produce heat and shorten the life of the component. It would seem to be a property that should, in some critical situations, be carefully considered.


Capacitors sometimes have polarity, usually when their values get large. This is convenient because their packages are larger and thus there is usually more room to print the polarity in some obvious way. If the capacitor is not polarized, the diagram will just show two parallel lines making a gap in the path as the symbol.

  • Anode + Positive side

    • Straight part of circuit diagram, often with a helpful +.

    • Longer leg if they’re different lengths.

    • Crimp on one side of an in line can (maybe not true if "BIPOLAR" is printed on the can too).

    • Printed stripe on box shaped package, usually SMD tantalum; this is different from the normal convention that the markings mark the cathode.

    • Chamfer on one end of a SMD block.

    • Small funnel-shaped protrusion from body onto one of the leads.

    • One lead is offset from (not directly under) the body of a normal looking capacitor.

  • Cathode - Negative side

    • Shorter leg if they’re different.

    • Curved part of circuit diagram, curving away from the other plate.

    • Printed band off to one side as seen from top on can type.

    • Printed band on side of canister, often with minus signs and arrows directions as part of the graphic.

    • Printed cross hatching half of circle on PCB artwork.

Marking Values

A two digit label on a capacitor is in picoFarads.

A three digit label is not just that value in pF. The third number is the number of zeros you’d tack onto the first two numbers to produce the value in picoFarads. Some examples.

  • 22 is simply 22pF. Easy.

  • 3 is simply 3pF. Also easy.

  • 202 would be 2000pF or 2 nanoFarads or .002 μF or 2e-9 Farads.

  • 104 would be 100000pF or 0.1 μF.

  • 121 would be 120pF. This reminds me of decameters where it takes longer to say a distance the fancy way than the obvious way.

  • 330 seems like it could be written 331 as with 121, but 330 is simply 330pF.

A Letter after the value is the tolerance code.

  • B +/- 0.10pF

  • C +/- 0.25pF

  • D +/- 0.50pF

  • F +/- 1.00pF or 1%

  • G +/- 2.00pF or 2%

  • J +/- 5%

  • K +/- 10%

  • M +/- 20%

  • Z +80%/-20%

This excellent capacitor resource says an absurd amount about obscure capacitor polarity and value markings.

Multimeter Testing

Does your fancy multimeter have a capacitor measurement ability? Mine does. It does not appear to matter which sockets you put the leads in as long as one is on top and one is on the bottom. For testing a capacitor labeled 104, it is expected to be 0.1 μF. If I put the setting on the 2 μF setting it should read something like .096. Like with resistance, the units of the setting are what is shown and the number is the maximum value valid with that setting.

Note that you need to wait a few seconds for capacitance readings to settle down to the correct value.


Surface mount capacitors are put in packages that have designations like 0402 which is 0.4mm x 0.2mm. Or 0603 (0.6mm x 0.3mm).

Op Amp

It is called an operational amplifier because it first saw heavy use in the first computers — which were analog. The operational amplifier was a component that allowed many different configurations to perform many different (math) operations, hence the name. They can work on DC and AC signals.

Circuit gain is dependent on the passive feedback components rather than the active amplifier. This is called negative feedback and is a defining property of op amps.

The major use today AFAIK is as an analog transducer signal conditioning amplifier. They can be also used to create a line driver, one bit A/D comparator, level shifter, low Hz oscillator, sine wave generator, filter, signal conditioner, actuator driver, current source, voltage source, and maybe more. Since op amps are known for noise: shot noise, thermal (Johnson) noise, flicker noise, burst noise, and avalanche noise, it might be possible to use one to create a random number generator. Or cool guitar effects.

  • A huge book from MIT on nothing but op amps. Really a damn good source for design considerations.

  • LM358 - two independent, high gain operational amplifiers in one package using shared power supply.

  • LMx58 Series - Spec sheet


There are 5 leads to an opamp. * The non-inverting input is positive. Negligible current flow. * The inverting input is negative (since negative numbers invert). Negligible current flow. * An output. * A power supply positive pin. * A power supply negative pin.

If you have a 1.00V non inverting input, and a 1.01V inverting input, the output will want to be the difference amplified to some huge gain (1e6 times or so). So in that example, 10kV; which means that it will saturate at the power V+ level producing what is in effect a comparator. In other words, if the signals are different by a tiny amount, the circuit will be made. (Not that using opamps is an ideal comparator - there are special purpose such devices).

The normal way that opamps are used is with a feedback resistor between the output and the inverting input. With this the output will be modulated so that the inverting input voltage will match the non-inverting input. Another way to think of that is if the output is just shorted right to the inverting input, the output will be set to match the non-inverting input exactly — this is called a "buffer" and is not too exciting. But it establishes the operation for when you do start fiddling with resistances of the negative feedback. Also, since no current flows to the inputs, any current flow is coming from the V+ supply, not the inputs. This means you can use a voltage producing sensor like a strain gauge without pulling any current that could damage it. The current you might need to drive a dial to read the gauge’s value will come from the V+ supply. High impedance signal, low impedance output.


The "gate" is the terminal which controls the main current. VTH is the threshold voltage needed between the gate and the downstream terminal. Below VTH the current between the power terminals is negligible.


Insulated Gate Bipolar Transistors. Features a very fast switching speed. Current flows from a "collector" to a "emitter". VTH is usually between 3V and 8V. IGBTs can switch greater amounts of current than MOSFETs.


Metal Oxide Semiconductor Field-Effect Transistors. Current flows from a "drain" to a "source". VTH is usually between 0.5V and 1.0V. Generally switch quicker than IGBTs and are usually cheaper. Better for small to medium motor control.

DC Motors

This is the clear and obvious choice if your intended power supply is a battery, solar power, or any other source of DC power. Here are some things that are true about DC motors.

  • Torque is approximately proportional to current. (See Ampère’s force law). The proportionality constant is usually called KT, measured in Nm/A or lb-in/amp.

  • The intercept of the current vs. torque plot is usually called I0 and is the "no-load current". This is the minimum current needed to get the motor moving at all.

  • Speed is approximately proportional to voltage. The proportionality constant is usually called KV, measured in RPM/volt.

  • The intercept of the voltage vs rotational speed plot is usually called Va and is the voltage drop across the armature as a result of the intrinsic armature resistance Ra. To compute this, Va = (I-I0)*Ra .

  • Motor speed = KV * (V-Va)

  • (t * ω) = (V-Va)(I-I0)

  • Motors with high KT are good for higher torques while a high KV are better for higher speeds.

  • Normally a motor controller drawing very little current uses electrical switches to release a much greater amount of power to drive the motor.

  • A controller can use pulse width modulation (PWM) to control the motor. Choosing the right pulse frame frequency is important. If an optimal frame frequency is unspecified, 50Hz (i.e. 20ms) is a good guess. Frequencies between 30Hz and 20kHz are audible to humans, so to avoid that, you’ll need to think about going higher than 20kHz. In that case, it’s important that the switching components be responsive enough.

Brushed DC Motors

Brushes are also called commutators and the process where the current is reversed in the windings to keep the induction forces pointed in the right direction is called commutation. The fact that the brushes are a friction contact surface means they will eventually be consumed and need maintenance, a significant problem with this kind of motor for applications with long life cycles. Also the commuter has mass which robs from the potential payload that the energy could otherwise be applied to moving. And the commuter’s sparking is also a potential for EMF and electrical noise.

Permanent Magnet DC (PMDC) motors are the most popular brushed motors. These motors have relatively stable (permanently) magnetic fields making the ratio of speed to voltage KV pretty much constant.

PMDCs are simple and have many useful properties, but the magnetic field diminishes over time resulting in a loss of torque and speed. This problem is exacerbated when the motor is subjected to large startup currents.

Series-Wound DC (SWDC) motors have "field windings". Instead of the magnetic field being generated by a permanent magnet, it is generated by an electromagnet. As the name implies, these magnetic field windings are wired in series to the rotor windings that produce the torque. Because an increase in current increases the magnetic field in addition to increasing the torque, SWDC motors can be much stronger than similar form factors of PMDC motors. This sounds well and good, but the problem is speed control. Because the magnetic field is changing along with the current, it’s hard to keep the speed stable.

Shunt-Wound DC (SHWDC) motors put the field windings in parallel to the rotor windings. These don’t have the torque of series wound motors, but their superior speed control properties can be important.

Control of brushed DC motors that only need to turn in one direction can be achieved with a MOFSET that can just open and close as needed with signal pulses (PWM). One problem is that when the power supply is shut off, the motor, which acts like an inductor, can generate EMF that pulls hard on the open switch, possibly damaging the controlling transistor. This is where a flyback diode in parallel with the motor can help. With that, the current can just cycle back if the motor motor inductance keeps the voltage high (with reverse polarity).

Controlling a brushed DC motor in either direction arbitrarily is trickier. You basically need four switches, two that turn on a path (in and out of the motor) for one direction’s polarity and two that do the other direction. This arrangement is called an H-bridge. The L298 is an example of an H-bridge (two of them) in an IC package. The L9110 is similar but the IC also includes the flyback diodes which generally route around the 4 transistors in an H-bridge.

Brushless DC Motors

A BLDC motor is basically like a traditional brushed DC motor but the commutation is done electrically, not mechanically. Without mechanical contact between the rotor and stator, this kind of motor can be more durable and efficient. In the typical BLDC configuration, current passes through windings on the stator while the rotor is composed of magnets. There are usually many more windings than in brushed designs, and these stator windings comprise many iron core electromagnets arranged around the perimeter. These electro magnets are energized in sequence to continuously pull the rotor magnets.

Although different forms are possible, most BLDC motors are 3 phase. This means that the electromagnets are divided into 3 groups and each group has its own distinct energizing schedule. So if there are 6 winding "slots" and the BLDC motor is 3 phase, there are 2 linked A poles that fire together, 2 linked B poles, and 2 linked C poles. Note that most practical BLDC motors that normal people will run into have 3 wires, one for each phase.

The main difference between BLDC motors and AC motors is that BLDC current is constant when the winding set is energized, while AC motors have sinusoidal current.

At slow speeds, BLDC can become jumpy as the rotor hops from one winding set to another. There are more expensive "slotless" BLDC motors with more windings that try to ameliorate this problem.

The number of magnets in the rotor is fixed to the number of "poles" listed on the spec sheet (maybe poles= magnetsx2). The more poles, the greater the torque. An "integral slot" motor has the number of slots is a whole multiple of the poles. The motor is called "fractional slot" when this is not the case; this configuration can help reduce "cogging" or the jumpiness of BLDC motors. For example, a 6 slot stator with 3 phases, A, B, and C is a fractional slot BLDC motor if there are 4 magnetic rotor poles. It would be integral if there were 3 or 6 rotor poles.

There are two physical configurations of BLDC motors. The most ordinary looking one is the "inrunner" where the magnets are inside. The main difference between a normal inrunner BLDC motor and similar sized brushed motors is that the former will usually have 3 wires (3 phase) and the latter 2 (+ and -). The other configuration is the "outrunner" where the magnets are surrounding the windings and shaft. The magnets are always considered the "rotor" but this is strange when the shaft, considered a part of the stator on outrunners, will look like it’s turning. I believe the real motor shaft must be mounted fixed and the "shaft" that looks like it’s turning is really attached to the outer, spinning, motor case. Here is a good example.

BLDC Control

Controlling BLDC motors involves indexing through the phase configurations. A is high, high again, then off, then low, low; while B is low, off, high, high, off, low, low, off; while C is off, low, low, off, high, high, off; etc. For 3-phase there are 6 states before the configuration is repeated; this means that each phase state is 60 degrees of rotation. If the order of the states is played in reverse, the motor will move in reverse.

Instead of using H-bridges, BLDC motors usually use switching circuits called an inverter, commonly employing MOSFETs. As usual more current means that the motor will provide more torque.

A controller for such a motor must know pretty well where the rotor is in its cycle to provide the correct phase arrangement. Some types of BLDC motors use Hall effect sensors to detect the position of the rotor and feed that information to the motor controller. If the motor has a Hall effect sensor, it will generally have extra connections to provide the controller with the Hall voltage (VH) levels for each winding. Motors with such sensors are reliable and easy to control, but the extra hardware implies a bigger size and cost.

While Hall effect sensors are the precise simple way to monitor the rotor’s position, another option is to use the back EMF of each phase to infer where the rotor is. The trick here is that on a 3-phase system one of the phases is always "floating", i.e. not charged. By measuring the voltages here, a good idea of the position can be known. One technicality with this is that the EMF is only present when the motor is running. To get the motor started requires some tricky tricks from the controller. Some controllers use extended Kalman filters to get a better sense of where the motor is. Doing all that math can be the limit on the top speed of the controller.

Basically a controller is necessary for figuring out the rotor position and firing the correct windings. A normal type of controller for BLDC motors is the Electronic Speed Control (ESC). This can be thought of as a magic device that solves the problem of making the motor spin as desired. The connections are 3 wires for power to the motor phases, a supply voltage (red), a supply ground (black), and three signal wires. The signal wires often have a positive, a negative, and the SIG which receives PWM signals from a higher control level.

In hobby remote control a common configuration needs electricity for the drive unit and also for that radio and servos. It is possible to use two separate batteries but this means monitoring and worrying about more than is optimal. There is something called a Battery Eliminator Circuit (BEC) which can provide power to both the drive motors and the receiver and control electronics. One disadvantage of that setup is motor noise could find its way into more sensitive components. Some ESCs have the BEC integrated.

Stepper Motors

Stepper motors traverse precisely through a specified rotation without the need for position feedback. Common step angles for step motors are 30, 15, 7.5, 5, 2.5, and 1.8 degrees.

Permanent Magnet Steppers

A PM step motor is very similar to a BLDC motor. Like a brushless DC motor, step motors generally (ignoring very exotic exceptions) don’t have brushes. Step motors are like inrunners with the windings on the outside and the magnetic rotor on the inside. Like the BLDC the windings are charged with pulses of direct current.

Where a PM stepper differs is that it is designed for interrupted motion while BLDC are designed for continuous motion. A PM stepper usually has two (not three) phases. BLDC energize 2 of 3 phases while PM steppers energize either 1 or 2. And finally the stepper has many more windings and magnets to achieve the necessary precision.

Variable Reluctance Steppers

Reluctance is the flow of magnetic flux. VR step motors turn to minimize the reluctance between opposite windings. They trade high torque for good angular resolution. Instead of permanent magnets on the rotor (as with PM steppers), the rotors are iron with teeth cut in them — there are no magnets. Basically, the windings become electromagnets and pull on the iron teeth. Instead of simple 2 phases, the VR stepper must have a controlled power for each pair of windings.

For this kind of stepper, the step angle can be calculated with this.

step_angle= 360_deg * (Nwindings - Nteeth)/(Nwindings*Nteet)

Hybrid Steppers

Learning about VR steppers is all good for understanding this kind of system but because the torque is so low, these motors are almost never used in practice. In practice hybrid step motors (HY) try to get the advantages of both motor types. These hybrid motors have permanent magnets in the rotors to improve torque and they have machined teeth to improve resolution. The down side is that this complexity raises size, mass, and cost.

Hybrid steppers often have resolutions of 1.8 deg or .9 degrees.

Step Motor Control

(It is safe to ignore VR step motors which are rare in the real world.) The majority of PM and hybrid step motors have 2 phases. These can be unipolar or bipolar. A 2-phase bipolar motor has four wires. These might be be BLK (A), GRN (A'), RED (B), BLU(B') - I’m not sure if these are standard colors. If it’s not a standard, you can test for which wires go to which set since the resistance is very low between the A and A' which are opposite ends of the same winding.

The windings can be energized one direction and then the other with an H-bridge arrangement. Each phase (generally two) would need such an H-bridge setup.

A unipolar step motor generally will have six wires. For each of 2 phases, there will be 3 wires. One wire goes to the middle of the winding and the other two are at each end. If the motor has 5 wires the two middle supply wires are simply sharing the same input line. The middle wire is supplied with voltage and by selectively connecting the correct ends to ground, you can have the part of the winding energized that should be. Because only half the winding is energized, these unipolar motors can be much less efficient. Note that by ignoring the middle supply lines, you can drive the ends of the windings much like a bipolar motor. Although there are no universal color schemes, this is a good place to start: A=RED, A0=WHT, A'=GRN, B=YEL, B0=BLK, B'=BLU.

There are several energizing strategies that can be used. The simplest one is to turn on A, then B, then A', then B', and repeat. This is called "full-step one phase on" mode when only one winding is on at a time. A slight variation is "full step two phase on" which has a sequence something like: A+B', A+B, B+A', B'+A', A+B', … etc. The advantage here is that the torque is stronger because more power is making the winding forces stronger. The disadvantage is of course more power which is not always ideal on batteries.

The next mode is "half-step" and this is like a combination of the previous two. A,A+B,B,B+A',A',A'+B',B',B'+A,A,… etc. If the motor’s nominal step angle is 1.8, this strategy can get it down to 0.9deg. But on the steps where only one winding is energized there is 20% less torque unless clever compensation of the current is provided.

The final control scheme is called "microstep mode". This is like half step but instead of only one or two coils fully on, the cycle is transitioned between, say, A and A+B with a gradual change: 100%A, 90%A+10%B, 80%A+20%B, 70%A+30%B, etc. This allows for very precise positioning control (1.8deg nominal turns .007deg per control micro step). The torque is lower than the full stepping modes with two phases on, probably more like full stepping with one phase on. Another disadvantage is that if the micro step is too fine, the motor can just become confused.

Servo Motors

The main defining feature of a proper servo motor is not in the motor itself but in the system which includes a feedback mechanism. This feedback allows positional accuracy like step motors, but also adds the ability to control rotational velocity and acceleration.

Hobby Servos

The little box-shaped motors used to control RC vehicle features are probably the most accessible to normal people. These can be called "hobby servos" and are generally made by brands like Hitec, Fitec, Futaba, and Tower Pro. They usually have the following components. Here is Sparkfun’s hobby servo tutorial which is quite sensible.

  • motor unit - usually a simple brushed DC

  • gear train - to provide less speed and more usable torque

  • potentiometer - to provide positioning feedback

  • circuit board - with some kind of PID controller

Things to look for in servo shopping:

  • brushed DC core motor

  • metal or plastic output shaft, same for "servo horn"

  • metal (stronger) or plastic (quieter) gear train

  • aluminum body (heat dissipation)

  • waterproof is possible

  • range of motion (e.g. 270 degrees)

  • input voltage (4.8V-6V is typical)

  • stall torque (at both ends of the voltage range)

  • no-load speed (at both ends of the voltage range)

  • pulse width range (0.7ms-2.3ms is typical, so 1.5ms specifies middle of range)

  • deadband width (.005ms is typical) - what to ignore in input signal pulse width changes to exclude noise

These hobby servos also are sold as "digital" and, well, not. The digital ones have the following properties.

  • better resolution (2ms vs 20ms)

  • faster response time

  • more holding torque

  • deadband is smaller

  • consumes more power, especially holding a tight deadband that may be unhelpful

  • high frequency annoying noises are possible, high pitched whining when holding in place under load

  • potential ability to program/set angular velocity, "firmware" range limits, fail-safe modes

  • more expensive, typically 2x more than equivalent analog servos

AC Motors

Rather than controlling speed by increasing voltage, AC motors are generally controlled by increasing the frequency of supplied power. A brushless DC motor can look quite a bit like an AC motor in concept. The difference is that DC motors are always providing a constant voltage at any given point in time. That voltage may change in discrete steps, but during that step, the voltage is fixed. In an AC motor the voltage is purely sinusoidal and is always changing voltage in some way except at the infinitesimal tangent points at the extremes of the cycles.


LiPo batteries have an "S" number that represents the number of 3.7V cells. So a 3S LiPo battery will produce 11.1V. The S stands for "series" and it is also possible to find things like "2p" which are two cells in parallel.

Nickel-cadmium (NiCad)


Nickel-metal-hydride (NiMH)


Lithium-polymer (Li-Po)


Lithium-Iron-Phosphate (LiFePO4


NiCad uses toxic cadmium — banned in Europe — and are pretty much not used much in modern times.

NiMH are better and their major weakness seems to be spontaneous discharge of 4% per day.

Li-Po are very effective but care must be taken to avoid having them catch fire or explode. They can also be damaged if discharged too much so care must be taken to keep them charged at precisely the right level. These have the same chemistry as Li-ion batteries but are packaged differently.

LFP are comparable with Li-Po but are more stable and more robust to different discharging situations.