Home > Projects > Control the Position of a Continuous Rotation Servo via WiFi

Control the Position of a Continuous Rotation Servo via WiFi

Summary of Control the Position of a Continuous Rotation Servo via WiFi


This project enables wireless position control of a continuous rotation servo using an Arduino MKR1000. By integrating a magnetic encoder, the system achieves precise 360-degree positioning with 4096 discrete steps per revolution. Control is facilitated via WiFi using the UDP protocol, allowing users to send commands from a smartphone or computer. The setup supports PID tuning for closed-loop stability and can be adapted for other DC motors with additional H-bridge electronics.

Parts used in the Position Control using WiFi from a Smartphone:

  • Arduino MKR1000
  • Continuous rotation servo
  • Magnetic encoder chip
  • SOIC-8 adapter board
  • 3D Printer (generic)
  • PC with Arduino IDE
  • Smartphone or device with netcat/telnet capability

Position control using wifi from a smartphone sounds too good to be true? Do it with MKR1000.

Control the Position of a Continuous Rotation Servo via WiFi

Things used in this project

Hardware components

Arduino MKR1000
Arduino MKR1000
× 1

Hand tools and fabrication machines

3D Printer (generic)
3D Printer (generic)

Story

Quick Solutions to Questions related to Position Control using WiFi from a Smartphone:

  • How do I connect to the controller wirelessly?
    You must first find the IP address printed in the serial monitor, then use the netcat command to connect to port 23 via UDP.
  • What protocol is used for wireless communication?
    The project uses the UDP protocol on port 23 instead of TCP or telnet for better performance and stability.
  • Can I change the PID values while running?
    Yes, you can adjust P, I, and D terms using commands like P123.34, I123.34, or D123.34 via USB or WiFi.
  • How do I set a specific target position?
    Send the X command followed by the desired value, such as X5000, to move the servo to that specific encoder pulse location.
  • Does the code support saving settings permanently?
    Yes, using the W command stores the current PID values into Flash memory so they persist after power loss.
  • Can this project be used with non-servo DC motors?
    Yes, it can be adapted to other DC motors by adding H-bridge control electronics and modifying the control code.
  • How many discrete angles does one revolution contain?
    One revolution consists of 4096 steps or discrete angles thanks to the magnetic encoder integration.
  • What tool did the author prefer over telnet for connection?
    The author found that using netcat (nc) provided better performance and stability compared to the previous telnet tool.

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter
Scroll to Top