NEMA 23 Stepper Motor Library for Proteus: the 57 mm stepper turning on a TB6600 driver with an Arduino UNO V4.0 and a pot

NEMA 23 Stepper Motor Library for Proteus V1.0 (TB6600, Arduino)

2.5K Views
40
700
60
25
60
PCBWay

Hello friends, I hope you all are doing great. Today, I am going to share the new NEMA 23 Stepper Motor Library for Proteus V1.0. The NEMA 23 is the big brother of the NEMA 17: a heavy 57 mm square stepper that drives the axes of CNC routers, laser cutters, large 3D printers and linear stages. It turns in exact 1.8 degree steps like its smaller cousin, but it takes 2.8 A per coil and holds more than three times the torque, so it is almost always paired with a big driver such as the TB6600.

Updates

NEMA 23 Stepper Motor Library for Proteus

Latest version: V1.0 (November 2026, this tutorial)

Helping Tools

This library gives the NEMA 23 a part of its own in Proteus. Its two coils sit in your circuit with their resistance, inductance and back-EMF, so any driver runs it: our TB6600, a DRV8825 or an A4988 at a lower current, an L298N or plain transistors. The motor reads its own coil currents and tells you what the driver does - full steps, half steps or microsteps - and, like the real one, it needs a ramp to reach speed and it loses steps when it is overloaded. A dial on the shaft turns on your schematic and a pop-up window draws the coil currents live. The demo runs on our Arduino UNO V4.0 with our TB6600 driver on 24 V.

NOTICE: a big stepper is only as good as the way it is driven, and the most common way to lose a CNC job is a stepper that silently slips. So we built a motor that works with any driver, solves its coils together with the driver in the circuit, needs a ramp and slips when it should. Our team put a lot of effort into it. Your feedback is the fuel that keeps us going, so please tell us what you think in the comments below or in the Motor Driver board of our forum. And if our free libraries help you, you can buy us a coffee. So, let's get started with the NEMA 23 Stepper Motor Library for Proteus V1.0:

NEMA 23 Stepper Motor Library for Proteus: the 57 mm stepper turning on a TB6600 driver with an Arduino UNO V4.0 and a pot
Figure: The NEMA 23 Stepper Motor Library for Proteus: the Arduino UNO V4.0 sends pulses to our TB6600, the NEMA 23 turns at 116 RPM and both coil LEDs are lit.

What is the NEMA 23 Stepper Motor?

NEMA 23 is a frame size, not one motor. NEMA, the US National Electrical Manufacturers Association, defines the mounting face, and size 23 means a 2.3 inch, 57 mm square flange with four mounting holes 47.1 mm apart and a 38.1 mm centring boss. Inside is a hybrid stepper: a toothed magnetic rotor and two coils, 200 full steps per turn, 1.8 degrees each. NEMA 23 motors come in many lengths; the one sold with most TB6600 kits is the 56 mm long 23HS22-2804S, and that is the one our model follows.

The NEMA 23 at a glance
NEMA 23 (23HS22-2804S class, the model)
Frame57 mm square flange, four mounting holes, 6.35 mm shaft
Typehybrid stepper, bipolar, two phases (coils A and B)
Step angle1.8 degrees - 200 full steps per turn (50 rotor teeth)
Rated current2.8 A per coil
Coil0.9 ohm, 2.5 mH
Holding torqueabout 1.26 N.m (126 N.cm) with both coils at 2.8 A
WiresA+ black, A- green, B+ red, B- blue (colours vary by maker)

NEMA 23 or NEMA 17?

Both are 1.8 degree bipolar steppers, and both are driven the same way. The NEMA 23 is simply bigger in every way: its coils take 2.8 A instead of 1.7 A, its torque is about 126 N.cm instead of 40, and its rotor is several times heavier. That weight matters. A heavy rotor cannot jump to speed, so every move must start slowly and ramp up, and the same weight carries it past the target if the pulses stop too suddenly. Our NEMA 17 Stepper Motor Library for Proteus is the smaller motor with the same pop-up; this library is the bigger one.

Why a TB6600?

