Read rotary encoder from Arduino Uno in Simulink
Mostra commenti meno recenti
Hello,
I can easily read the counts in Matlab (like this: https://de.mathworks.com/help/supportpkg/arduinoio/ug/control-rotary-encoder-knob.html), but not in Sumulink! Can someone tell me how it is the correct way to read the counts in real-time in Simulink?
Thanks
Risposta accettata
Più risposte (3)
Hasan Falah
il 30 Giu 2020
0 voti
Hello friends,
I’m using arduino Due to read incremental rotary encoder by simulink, there is no block in sinulink to do that.
I tried with external interrupt example in matlab 2020a but it is reading only in one direction and just increasing, so it should be readings in clockwise and counterclockwise.
Aslo I tried with encoder S-Function in Device Driver examples but also does not work.
Your help please .....
Thanks
4 Commenti
fatima zohra soussi
il 19 Ott 2020
hi hasan are you did it that if yes can you help me contact me
fatisoussi735@gmail.com
Yago Menezes
il 26 Gen 2021
hi Hasan, did you manage to solve this problem?
if yes can you help ?
I am working with a 2dof helicopter plant, which uses incremental encoders and would like to interface with simulink
yagodeleon27@gmail.com
Harshil Jani
il 29 Mar 2021
Hi Yago menezes, If you are able to use it using simulink please send me to harshiljani008@gmail.com
Anass Dkheila
il 21 Set 2021
Hello Hasan did you solve this problem? if you did can you send it to me at againstmarz@gmail.com
Daniel Velazquez
il 5 Lug 2021
0 voti
Hi, thanks for the encoder part.
Attached is a preliminary implementation of a PID Speed Controller for a DC motor with encoder.
The circuit is a low side FET to the pin 5 of the ATMEGA (PWM output) and pins 2 and 3 go to the encoders as input.
The PID parameters and scopes are tuneable.
Saludos
Daniel Velazquez
1 Commento
Azlin Afiqah
il 4 Ago 2021
Hi, can you give me the block diagram in version R2014a. Thank you. I'm helpless doing this project. I really really appreciate your support. Thank you again
Daniel Velazquez
il 6 Ago 2021
0 voti
Hello Azlin, unfortunately I do not have R2014a but you can easily redraw it in your version from the image attached of the Simulink diagram.
Have fun
Daniel
3 Commenti
Azlin Afiqah
il 9 Ago 2021
Thank you so anyways <3
mechali omar
il 21 Ott 2021
Modificato: mechali omar
il 21 Ott 2021
Hola, Hello Daniel Velazquez
Thank you for providing these useful files.
May I kindly ask you to provide a small clirification about some blocs in the encoder function.
1- for the gain 60/485. Why we exactly need to choose these values. Are thery related to the encoder type, or they remain valid for any other encoder.
2- for the bloc with gain of 0.1. What is the role of this bloc with exactly 0.1 gain.
3- How to change the sampling time of the S-Function block "Ts".It remains always 0.1 even we have changed it in the workspace.
GRACIAS

Omer Faruk
il 19 Mag 2022
Daniel could you explain how we obtain response curve?
Categorie
Scopri di più su Arduino Hardware in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!