Hello ,
While the dc motor is rotating at a certain speed, and suddenly there come a load, normally the speed of the motor will decrease, I want to keep the speed of the motor constant. How can I do this, I would be glad if you help me. My regards.
You will need some method of feedback from the motor as to its speed, possibly using a rotary encoder or a magnet on the output shaft and a Hall sensor
What sort of speed in rotations per minute or seconds are we talking about ?
well speed can be a measure of shaft RPM. If shaft RPM was read and shaft RPM slowed, down then more RPM zoomies are needed to maintain speed. Lots of PID examples on this site.
Hello,
Thank you for your reply, I am using "Encoder DC Gear Motor" and "bts7960b", with "Arduino"the motor will rotate in one direction, and will rotate continuously, but it will rotate at a constant speed, so if it rotates with 10 rpm, and when there is load, the speed slows down, automatically will increase it, and keep it constant at 10 rpm.
Thank you
You are welcome.
So where are you stuck ?
Please post a link to the motor that you are using
and
The problem is that the motor slows down when the load is on, I have to manually increase the speed to keep it constant, I want it to be automatic to increase the speed.
Do I need an extra device or sensor to do this? Or can it be done with an encoder?
You can do it with an encoder
Basically you read the encoder and calculate the RPM. If the RPM drops below 10 you send signals to the motor controller to speed it up and vice versa. You can do this with very little code
To make the process smoother and more accurate, you use a software PID controller, for which there is a library available. In essence, what a PID does is to regulate the change of speed of the motor so that the nearer to the required RPM is then the less correction is applied to the speed of the motor
I understood, I'll try this, thank you
PID is a good idea - it's pretty much a textbook application of it.
However, it's a bit more complicated to set up, so I suggest that try @UKHeliBob's simpler solution initially.