An A4988 handles about 1 A per coil without a fan and a DRV8825 about 1.5 A - not enough to give a NEMA 23 its torque (both are in our A4988 / DRV8825 Stepper Motor Driver Library for Proteus, and both still turn this motor at that lower current). The TB6600 module is the usual partner: a black box with a heat sink, 9 - 42 V on its supply terminals, up to 3.5 A per coil, microsteps from full to 1/32 set on DIP switches, and optocoupled PUL, DIR and ENA inputs that take 5 V signals straight from an Arduino. It is a current chopper: it switches the 24 V supply on and off to hold each coil at the current you set, so the current rises fast even against the 2.5 mH of the coil. It has its own library: our TB6600 Stepper Motor Driver Library for Proteus.

Full Steps, Microsteps and the Ramp

In full steps both coils carry the same current, switched in turn: the currents are square waves and the rotor jumps 1.8 degrees at a time. In microsteps the driver sets the two coil currents to the cosine and sine of an angle, so the magnetic field turns smoothly and the rotor follows it in fractions of a step. At 1/8 a turn takes 1600 pulses. The faster the field turns, the more back-EMF the coils make and the harder the driver must push to keep the current up; and the heavier the rotor, the more torque it needs to speed up. Ask too much and the rotor falls behind the field by more than a tooth: it slips, and the steps are lost.

What's New in NEMA 23 Stepper Motor Library for Proteus V1.0

  • A part of its own: wire it to any driver - our TB6600, a DRV8825 or A4988, an L298N, transistors.
  • Coils in the circuit: resistance, inductance and back-EMF of both coils, solved with the driver at every analog step.
  • The physics of the rotor: 50 teeth, the torque of the two coils, the detent torque, the heavy rotor's inertia, friction and a load. It needs a ramp and loses steps when it is driven too fast or loaded too much.
  • It reads its driver: full step, half step, wave drive and 1/4 - 1/32 microsteps are recognised from the coil currents, with the step rate, the direction, the current against the 2.8 A rating and the lost steps.
  • A dial that turns on the schematic to the simulated shaft angle, and two coil LEDs that show the current's direction.
  • A pop-up window with four pages - Motor, Graphs, Event log and Check - and the coil currents drawn live.
  • An A3 demo on our Arduino UNO V4.0 with our TB6600 driver on 24 V and a potentiometer.

The NEMA 23 in Proteus

NEMA 23 stepper motor in Proteus: the black 57 mm flange, the dial on the shaft, four wires and the coil LEDs A and B lit
Figure: The part as the library draws it, running at 116 RPM clockwise: coil A green, coil B red, the dial at 70.5 degrees on its way round.

Search NEMA in Pick Devices; the device NEMA23STEPPERTEP is in TEPNEMA23.LIB (category Electromechanical, Stepper Motors) and its model is TEPNEMA23.DLL. It is drawn from the shaft end: the black 57 mm flange with its four mounting screws, the round boss, and a white dial on the shaft over a degree scale. The rating line under the flange reads 1.8 degrees, 2.8 A and 1.26 N.m. The four wires - B- blue, B+ red, A+ black and A- green - run to the pins on the left.

The red hand on the dial turns to the simulated shaft angle, and when the shaft spins fast it blurs into a faint ring. The coil LEDs A and B light green while the coil's current flows from + to - and red when it flows the other way. Under the plate the strip shows the speed with its direction, the angle and the steps, and the OPEN PANEL button. The plate, the LEDs and the strip are TEP additions; the real motor has none of them. The symbol is drawn a little smaller than the real motor, so it never grows bigger than the Arduino board beside it.

The Pins and the Properties

The four wires of the NEMA 23 (find the pairs of a real motor with a multimeter: about 0.9 ohm within a coil)
PinWireWhat the model does with it
A+ / A-black / greencoil A: 0.9 ohm, 2.5 mH and its back-EMF in the circuit
B+ / B-red / bluecoil B: the same
Double-click the motor to change them; every run starts again from the properties
PropertyDefaultWhat it does
LOAD0a constant load on the shaft in N.cm (it holds about 126 N.cm with both coils at 2.8 A)
START0the dial's angle at the start, in degrees

A Click on the Dial: the Brake

Click the dial while the simulation runs and you hold the shaft with a 150 N.cm brake - stronger than the motor. Every move you ask for now is lost, step by step. The pop-up's toolbar also puts a steady load of 20, 40, 80 or 120 N.cm on the shaft, which is the way to find out how fast your ramp can go with a real job on the motor.

Download NEMA 23 Stepper Motor Library for Proteus

Click the button below to download NEMA-23-Stepper-Motor-Library-for-Proteus-v1.0.zip (about 1.2 MB, without the source code of the models):

