want to convert rotary encoder pulses into angle for DC motor

5 次查看(过去 30 天)
I'm using an rotary encoder to read the rotation of a DC motor with gearbox
i want to use Simulink to read channel A and B convert it to angle and then adjust control to the motor
unfortunately there is no block in Simulink to do that
i had the idea to read the 2 channels positive edge into edge triggered counter but I don't know how to create the condition statement in Simulink to increment and decrement the counter

回答(1 个)

Joel Van Sickel
Joel Van Sickel 2022-5-5
Hello Yousif,
this example has an implementation in Simulink for decoding a pulse stream. It's in the hall effect sensor subsystem.
You can use a switch to add a positive or negative value depending on the value's detected: https://www.mathworks.com/help/simulink/slref/switch.html
Regards,
Joel

类别

Help CenterFile Exchange 中查找有关 String 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by