PID controlled PWM of a 12 v high frequency (15 kHz) dc motor using esp32

Skip to first unread message

Ajay Singh Redhu

Feb 14, 2024, 6:36:51 PMFeb 14
to DIY PID Control
Hello all,

Came here after reading the Blog by Brett to improve Beginner's PID library. I am currently working on a problem, where I want to control the speed of a 12v dc motor using high frequency PWM. I am able to control the motor speed using potentiometers to change duty cycle of PWM by esp32.

Now, I want to make a close loop control of the motor speed using PID to control duty cycle of PWM and therefore the speed of the motor. For the starters I now the relation between PWM duty cycle and motor speed which is linear by the way. So, I know the desired values of the PWM corresponding to the desired speed.

Any suggestion on how can I proceed from here to control PWM using PID? 

Thanks in advance!

Pieter S

Feb 16, 2024, 11:16:21 AMFeb 16
Hi Ajay

How do you plan to feed the speed signal back?
position rate of change,

You received this message because you are subscribed to the Google Groups "DIY PID Control" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
Reply all
Reply to author
0 new messages