Pre-launch preview — prices, stock and shipping rates shown here are provisional and online payment is not open yet. Questions: service@nenpower.com
简体中文

Programming

Programming Guide

Coordinate frame, supported GCode and M-codes, speed and acceleration settings, Python helper library and a complete pick-and-place example.

Programming Guide

Preliminary documentation. This product is in pre-launch preview; specifications and commands may change before shipping.

The SCARA controller runs the same GCode firmware family as our Delta robot. Inverse kinematics run on the ESP32, so you command positions in Cartesian space.

Coordinate frame

  • Origin: centre of the base at desk level.
  • X points forward (away from the cable exit), Y to the left, Z up.
  • R is the wrist angle in degrees, 0° aligned with the forearm.
  • Reachable area: an annulus from 60 mm to 280 mm radius; Z from 0 to 100 mm.

Moves outside the envelope are rejected with error: out of range — the arm does not move.

Motion commands

Command Meaning Example
G0 Rapid move G0 X200 Y50 Z30
G1 Linear move at feed rate F (mm/min) G1 X150 Y0 F3000
G4 Dwell, P in ms G4 P250
G28 Home all axes G28
G90 / G91 Absolute / relative coordinates G91

I/O and end effector

Command Meaning
M3 S<0–100> Close gripper to S % force
M5 Open gripper
M7 / M9 Vacuum on / off (Education Bundle)
M42 P<0–3> S<0/1> Set 24 V digital output
M119 Report endstops and E-stop state
M114 Report current position

Speed and acceleration

M203 J1:180 J2:180 Z:50 R:360   ; max joint speed (deg/s, mm/s)
M204 A800                         ; Cartesian acceleration, mm/s²

Lower acceleration for heavy or tall parts to avoid dropping them.

Python helper

The nenpower_scara helper module ships with the controller source package.

from nenpower_scara import Scara

arm = Scara("/dev/ttyUSB0")      # COM3 on Windows
arm.home()
arm.move(200, 0, 50)
arm.move(150, 120, 20, r=45, speed=3000)
arm.grip(80)

Example: move four blocks into a row

from nenpower_scara import Scara

arm = Scara("/dev/ttyUSB0")
arm.home()

pick = [(180, -80), (180, -40), (180, 0), (180, 40)]
place_y = 120

for i, (x, y) in enumerate(pick):
    arm.move(x, y, 40)
    arm.move(x, y, 5)
    arm.grip(80)
    arm.move(x, y, 40)
    arm.move(120 + i * 35, place_y, 40, r=90)
    arm.move(120 + i * 35, place_y, 6, r=90)
    arm.release()
    arm.move(120 + i * 35, place_y, 40, r=90)

arm.move(200, 0, 60)

Last updated 21 Sep 2026