Cannot read encoder ticks that fast

10 visualizaciones (últimos 30 días)
Laura
Laura el 3 de Nov. de 2022
Comentada: Laura el 4 de Nov. de 2022
I have an encoder that gives me 2150 ticks per revolution. I am trying to control the position. If the motor goes slow, it functions just fine, but I need it to go faster, when I try this, I stop reading the encoder correctly, like it's missing ticks. I am already at 0.00001s as sample time, which I think it's already quite small, but it is still not enough. Any recommendations? Thanks!
  4 comentarios
Walter Roberson
Walter Roberson el 4 de Nov. de 2022
Unfortunately I do not know anything about that blockset, other than what I see at https://link.springer.com/chapter/10.1007/978-3-031-79927-3_2
However, I see there mention of "USB to TTL serial adapter - * Rx goes to PA2 * Tx goes to PA3". That hints to me that the board itself might have an actual TTL serial port. If so, then if you could connect that to a true serial port on your host (not a TTL to USB connection) then that would have the potential to talk to the board with lower latency.
Based on what people have done with other boards such as Arduino, I would suspect that you would be better off having code running on the board that does the counting for you, only sending summary or occasional information to the MATLAB host. But I do not know that particular blockset: some blocksets are designed to be deployed to boards like these, that might possibly already be what is happening.
Laura
Laura el 4 de Nov. de 2022
Hi Walter, got it, this does help me. I will try that communication, see if that helps. Thank you!

Iniciar sesión para comentar.

Respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by