NEMA 23 Stepper Motor Library for Proteus V1.0
  • README.txt: installation, the demo, the wiring, the properties, real hardware, troubleshooting and the limits.
  • Proteus Library Files: TEPNEMA23.LIB and ArduinoV4TEP.LIB from our Arduino Library for Proteus V4.0.
  • Proteus Model Files: TEPNEMA23.DLL and TEPARDUINO.DLL.
  • Proteus Simulation: NEMA23-Stepper-Motor-TB6600-ArduinoUnoV4.pdsprj, NEMA23_TB6600_Demo.hex and copies of the two DLLs.
  • Arduino Code: NEMA23_TB6600_Demo.ino (no library needed).

Important: the TB6600 driver of the demo is not in this package. It is our separate TB6600 Stepper Motor Driver Library for Proteus: download it from its own article and install its TEPTB6600.LIB and TEPTB6600.DLL first, then this library.

No Proteus yet? Read How to Download and Install Proteus 7 and 8. New to libraries? Follow How to Install a New Library in Proteus.

How to Install NEMA 23 Stepper Motor Library for Proteus

  1. Close Proteus and extract the whole zip file, for example to your Desktop.
  2. Copy TEPNEMA23.LIB and ArduinoV4TEP.LIB from Proteus Library Files into the LIBRARY folder of Proteus (usually C:\Program Files (x86)\Labcenter Electronics\Proteus 8 Professional\LIBRARY).
  3. Copy TEPNEMA23.DLL and TEPARDUINO.DLL from Proteus Model Files into the MODELS folder. The two Arduino files are the ones of our Arduino Library V4.0; if you have it, they are the same.
  4. For the demo, install our TB6600 library the same way: TEPTB6600.LIB into LIBRARY and TEPTB6600.DLL into MODELS.
  5. Delete TEPNEMA23.IDX from the LIBRARY folder if it is there.
  6. Start Proteus, press P and search for NEMA.

Tip: keep the Proteus Simulation folder together, because the project needs its .hex file and the DLLs beside it. The library is tested in Proteus 8.5; Proteus 7 is not supported.

The Demo Circuit

NEMA 23 stepper motor Proteus simulation: an Arduino UNO V4.0, a TB6600 driver on +24V, the NEMA 23 and a pot on an A3 sheet
Figure: The demo project on its A3 sheet: ARD1, the TB6600 DRV1 on +24V, the motor M1 holding with both coil LEDs green and RV1 at 40 %.

Open NEMA23-Stepper-Motor-TB6600-ArduinoUnoV4.pdsprj. ARD1 is an Arduino UNO V4.0 from our Arduino UNO Library for Proteus V4.0, running NEMA23_TB6600_Demo.hex with its serial monitor built in. DRV1 is the TB6600 from our separate TB6600 library, in its pop-up version, on a +24V power terminal, its DIP switches at 1/8 microsteps and 2.8 A. M1 is the NEMA 23, its coils straight on the driver's outputs. RV1 is a 10k potentiometer on A0: the dial follows it from 0 to 360 degrees.

The wiring (the same in Proteus and on a real board)
TB6600Arduino UNO / motorNote
PUL+D3one pulse = one microstep
DIR+D4the direction
ENA+D8LOW = the driver on
PUL- DIR- ENA-GNDcommon cathode: the Arduino drives the + inputs
VCC, GND+24V, GNDthe motor supply, 9 - 42 V
A+ / A-black / greencoil A
B+ / B-red / bluecoil B

The TB6600's three inputs are optocouplers: each one is an LED between a + and a - terminal. Wired common cathode, all three - terminals go to GND and the Arduino drives the + terminals; a HIGH pin lights the LED and the input is ON. In Proteus every control wire reaches the UNO through a net label, and the motor's four wires run straight to the driver's outputs in neat rows.

The TB6600's DIP switches in the demo
SettingSwitchesValue
MicrostepsSW1 OFF, SW2 ON, SW3 OFF1/8 - 1600 pulses a turn
CurrentSW4 OFF, SW5 OFF, SW6 ON2.8 A (2.9 A peak)

The Arduino Code

The demo needs no library: it makes the PUL pulses itself, with an acceleration ramp. New to Arduino? Start with Arduino Tutorial for Beginners and Introduction to Arduino UNO; our older Stepper Motor Speed Control using Arduino tutorial explains stepper speed control too. The pins come first, and the microsteps must match the DIP switches:

