Hello everyone,

I need a help with my project which is a 2 dc motors controlled by a pwm signal and this signal is depends on the value of the joystick.

Joystick output is 0-1023 and by mapping the value to 0-255 we can control the dc motor by a pwm signal, but this called "Open loop control" and the "Closed loop" requires a feedback which can be represented by an encoder.

I need the basic principle of designing and implementing a closed loop control system, Actually i have found more libraries that make the design and equations for feedback is more easiest. But i can't understand what i should do exactly? did the values i've got it is true or false?

Maybe if the rpm value is computed by the encoder so i can convert it to a bits and compares it with the input value of joystick and the desired output will be the difference between two values (feedback & input). I don't know how to convert the rpm value to a bits because i'm working with a libraries and don't know what the equations are used.

Please feel free to comment, but no one knows everything and he should learn to know, right?

Thanks in advance