Dc motors arduino matlab11/2/2023 The tuned controller was able to meet basic design objectives, such as tracking and fast response time. However, at certain angles, there are oscillations, even though tracking is achieved. The motor behaves fine at the end points (-100 and 100). Then I send angle commands to the motor and read them back using the Arduino. The final test is to run it on the physical motor to see the performance of the controller under a real operating environment. Controller ModelĪfter tuning the gains, I get a system response that achieves tracking under 2 seconds, has less than 20% overshoot and settles without oscillations. I attach a PID controller block to the DC Motor and tune the PID gains. The next step is to design a controller based on this model. It is not a perfect fit, but it will do for now. For longer optimization problems, there is an option to use a parallel pool of workers, where MATLAB utilizes additional cores on the desktop. The estimation converges after 3 minutes. The final parameter values and point of converging is dependent on the initial parameter values, so choosing the initial values can be a mix of art and experience. With the data, Simulink runs optimization processes against my DC motor model to determine the parameter values. This is where I plug in experimental input-output data, specify parameter constraints and start the estimation process. Next, I use the parameter estimation app, which is under Simulink Design Optimization toolbox. Comparison of model (before parameter estimation) with experimental data The model takes a shape similar to experimental data, however, the magnitudes are far off. I first run the simulation with arbitrary R, L, K, B and J values. The back emf constant is specified in the rotational electro-mechanical converter. To model the friction coefficient, a damper block is used, while the moment of inertia is modeled using an inertia block. It has a combination of electrical and mechanical blocks to account for the electro-mechanical domains involved in a DC motor. The below is my circuit model in Simulink, which uses blocks from the Simscape foundation library. There are 5 parameters to be estimated, which are: The DC motor’s equivalent circuit is a known one, as shown in the diagram below: DC Motor Equivalent Circuit I decided to try a different method to obtain the plant model: by using parameter estimation. In a technical article of a similar DC Motor control problem written by Pravallika Vinnakota of MathWorks, a black-box was assumed and a model was generated using system identification. Then, this data is run through the equation model of the plant in software, in order to estimate the parameters of the system. First, a set of experimental input-output data is obtained from the hardware. It has the mathematical equations, but not necessarily the parameter values. From these data-sets, a transfer function is obtained to match experimental behaviour as closely as possible.įinally, parameter estimation is a hybrid between first principles modeling and system identification. A set of experiments that is able to capture system dynamics as much as possible is run to generate input-output data of system characteristics. System identification treats the system as a black-box. You can then model the differential equations directly, or have physical modeling, which is use of Simscape environment to directly model physical components, like resistors, capacitors and inductors. You have the mathematical equations or equivalent circuit of the system to be modeled. These can be broken down into: first principles modeling, system identification and parameter estimation.įirst principles modeling assumes you have complete understanding of the system to be modeled. There are several methods of plant modeling. A more reliable approach is to build a plant model and simulate it to verify the controller at different operating conditions so as to run what-if scenarios without risk.” – Pravallika Vinnakota, MathWorks ” Tuning a controller on a physical prototype or plant hardware can lead to unsafe operating conditions and damage the hardware. So, a better approach would be to model the plant to be controlled and verify the PID gains in software before testing on hardware. I have an Arduino UNO and would to design a controller to rotate the DC motor to specific angles.Ī straight-out approach would be to write C-code for a PID controller and test different combinations of PID gains, see the results on the motor, and then rinse and repeat till the motor behaves.īut tuning controller gains directly on hardware may pose damaging situations for the hardware and long design times to find the best PID gain combination. There’s a DC servo motor sitting on my desk.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |