ESP32 Servo Speed and position Control

Job ID: 39355928

Budget: £750 – £1,500 GBP

I need an experienced ESP32 programmer with control engineering expertise to develop code for controlling a servo motor. The motor needs to move between angles of 45° to 360° at variable speeds, while maintaining precise stability.

Key Requirements:
- Speed Control: PID control methods
- Signal Type: PWM signals
- Environmental Consideration: Temperature variations

Essential Skills:
- Proficiency in ESP32 programming
- Expertise in PID control
- Experience with PWM signal generation
- Understanding of control loops (Current, speed, and position)
- Ability to deliver a stable and smooth slow rotation


Ideal candidates should have a strong background in control systems and embedded programming. Please share your relevant experience and approach.

This will involve creating a source code to read a quadrature encoder signal, to measure the phase current and control current, speed and position control loops using the simpleFOC shield board. Control loop speed should be sufficient to meet the speed and position control required.
The proposed hardware includes an ESP32 with a SimpleFOC motor control board and a CubeMars GL60KV25 motor. Mounted on the motor is a 1024 slot encoder which is read using a AEDR-8500-102 quadrature encoder reader which provides a total of 4048 counts per rev and a once per rev marker, I can provide the motor and encoder board with a cables to connect to the Arduino board and the SimpleFOC board but the freelancer must purchase the ESP32 and SimpleFOC boards.
Speed and position demands should be entered via a serial terminal interface, this interface should also display the error between the demanded speed and the actual speed.

The finished project will include the Arduino source code libraries can be used but all the deliverable must include source code for all library files together with a build file to recompile all files from scratch.

The motor:
CubeMars GL60KV25
https://www.cubemars.com/goods-1133-GL60.html

The controller electronics
ESP32 Devkit-V4 with ESP32-WROOM-32

ESP32 connected to a SimpleFOC Shield controller board attached.

https://simplefoc.com/#simplefoc_shield
Connection matrix
SimpleFOC ESP32 Devkit IO
Pwm A – pin 7 GPIO35 – PWM1 – J2-6
pwm B – pin 9 GPIO32 – PWM2 – J2-7
pwm C - pin 6 GPIO33 – PWM3 – J2-8
Pin 10 - enable GPIO16 - ENABLE - J3-12
nReset – pin A1 GPIO5 - N_RESET – J3-10
nFault - pin A3 GPIO4 - N_FAULT – J3-13
Phase B - pin A0 CURRENT_PH2 – J2-3
Phase C - pin A1 CURRENT_PH3 – J2-4

Encoder connection
Channel A count – GPIO13 – J2-15
Channel B count – GPIO9-J2-16
Marker – GPIO34-J2-5

The project can start straight away and needs to be completed by the 20th of May 2025