Brushless with encoder actuater

Hi ,

I am kind of new to arduino so if some one can help me with that

I am trying to do a linear actuator with a brushless motor with a gear box 1 :16 and an encoder on arduino uno

I have an esc that has a pwm enable pin (plug on pin 10)
A dir pin ( plug on pin 11) and a braking pin wicht i currently dont use

My encoder has 264 pusle per turn and 2 channel ( a : pin 2 , b : pin 3

I want to be able to enter the number of turn i want on my out put shaf in the serial monitor and on a push of a button it start from 0 to X (x is the number of turn i entered ) and on another push of the same button it goes from X to 0

Can anybody help me with the programation of that ?
I will be for ever recognizing :wink:

Need some info on your various components, please post links to sellers webpage or brand name / part numbers.

Gigs and Collaborations if you want someone to write it for you.

However try searching for PID / motor control / servo loop and similar terms.

I have attach a pdf of all the compoments that i am using !

for the encoder it is the AM-EN16-S0256-003 it has 256 ppr
and the gear box has a 1:16 reduction ratio

Thanks a lot for your anwser guys :slight_smile:

Controleur.pdf (91.9 KB)

Encodeur.pdf (417 KB)

Gearbox Planétaire.pdf (85.6 KB)

Moteur.pdf (149 KB)

So the controller takes PWM (active low) for speed control, and a direction input.

Get that working in a test sketch.

The Encoder seems to be push-pull output ABZ, find an encoder library to read the A and B signals from that.

Then you should look at PID control - the output of the PID loop will set the drive level and direction of the
motor controller, the inputs are a position set-point and the encoder library value.