Read linear encoder using raspberry pi and simulink
Mostrar comentarios más antiguos
Hello there :)
I've already managed to read out acceleration data using the raspberry pi and simulink (created my own driver block for this using c code). The next step is to get a positional reference from the following linear encoder:
The encoder has a linear resolution of 0.25 mm, which generates 40.000 pulses/second when using a maximum speed of 10 m/second (the platform is moved by hand, so it should be less than this in average).
I've tested the encoder using simulink with the given simulink blocks (GPIO read), but it's not possible to get a sample time of 25 us.
Another approach that I've tested: Create a device driver block using c-code and the wiringPi library and interrupts. This works, as I can use a slower sample time in simulink and interrupts are running with a higher sample time on the raspberry pi, but still not fast enough (I'm not able, when moving a vertical platform up and down, to get back to the initial value with what the encoder started).
Do you have any possible solutions for me? I was thinking about using an arduino board just for reading the encoder, because I'm already reading out two acceleration sensors with the raspberry pi and simulink.
Thanks in advance.
Best regards,
Niko
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Raspberry Pi Hardware en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!