EmbDev.net

Forum: µC & Digital Electronics Motor with non-directional encoder arduino library


von Fasaso H. (fasaso)


Rate this post
useful
not useful
Hello all,

I bought the following actuator on the internet:

https://de.aliexpress.com/item/4000374091344.html?gatewayAdapt=glo2deu&pdp_ext_f=%7B%22sku_id%22:%2210000001530238467%22,%22ship_from%22:%22%22%7D&gps-id=pcStoreJustForYou&scm=1007.23125.137358.0&scm_id=1007.23125.137358.0&scm-url=1007.23125.137358.0&pvid=3541ffb2-6450-4523-9788-89953e9fbd28&spm=a2g0o.store_pc_home.smartJustForYou_825606946.1

There are the following pins: M+, M-, GND, C and A. By changing the 
polarity of M+ and M- I can control the direction of the motor.
At C I give 5V, GND is clear and at A I simply measure 0V or 5V 
depending on the position of the motor. I would like to drive the motor 
with a L298n module. Most PID libraries I have seen use an encoder with 
2 pulses to determine the direction. But since I define the direction of 
the motor with the H-bridge circuit of the L298n I only need 1 pulse for 
the speed (I don't have any more anyways). Now my question: is there a 
library which makes it easy to control a motor with a non-directional 
encoder?

Thanks for your answers

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.