Arduino Encoder block drift issue with Arduino due
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I am trying to get encoder values using the rotary Encoder block. The encoder is reading the ticks generated by a pendulum.It is working perfectly fine for Arduino Uno but for a Due board, it shows a drift in the aquired sensor value over time. the difference between the two results can be seen in the attached screenshots.
Uno:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1623578/image.png)
Due:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1623583/image.png)
Everything works fine if I use the Arduino IDE and the encoder library (therefore the Arduino Due hardware is working fine).
I am running the model in external mode with Arduino as target. Fixed time step of 0.001and solver selection is auto, no clash with pin map as i am using pin 2 and 3 for the signals A and B respectively.The simulation target and code generation languages are C. Using Matlab 2021b.
Is it a bug or am i doing soemthing wrong here?
0 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Modeling finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!