const byte PUL = 3, DIR = 4, ENA = 8, POT = A0;
const int MICROSTEPS = 8;                     // as set on the TB6600's DIP switches (SW1 - SW3)
const int FULL_STEPS = 200;                   // per turn (1.8 deg)

The top speed and the acceleration are two numbers. Three turns per second squared is gentle enough for the heavy rotor:

float rpm = 120, accel = 3.0;                 // top speed, acceleration in turns/s^2

Four small helpers turn the microsteps into pulses per turn, a top speed, an acceleration and an angle:

long perTurn() { return (long)FULL_STEPS * MICROSTEPS; }
float maxSpeed() { return rpm * perTurn() / 60.0; }
float stepsPerS2() { return accel * perTurn(); }
float toDeg(long p) { return p * 360.0 / perTurn(); }

In setup() the three pins become outputs and ENA+ goes LOW. A LOW ENA+ leaves its optocoupler dark, and a TB6600 with a dark ENA input is enabled:

void setup() {
  pinMode(PUL, OUTPUT); pinMode(DIR, OUTPUT); pinMode(ENA, OUTPUT);
  digitalWrite(ENA, LOW);                     // ENA+ LOW: the optocoupler off, the TB6600 enabled

While the sketch follows the knob, it reads A0 every 50 ms and maps it to a target between 0 and one turn less a microstep:

    int raw = analogRead(POT);
    if (abs(raw - lastPot) > 4) {
      lastPot = raw;
      target = map(raw, 0, 1023, 0, perTurn() - 1);

The heart of the sketch is the ramp. The speed grows step by step, and near the target it shrinks again just in time to stop on it:

  // the ramp: speed up by accel, slow down in time to stop on the target
  float a = stepsPerS2();
  if (!moving) { moving = true; speed = 0; nextStep = now; }
  float stopDist = speed * speed / (2 * a);
  if (abs(togo) <= stopDist + 1) speed = max(sqrt(max(speed * speed - 2 * a, 0.0f)), sqrt(2 * a) * 0.5f);
  else speed = min(sqrt(speed * speed + 2 * a), maxSpeed());

Then one microstep is one pulse on PUL. The TB6600 wants DIR settled at least 5 us before a pulse and each pulse at least 2.5 us long, so the sketch waits 10 us after a change of direction and makes 5 us pulses. The time to the next pulse is one over the speed:

  int d = togo > 0 ? LOW : HIGH;              // DIR optocoupler off = forward (the dial clockwise)
  if (d != dirNow) { digitalWrite(DIR, d); dirNow = d; delayMicroseconds(10); }   // the TB6600 wants DIR 5 us before PUL
  digitalWrite(PUL, HIGH); delayMicroseconds(5); digitalWrite(PUL, LOW);          // at least 2.5 us
  position += togo > 0 ? 1 : -1;
  nextStep += (unsigned long)(1e6 / speed);

release and hold switch the TB6600 off and on with ENA+. Off, its outputs are open, no current flows and nothing holds the shaft:

  if (!strcmp(s, "release")) { mode = FIXED; target = position; digitalWrite(ENA, HIGH); enabled = false; Serial.println(F("Released: the TB6600 is off (ENA+ HIGH)")); return; }
  if (!strcmp(s, "hold")) { digitalWrite(ENA, LOW); enabled = true; Serial.println(F("Holding: the TB6600 is on (ENA+ LOW)")); return; }

The HEX file is in the package. To change the sketch, open it in the Arduino IDE and export the compiled binary, as in How to get the HEX file from Arduino. It needs 9,012 bytes of flash (28 % of the UNO) and 303 bytes of RAM. For bigger projects the AccelStepper library makes the same ramp for you.

Running the Demo

Press Run. The UNO's serial monitor and the two pop-ups - the motor's and the TB6600's - open over the schematic; move them aside. RV1 starts at 40 %:

NEMA 23 + TB6600 demo - The Engineering Projects
TB6600: PUL+ D3, DIR+ D4, ENA+ D8 (PUL- DIR- ENA- on GND); 1/8 step: 1600 pulses a turn. The dial follows the pot on A0.
Commands: a 90 | s 200 | rpm 120 | release | hold | knob | help
Pot 410 -> target 640 steps (1/8) = 144.0 deg
At 144.0 deg - holding
NEMA 23 demo in the built-in serial monitor of the Arduino UNO V4.0: release, hold, rpm 120, s 200 and knob
Figure: ARD1's monitor near the end of the run: release, hold, two moves of 200 full steps and knob.

The dial ramps up, glides to 144.0 degrees and holds there. The motor reads its driver from the coil currents: 1/8 MICROSTEP, and 2.05 A in each coil. Type a few moves into the monitor and press Send after each:

a 90
angle -> target 400 steps (1/8) = 90.0 deg
At 90.0 deg - holding
rpm 120
Top speed 120 RPM
s 400
steps -> target 3600 steps (1/8) = 810.0 deg
At 810.0 deg - holding
rpm 300
Top speed 300 RPM
s -400
steps -> target 400 steps (1/8) = 90.0 deg
At 90.0 deg - holding
The commands of the demo sketch
TypeWhat it doesWhat the run showed
a 90go to that angle and stayexactly 90.0 degrees
s 200200 FULL steps from here (minus goes back); 200 = one turns 400: two turns to 810.0 degrees
rpm 120the top speed, 1 - 600 RPM120 RPM on the long move; 148 RPM at most on a short one with rpm 300
release / holdthe TB6600 off (ENA+ HIGH) / on again (ENA+ LOW)RELEASED, 0 A / the coils on again
knobfollow the pot on A0 againthe dial follows - but see the lost steps below
helpthe list of commands

Note the last move. With rpm 300 and two turns to go, the ramp of three turns per second squared spends one turn speeding up and one slowing down, so the shaft peaks at 492 steps a second - 148 RPM - and never reaches 300. The motor came back to 90.0 degrees exactly: nothing lost.

The Pop-Up Window

At Run the motor opens TEP NEMA 23 Stepper Motor, a window in the look of our TEP Serial Monitor Advance for Proteus. It has four tabs - Motor, Graphs, Event log and Check - plus Settings and Help behind the gear and question mark icons. If you close it, the OPEN PANEL button on the strip brings it back.

Motor

NEMA 23 pop-up Motor page in Proteus: HOLDING 144.0 DEG with 2.90 A in the coils, 1/8 microstep, coil currents of 2.05 A
Figure: The Motor page while the motor holds 144.0 degrees: 1/8 MICROSTEP, both coils at 2.05 A.

The banner gives the state: RUNNING with the direction, the speed, the step rate and the drive; HOLDING; RELEASED; or LOSING STEPS. The dial shows the shaft in red and where the coils ask it to be in orange. The live values are the angle, the position in full steps, the speed, the step rate, the drive, the direction, the lost steps and the two coil currents.

Look at the currents while it holds: each coil carries 2.05 A, yet the banner says 2.90 A. The TB6600 set to 2.8 A drives a peak of 2.9 A and splits it between the coils as the cosine and sine of the microstep angle. At 45 degrees both are 0.707 times 2.9 A, which is 2.05 A, and the square root of the sum of their squares is 2.9 A again. That is microstepping in one picture.

NEMA 23 pop-up in Proteus at 1/8 microsteps: RUNNING CW 121 RPM, the coil currents A and B drawn as sine and cosine
Figure: Running at 1/8 microsteps and about 120 RPM: the two coil currents over the last 40 ms are a clean sine and cosine.

Type rpm 120 and s 400 and the page shows the motor at work: RUNNING CW at about 120 RPM, 403 full steps a second, 1/8 MICROSTEP. At the bottom the two coil currents of the last 40 ms are a smooth sine and cosine, a quarter of a cycle apart - the turning field that pulls the rotor round. At 120 RPM the 24 V supply still pushes the full current against the back-EMF, so the waves keep their height.

The TB6600 Pop-Up

TB6600 pop-up in Proteus during the NEMA 23 demo: RUNNING 3203 STEPS/S, 120 RPM at 1/8 step, the coil current vector
Figure: The pop-up of our TB6600 in the same moment: 3203 pulses a second, 120 RPM at 1/8 step, 2.9 A peak, 0.67 A from the 24 V supply.

The TB6600's own window shows the other side of the same moment: 3203 pulses a second, which is 120 RPM at 1/8 step, the coil current vector turning in its circle, the DIP switch settings and the supply current. Note that the supply gives only 0.67 A while each coil carries up to 2.9 A: a chopper turns 24 V and a little current into a lower voltage and a big current, like a switching regulator. For the TB6600 the motor is just a load on its outputs, as a real motor is for a real driver.

Release

Type release and the sketch takes ENA+ HIGH:

release
Released: the TB6600 is off (ENA+ HIGH)
hold
Holding: the TB6600 is on (ENA+ LOW)
NEMA 23 and TB6600 in Proteus after release: the coil LEDs off, the TB6600 OFF LED lit, the dial at rest
Figure: release: the TB6600's OFF LED is lit, no current flows, the motor's coil LEDs are dark and the shaft is free.

The driver's outputs open, the coil current falls to 0 A, the motor's pop-up says RELEASED and the coil LEDs go dark. The supply current drops to 0.03 A. A real NEMA 23 held at 2.8 A gets warm, so a machine that waits often releases its motors - but then nothing holds the axis. hold brings the coils back.

Microsteps on the DIP Switches

The sketch counts pulses; the TB6600 decides how far each pulse turns the shaft. They must agree. To see what happens when they do not, click 16 on the Microstep row of the TB6600's pop-up - the same as setting its DIP switches to 1/16 - and send one more turn:

rpm 120
Top speed 120 RPM
s 200
steps -> target 2000 steps (1/8) = 450.0 deg
At 450.0 deg - holding
TB6600 pop-up in Proteus set to 1/16 microsteps: HOLDING, 2000 steps counted, the DIP switch table at 1/16
Figure: The TB6600 set to 1/16 from its pop-up: the same 1600 pulses now make half a turn.

The sketch sends 1600 pulses and believes the shaft is at 450 degrees. The TB6600 now needs 3200 pulses a turn, so the shaft turns only half a turn, from 90 to 270 degrees. The motor's pop-up reads the new drive from the coil currents: 1/16 MICROSTEP. On a real machine this is the classic mistake of an axis that moves half or twice the distance: the DIP switches and the sketch's MICROSTEPS differ.

An Open-Loop Stepper Never Knows

A stepper motor has no sensor. The sketch counts the pulses it sends and assumes the shaft followed. Set the TB6600 back to 1/8, click the dial for the brake (or the Brake chip on the pop-up) and send another turn, then release the brake and type knob:

s 200
steps -> target 3600 steps (1/8) = 810.0 deg
At 810.0 deg - holding
knob
Following the pot on A0
Pot 410 -> target 640 steps (1/8) = 144.0 deg
At 144.0 deg - holding
NEMA 23 pop-up in Proteus with the 150 N.cm brake on: LOST STEPS 200 full steps, the shaft held still
Figure: The Motor page after s 200 with the brake on: the shaft did not move and 200 full steps are lost.

The sketch reports "At 810.0 deg - holding". The shaft never moved: with the brake on it stayed at 270 degrees. The field turned a full turn and the rotor slipped tooth after tooth; the model counts the slip in whole rotor teeth, 4 full steps at a time, and the log adds it up as 4, then 100, then 96 - 200 full steps lost, each line saying "the load is above the motor's torque".

NEMA 23 pop-up Check page in Proteus: the coils, the current, the drive, the rate, 200 full steps lost in red and the load
Figure: The Check page: the coils, 2.90 A against the 2.8 A rating, the drive, the rate, the lost steps in red and the load.

The Check page puts it in red next to the coils, the current, the drive, the rate and the load, with the cure: a ramp, less speed, more current or less load. Its load row also explains the numbers: with 2.90 A in the coils the motor holds about 92 N.cm, and the brake is 150 N.cm.

Then comes knob. The sketch steps from its count of 810 degrees to the pot's 144.0 degrees and reports "At 144.0 deg - holding". The shaft makes the same move from where it really was and stops at 324.0 degrees, half a turn away from the pot. The 200 lost full steps are exactly one turn, so the dial hides them; the half turn is the price of the 1/16 episode. Nothing will fix that until the machine finds its zero again, which is why CNC machines and 3D printers drive every axis to a limit switch when they start: the homing run.

Event Log

NEMA 23 pop-up Event log in Proteus: coils on, the drives, every move with its peak speed, the brake and the lost steps
Figure: The Event log, newest first: coils on, every drive, every move with its peak speed, the release, the brake and the lost steps.

The Event log keeps the whole run: the coils on, the drive ("DRIVE 1/8 MICROSTEP (1600 steps per turn)"), every move and stop ("HOLDING at 50.0 full steps - the move peaked at 492 steps/s (148 RPM)"), the release, the brake, the lost steps and the warnings - even a note that a motor held for a while gets warm and that disabling the driver lets it rest. Filter it by motion or warnings, pause it or clear it. The Graphs page draws the shaft angle against the position the coils ask for, the speed and the coil current over the last 2, 6 or 15 seconds; a lost step shows there as the two angle lines drifting apart.

How the Model Works

Each coil is in the circuit as its backward-Euler companion over the analog step - a conductance and a source - so the driver and the coil are solved together: the TB6600 chopping 24 V sees the current rise at about 24 V over 2.5 mH, an L298N at 5 V sees the slow rise of a low voltage. While the motor moves, the analog step is held to 100 us. The rotor follows the solved currents in 10 us slices: the torque of the two coils on 50 teeth, the detent torque, the inertia of the heavy rotor with its dial, the friction and the load. When the rotor falls behind the field by more than a tooth it slips, and the step is lost.

We checked the model on a PC with 31 automatic tests: 1600 microsteps at 1/8 turn it exactly 360 degrees at 60 RPM with a 2.91 A peak, 200 full steps and 400 half steps do the same, the drive is read correctly, 70 N.cm holds, a 150 N.cm brake on a move loses 100 full steps, ramped moves at 60, 120, 200 and 300 RPM lose nothing, 600 RPM with no ramp cannot start, an L298N-style drive turns it and warns above 3.1 A, and a coil that gets no current is reported. The demo project is read back from disk with 90 checks of its parts, pins and wires.

Troubleshooting

  • The dial never moves and the pop-up says RELEASED: no coil current - the TB6600 is off (ENA+ HIGH), its VCC is missing or its wiring is wrong. The TB6600's Check page tells which.
  • It only vibrates: the coils are mixed up - one coil's two wires belong on A+ / A- and the other's on B+ / B-. The Check page warns when one coil gets no current.
  • It turns the wrong way: swap the two wires of ONE coil, or invert DIR in the sketch.
  • It ends short of the target (LOSING STEPS): too fast, no ramp, too little current or too much load.
  • It turns half or twice the angle: the sketch's MICROSTEPS and the TB6600's DIP switches differ.
  • No driver in Pick Devices: install our TB6600 library (TEPTB6600.LIB / TEPTB6600.DLL).
  • No dial, no UNO or no monitor: TEPNEMA23.DLL or TEPARDUINO.DLL is missing from MODELS and the project folder; a closed monitor opens again with a click on the UNO's USB port.

Things to Know Before Using a Real NEMA 23

  • Set the current first: put the TB6600's SW4 - SW6 at the motor's rating (2.8 A for this class: OFF, OFF, ON) before you power it.
  • A real supply: 24 V is a good choice (9 - 42 V); a 2.8 A motor at speed wants a supply of a few amps. The Arduino's 5V never powers the motor.
  • Never connect or disconnect the motor while VCC is on: the voltage spike destroys the driver.
  • Always ramp: the heavy rotor cannot jump to speed; start slowly and accelerate.
  • Heat: a held motor draws its current all the time and gets warm; ENA+ HIGH lets it rest, but then nothing holds the shaft.
  • Wire colours vary: find the two coils with a multimeter - about 0.9 ohm within a coil, open between them.

Limitations of the Simulation

  • Not modelled: magnetic saturation, iron losses beyond a damping term, heating, the resonances of a real machine and the differences between real motors.
  • The plate, the coil LEDs, the strip and the brake are TEP additions; the symbol is drawn at 0.85 of the real size.
  • The model is our own, written from the typical data of the 23HS22-2804S-class NEMA 23; this library is not made or endorsed by any motor maker, Arduino or Labcenter.
  • Licences: the demo HEX contains the Arduino AVR core 1.8.6 (LGPL); the sketch is included and the README gives the source link. The potentiometer is Proteus's own; the TB6600 driver is our separate library.
  • Tested in Proteus 8.5 in October 2026 with the demo as shipped: the knob, a 90, two turns at 120 RPM and back at rpm 300, release and hold, 1/16 on the TB6600, the brake, knob, all four pages of the pop-up and the TB6600's pop-up. Proteus 7 is not supported.

So, that was all about the NEMA 23 Stepper Motor Library for Proteus V1.0. I hope it helps you see what a big stepper and its driver really do together - the microsteps, the ramp, the current and the steps that slip away - before you build your CNC router, laser or linear stage. If you have any questions, ask in the comments and I will help you out. Till the next tutorial, take care and have fun!


Comments

0

Join the conversation