Dc motor position control

16 ビュー (過去 30 日間)
Eleni.T
Eleni.T 2020 年 6 月 29 日
コメント済み: Eleni.T 2020 年 7 月 10 日
Hello. I am modelling a solar tracker in Simulink. I have 2 LDR sensors attaches on a pv panel, and they give a voltage output depending on the sun light each one receives. I want to write a function that will read the two voltages values and compute the difference and then command a DC motor(which rotate the panel) to rotate until that voltage difference becomes zero. My question is what should be the command to the motor? The motor simulink block I created has an input of voltage and outputs an angle. If I use a PID controller I have to specify the referenced desired angle but this is unknown. The desired angle is reached when the voltage difference of the sensors is zero. Whould it be correct if I use a PID controller to control the motor speed? And the output of the function will be the desired speed(to operate the motors) and 0 to stop the motors.

採用された回答

Vasco Lenzi
Vasco Lenzi 2020 年 7 月 2 日
Hi Eleni
I think the best approach would be to model the LDR sensors in Simulink as well. I believe you are using Simscape Multibody (from your previous questions) so you can place a "light source" approximating the sun and use the Transform Sensor to meaure angle and distance from this light source and then model their voltage behaviour. You can even move the light source using something akin the Point On Curve Constraint to mimick the day passing.
Then I would feed directly the the voltage difference of the sensors to the PID block. In the end the PID act on the DC motor and continue to act until the input to the PID block is 0. So I would simply use the voltage difference, but in order to model and tune it in Simulink with this approach you do need a model for the LDR sensors and the sun position.
Just my 2 cents, good luck.
Vasco
  6 件のコメント
Vasco Lenzi
Vasco Lenzi 2020 年 7 月 6 日
編集済み: Vasco Lenzi 2020 年 7 月 6 日
Simulink is really the best platform to model these basics such as ADC, discrete time etc. In this video they entered this discussion just superficially, by making the controller discrete:
You can model ADC by using blocks such as the Zero-Order Hold (continous to discrete transition) or Rate Transition block (continous to discrete or discrete-to-discrete with different sample times). DAC should be modeled from 2020a with the First-Order Hold block in the continous library. You can set the sampling time of a subsystem by making it an Atomic Subsystem or a Model Reference:
You can then graphically check how all discrete time in your controller play out by clicking on the Sample Time Legend:
Eleni.T
Eleni.T 2020 年 7 月 10 日
Thank you very much, i am gonna try this.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeChoose and Parameterize Blocks についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by