Programming a servo motor to stop at specific points

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
Benstag1
Posts: 1
Joined: Sat Jan 29, 2022 1:02 pm
Contact:

Programming a servo motor to stop at specific points

Post by Benstag1 »

Hi, I'm trying to get a servo motor to stop at 60deg and 140deg, it's driven via pwm from an l298 controller and Arduino Uno, I know the pot bit values from the demand pot for the angles and compare to the feedback pot. I can get the servo motor to sweep back and forth depending on the error between demand and feed back, but Im trying to get it to move to either 60 or 140 depending on if the demand pot is before 90deg or after. I wouldn't mind some help, regards Ben

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Programming a servo motor to stop at specific points

Post by medelec35 »

Hi, as servos have all their electronics built-in, you don't require a L298 controller, which is for DC motors.
Unless you are creating your own servo with DC motors?
In that case, you will need some form for positional feedback from the motor.
If it is a servo motor you are using then the signal pulse is very specific.
For that reason, Flowcode has got a built-in servo component
Can you give more details on what hardware and Flowcode version you have?
Martin

Post Reply