What it does:

Ethersweep offers easy interfacing from computers/machines/backends to motion control. Every UDP supporting language can communicate with it and can control as many motors (on your network) as you like.

It gets an IP address from a DHCP server and shows data like IP, operating voltage, button and operating states on the OLED display.

PCB design
Ethersweep is designed in KiCAD, Arduino and published as Open Source.

How to get started:

Build an (or multiple) Ethersweep controller. All manufacturing/assembly files work with JLCPCB and only some easy THT soldering + ICSP programming when the boards arrive. Arduino code is available in the repository.

Connect your Ethersweep controller to your network via ethernet and connect to a 5.5...30V power source. Stick an encoder magnet (magnetized) on a NEMA17 motor shaft and connect the controller to the four M3 screws of the motor. Once connected to power and Ethernet, it searches for an IP address using DHCP. When an IP is found, the controller shows it on the display, and it's ready to use. When no IP is found, it defaults to 192.168.1.111.

Now you can use the Python script to control the motor.

Code and Assembly files are on GitHub too. https://github.com/neumi/ethersweep

It is THIS simple to control a stepper motor from Python on a computer:

import socket
import json

IP_MOTOR = "192.168.1.185" #local motor controller IP
UDP_PORT = 1337


def drive_motor(steps, speed, direction, stepmode, motor_ip):    json_data = json.dumps({'steps': steps, 'speed': speed, 'direction': direction, 'stepmode': stepmode})    message = json_data.encode()    sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)    sock.sendto(message, (motor_ip, UDP_PORT))


drive_motor(100, 9500, 1, 32, IP_MOTOR) 

Or if you are more of a Terminal person:

nc -u 192.168.2.120 8888

 Then send this JSON:

{'drivemode': '0', 'speed': '1000', 'steps': '400', 'stepmode': '4', 'direction': '0', 'hold': '0'}

PCB top side
The PCB is a double-sided, single-side SMD layout.
PCB back side
All SMD parts can be assembled by JLCPCB and only THT and the encoder have to be soldered by hand.

Component overview
Component overview
Multicast
Multicast!






How to build:

You can directly order the PCB at JLCPCB with the attached production files. Costs are currently around 100€ for five boards with assembly plus shipping.

After the finished boards arrive, you can assemble all missing components according to the CAD files and KiCAD drawings. Then cut the two boards with a hacksaw and sand the edges smooth.

Then you can flash the Arduino Bootloader onto the atmega328 controller with an ISP programmer on the SPI pins on the top part of the mainboard. The selected controller has to be an Arduino ProMini 3.3V @ 8Mhz.

Then the two boards can be stacked on top of each other and programmed via the USB cable and the Arduino IDE. The Ethernet/Display board has to be installed while uploading code.

The hardware.ino file is the main program for the controller.

Test it from the command line, the python code, or the flask app.

Play with it and build awesome stuff!  Tell me what you built and ask me if you need help. 


Additional components you need:

  • 5x Stepper Motor Link
  • 5x 6mm x 2,5mm diametrically magnetized disk magnets Link
  • 5x HR911105A Ethernet Connector Link
  • 20x M3 Standoffs in 5mm and 16mm Link
  • 20x M3 Screws Link
  • 20x M3 Threaded Rod (depends on Stepper motor)
  • 5x AS5600 Magnetic Encoder Link
  • 10x JST Connector 2 Pin Link
  • 5x JST Connector 4 Pin Link
  • 5x 6-Pin Connector Link
  • Some Connectors and Headers 15mm Link
  • 5x XT30 Cable Female Link
  • 5x Oled Display Link
  • 5x Heatsinks for TMC2208 Link
  • 5x DD4012sa 3.3V Buck Converter Link
  • 5x Push Button 3x4x2 mm SMD Link
  • ISP Programmer for initial bootloader flashing Link
  • micro USB cable
  • super glue for the magnet



See more (recent) info, code and CAD files on GitHub:

https://github.com/neumi/ethersweep...

Read more »