I'm doing a project that use brushless geared DC motor,
the motor is connected to a moving platform. I will drive the motor with PWM, the motor then move the platform from -a degree to a degree position.
There's an RPM setting for the motion speed need to be achieved, to do this everytime it reach the peak position (0 degree) I read the angular speed from gyro sensor that was attached in the platform, then procceed the value to PID controller.
I want to ask which one is the correct/better approach to drive the motor: (motor initially stop)
(1) Start from a MINIMUM duty cycle (let say ~30% is the minimum to make the platform move), then I increment the duty cycle at every time interval (e.g. +1% every 100 ms), when it reach 0 degree position I start braking by decrementing the duty cycle (e.g -2% every 100 ms), then stop the motor when reach the end position. That will be one cycle, then after every 1 cycle finished, I will calculate new value for the increment & decrement to achieve the RPM setting.
(2) From the start position, I drive the motor with constant duty cycle, then when reach 0 degree position start braking just like approach (1) using decrement. Then after every 1 cycle finished, I will calculate new value for the constant duty used, and also the decrement value when brakaing.
Which one is the better ALGORITHM with pros and cons?