Clear Filters
Clear Filters

Arduino Encoder block drift issue with Arduino due

2 views (last 30 days)
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:
Due:
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?

Answers (0)

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!