A SCARA robot configuration is a kinematic design featuring two parallel rotary joints for XY-plane movement and a rigid linear joint for Z-axis motion, optimized for high-speed planar assembly tasks. When you wire up a microcontroller to drive this topology, it fundamentally changes your control circuit: you can no longer send simple Cartesian XYZ coordinates directly to stepper drivers. Instead, your MCU must compute inverse kinematics in real-time, translating linear toolpaths into coordinated, non-linear angular velocities for the shoulder and elbow joints. Makers commonly confuse SCARA with 6-axis articulated robots; while an articulated arm is compliant (flexible) in all directions, a SCARA is highly rigid in the Z-axis but selectively compliant in the XY plane, making it vastly superior for pressing pins into PCB holes or placing SMD components without binding.
SCARA Joint Specifications and Motor Sizing Data
Before writing a single line of inverse kinematics code, you must map the physical joints to their electronic control requirements. The table below outlines the standard hardware topology for a desktop-scale DIY SCARA (typical 400mm reach) driven by an ESP32 or similar 32-bit microcontroller.
| Joint Axis | Motion Type | Typical Actuator | Microcontroller Control Method | Real-World Spec / Firmware Requirement |
|---|---|---|---|---|
| Joint 1 (Shoulder) | Rotary | NEMA 17 Stepper (0.45 Nm holding torque) | Step/Dir Pulse via Hardware Timer (MCPWM) | Requires 1/16 or 1/256 microstepping to prevent low-speed resonance and arm vibration. |
| Joint 2 (Elbow) | Rotary | NEMA 17 Stepper (0.45 Nm holding torque) | Step/Dir Pulse via Hardware Timer (MCPWM) | Firmware must apply counter-rotation compensation; moving Joint 1 inherently rotates Joint 2. |
| Joint 3 (Z-Axis) | Linear | NEMA 14 Stepper + T8 Leadscrew (2mm pitch) | Standard Cartesian Step/Dir mapping | High Z-rigidity; 0.01mm repeatable precision. No inverse kinematics applied to this axis. |
| Joint 4 (Wrist/Tool) | Rotary | 9g Micro Servo or NEMA 11 Stepper | PWM (50Hz) or Step/Dir | End-effector rotation. Servo limited to 180-degree sweep; stepper allows continuous rotation. |
Worked Numeric Example: Sizing the Shoulder Joint and ESP32 Pulse Rate
Let us calculate the step pulse frequency required on an ESP32-S3 for the elbow joint (Joint 2) during a rapid traverse, and verify if the motor has enough torque to handle the inertia.
The Setup:
- Link 1 (shoulder to elbow length) = 200 mm
- Link 2 (elbow to tool tip length) = 200 mm
- Target tool tip speed = 800 mm/s (typical for high-speed pick-and-place)
- Motor: 1.8° NEMA 17 stepper (200 full steps/rev) driven at 1/16 microstepping (3200 steps/rev)
- Driver: TI DRV8825 or Trinamic TMC2209
Step 1: Calculate Maximum Angular Velocity
The maximum angular velocity of Joint 2 occurs when Link 1 and Link 2 are perpendicular, and the tip is moving at 800 mm/s purely from Joint 2's rotation at a radius of 200mm. Using the formula V = ω × r:
ω = 800 mm/s / 200 mm = 4 rad/s
Convert radians per second to RPM:
4 rad/s × (60 / 2π) ≈ 38.2 RPM
Step 2: Calculate Required MCU Pulse Frequency
To achieve 38.2 RPM with a 3200 steps/rev microstepping configuration:
Pulse Frequency = (38.2 RPM × 3200 steps/rev) / 60 seconds ≈ 2037 Hz
Step 3: Evaluate MCU Capability
A 2.03 kHz pulse rate is trivial for the ESP32-S3's MCPWM (Motor Control Pulse Width Modulation) peripheral, which can push well over 100 kHz without CPU intervention. However, if you are porting this to an 8-bit ATmega2560 using a software-based motion planner, generating a coordinated 2 kHz pulse train on two axes simultaneously inside an Interrupt Service Routine (ISR) can cause stepper jitter if the kinematic math isn't pre-calculated. This is why 32-bit MCUs are mandatory for smooth SCARA motion.
Step 4: Torque Verification
Assuming Link 2 weighs 0.3 kg and the payload is 0.2 kg (total 0.5 kg at 200mm radius), the static torque required just to hold the arm horizontal against gravity is:
Torque = Force × Distance = (0.5 kg × 9.81 m/s²) × 0.2 m = 0.98 Nm
A standard 0.45 Nm NEMA 17 will fail here. You must either use a 3:1 planetary gearbox (yielding ~1.35 Nm at the joint) or upgrade to a NEMA 23 stepper. This physical reality dictates your driver selection; a NEMA 23 pulling 2.5A per phase requires a driver like the TB6600 or TMC5160, not a standard A4988.
Where You Meet SCARA in Practice (and How to Build One)
You will most frequently encounter the SCARA configuration in commercial PCB pick-and-place machines (like the Neoden or CHMT series), automated soldering stations, and high-speed 3D printers. In the DIY and embedded space, builders use SCARA arms for custom SMD assembly lines or lab automation.
When building an ESP32-driven SCARA, the industry-standard approach is to use Marlin firmware with the SCARA kinematics module enabled. Marlin handles the complex inverse kinematics, translating standard G-code (G1 X100 Y50) into the polar coordinates the steppers require.
For power delivery, a 400mm SCARA arm with two NEMA 17s and one NEMA 14 will draw roughly 6A to 8A peak during rapid accelerations. Do not use a standard 12V 3D printer PSU. Use a 24V 15A (360W) Mean Well LRS-350-24 switching power supply. Running steppers at 24V instead of 12V doubles the available torque at high speeds by forcing current through the motor coils faster, which is critical for maintaining the 800 mm/s tip speeds calculated in our numeric example.
FAQ: Debugging SCARA Kinematics on Microcontrollers
Q: Why does my SCARA arm jitter violently or lock up when it reaches full extension?
A: You have hit a kinematic singularity. When the arm is fully extended (both links form a straight line), the inverse kinematics math attempts to divide by a value approaching zero to calculate the joint angles. The MCU sends erratic pulse commands as a result. Fix this by setting a software limit in your firmware (e.g., SCARA_MAX_ANGLE) to prevent the arm from reaching exactly 180 degrees, keeping a slight bend (e.g., 175 degrees max) in the elbow.
Q: Can I use standard CoreXY firmware for a SCARA robot?
A: No. CoreXY is a Cartesian belt topology where motor movement maps linearly to XY Cartesian space. SCARA requires polar-to-Cartesian conversion. You must use firmware that explicitly supports SCARA kinematics, such as Marlin (Morgan SCARA or MP SCARA variants) or a custom ROS-based Python/C++ script running on a Raspberry Pi that sends step pulses to an ESP32 acting as a real-time pulse generator.
Q: My Z-axis drops slightly every time the XY arms make a fast directional change. How do I fix this?
A: This is caused by voltage sag on the stepper driver power rail. When the XY motors rapidly accelerate, they pull a massive current spike, dropping the 24V rail down to 21V or lower. The Z-axis driver detects this as an under-voltage condition and momentarily drops holding torque. Install a 4700µF 35V electrolytic capacitor directly across the VMOT and GND terminals of each stepper driver to buffer these transient current spikes.






