Tuning Cascading PID DC Motor Position & Velocity Controllers

12 views (last 30 days)
Hi,
I'm trying to build a robot with a differential drive powered by two DC Motors. First I implemented a PID Controller to control the velocity of each motor independently. Estimated the TF using the MATLAB's System Identification Toolbox, of the open loop system by the acquiring the velocity of each wheels encoder in function of the PWM signal applied by an Arduino microcontroller. All went well and i successfully dimensioned the PID gains for this controller.
What I'm trying to accomplish now is to control the exact (angular) position of the DC Motor. I thought in cascading a PID controller in the input of the other already implemented. So this way, I can give a position to the first controller, which will be capable of generate an output reference to the second (velocity) controller so it generates the appropriate PWM value signal to drive the DC Motor accordingly.
Will it work? Is that a good approach? Or should I try to implement a different controller which outputs the PWM signal in response to a position reference signal?
But my main question here regarding the context of this topic is (in case the proposed first solution is implementable), how am i supposed to record the data to be able to use System Identification Toolbox in order to identify the system and design this second cascading PID? Should I record the absolute position from my encoders in function of an velocity reference to the inner Velocity PID controller? Or should I instead acquire the signals in complete open loop by measuring the absolute position of my wheels in excitation to a PWM signal? And which kind of excitation is the best in order to estimate the better model possible? Will a simple linear TF estimation be sufficient?
Many thanks for your attention and I hope somebody can help me with these doubts.

Answers (1)

Arkadiy Turevskiy
Arkadiy Turevskiy on 12 Aug 2014
Yes, your approach with cascaded setup is a way to go. See this example which is somewhat similar. Here there is a inner loop to control current and outer loop to control velocity- similar idea of using cascaded architecture.
As for your main question, you should try to record the data that represent the plant the outer loop (position loop will see). So you can command velocity reference and record position, use that data to identify the plant model, that would be the plant your position controller sees.
As for the type of model to identify, always start with a simple linear one, and move to more complex models if results with linear one are not good.
Here are some videos that might be helpful: 1 , 2 , 3 .

Communities

More Answers in the  Power Electronics Control

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!