Hi.
I want to follow the position of the dc motor. I want to instantly read real-time location information on the com screen with 1 degree precision. To use in this project:
Arduino UNO
I could not do this programming because I had inexperienced and insufficient knowledge about arduino programming. Can you help with this?
With PID control, I want to adjust the rotation speed of the motor to 10 degrees / sec. but when I come down to this speed range, roughness occurs in the motor rotation. how can i fix this problem?
You need to implement a position control loop, and advance the set point at 10 deg/s. This way you'll
be able to stabilize the motor's position over time much better than trying to control speed as the
feedback is more immediate.
You'd use a PID loop library, feed it the changing set point and encoder readings scaled appropriately
and use the PID output to set the motor drive (amount and direction).
MarkT:
You need to implement a position control loop, and advance the set point at 10 deg/s. This way you'll
be able to stabilize the motor's position over time much better than trying to control speed as the
feedback is more immediate.
You'd use a PID loop library, feed it the changing set point and encoder readings scaled appropriately
and use the PID output to set the motor drive (amount and direction).
I tried to create this loop before, but since I am new to coding, I was not successful. Could you give me a clearer approach to this issue, as there is no one I can get technical support from? I have difficulty understanding this way and I cannot get what I want to schedule.
i was about to respond to provide a general explanation of a control loop, which is
the loop continually maintains a motor position by comparing the current position to a desired position
the motor is driven in a particular direction when the current and desired positions are not the same
the problems with stopping a motor precisely without PID is that when the motor is commanded to stop (voltage removed) when it "reaches" the desired position, inertia will carry it past that position
the PID (or more precisely PD when digital) attempts to compensate for the speed of the motor as it reaches the target to slow, stop (remove voltage), or actively brake (reverse voltage) the motor to just reach the target.
however, simply using the PID may not be enough to precisely position a motor at a specific position, some amount of error may need to be tolerated. this suggests non-linear processing to recognize when to disable PID processing. this non-PID processing may also include when to apply braking (shorting motor winding)
the note describes some of the problems i encountered. however when i look back at the code, i see extra code to debug the behavior and abandoned approaches.
i will say however, that once i got the code working correctly and can see the PID algorithm working sanely (using reasonable value with the correct sign) it didn't take long (for me) to play with the coefficients to get the motor stop abruptly stop at a more than "acceptable" position. before that the motor may have slowed and just reached the position with the largest allowable tolerance or oscillated around the position. for my case, an acceptable position was less than the width of HO scale railroad rail on a ~12" turntable
even as an EE, it took me a while and it was a learning experience.
hopefully you will have a better starting point, have fewer problems, have a wider position tolerance and require less time to develop your system