Tuning a PID controller with real time sensor input ?

Hi all
I understand that it is possible to tune a PID controller according to various inputs, such as a RNG source block, a sine wave block, CSV value files etc.
However, how does one tune a PID controller using real time sensor data, especially from an android phone's sensors ? For example an accelerometer.
Can a PID controller be tuned interactively with the user moving and rotating the phone around ?
Cheers !!

 採用された回答

Sruthi Yenugula
Sruthi Yenugula 2019 年 6 月 12 日

0 投票

You can use TCP/IP blocks on Android to send sensor data to other hardware(Adruino/Rasberry pi/Lego) or host PC.
Check this example

7 件のコメント

Kiat Nern Yeo
Kiat Nern Yeo 2019 年 6 月 18 日
Hi sir. Thank you for responding to my question.
Do you happen to know the latency of such an operation ? For the communication between android and arduino via Tcp/ip.
I assume that the arduino requires a wifi-board, such as the ESP8266 right ?
In this same regard, is it possible to send processed and calculated values via tcp/ip to the arduino board ?
For example, PWM values ?
Best regards and thank you sir
Sruthi Yenugula
Sruthi Yenugula 2019 年 6 月 18 日
Hi Kiat Nern Yao,
Check this example
Q )In this same regard, is it possible to send processed and calculated values via tcp/ip to the arduino board ?
A) Yes
Q)I assume that the arduino requires a wifi-board, such as the ESP8266 right ?
A)Yes
Kiat Nern Yeo
Kiat Nern Yeo 2019 年 6 月 18 日
Hi sir thanks for replying.
Is it possible to send those values via the USB wire connected to the Arduino ? Meaning that the android phone and the arduino is connected via the USB-OTG wire.
Can the phone app created in the Simulink software send out values like this ?
Best regards
Sruthi Yenugula
Sruthi Yenugula 2019 年 6 月 19 日
Currently Android Support package does'nt have USB-OTG support, you can use ToApp/FromApp block and implement your own USB communication in Android Studio
Kiat Nern Yeo
Kiat Nern Yeo 2019 年 6 月 19 日
Hello
Is there an example that i can consult and try to learn from for this USB serial communication ?
Thanks !
Kiat Nern Yeo
Kiat Nern Yeo 2019 年 6 月 19 日
Ok sir thank you i will look through them

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMATLAB Mobile についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by