@tckrto Depends on the servo, but i mine was controlled by a timed pulse on a control pin. So a 1500usec pulse put it at neutral with a change of this time changing the angle. So set the control pin high for a delay of 1500usec then low and it will stay at 0deg(rees). Set it high for 1900usec and it will go 45deg clockwise, or 1100usec for a anti-clockwise 45deg angle. Personally i set up a case statement for each angle i required and embedded the timings into the case statements for easy use.
Thanks for the comment! The underlying mathematics behind the control worked in modelling. Unfortunately the control required from the servo to reflect the underlying maths just wasn't available. I required about 0.5 degrees of control from the beam and i had at best about 4 degrees and a very slow response.
I guess that's the problem giving a electronics student a partially mechanical project.
You could probably have achieved it by using an easing function to slow the ball before it reached its destination. Really depends on how accurate your sensor is and how precise and responsive the motor/servo is.
The sensor was excellent....capable of about 1mm precision. The servo was rubbish as its precision was never going to be responsive or accurate enough with such a large beam. With a better system of beam control the fuzzy logic and proportional differential control methods would have been successful but the beam engineering let me down.
Yup that's basically it. The control box worked fine but the beam mechanics were rubbish. Even though i knew i wanted to put the beam at an offset of 1 degree i couldn't achieve it. Basically meant that the ball oscillated around a point rather than settling on it. If anyone wants code etc i'm happy to hand it out. University is over for me
Comment removed
tckrto 1 year ago
Me too using PIC18F452! Able to share with me how you interface it with the servo motor?
tckrto 1 year ago
@tckrto Depends on the servo, but i mine was controlled by a timed pulse on a control pin. So a 1500usec pulse put it at neutral with a change of this time changing the angle. So set the control pin high for a delay of 1500usec then low and it will stay at 0deg(rees). Set it high for 1900usec and it will go 45deg clockwise, or 1100usec for a anti-clockwise 45deg angle. Personally i set up a case statement for each angle i required and embedded the timings into the case statements for easy use.
m0nkeyville 1 year ago
Comment removed
tckrto 1 year ago
Well done but i guess there is an overshoot with these Kp and Kd constants...
ozanenginoglu 1 year ago
@ozanenginoglu
Thanks for the comment! The underlying mathematics behind the control worked in modelling. Unfortunately the control required from the servo to reflect the underlying maths just wasn't available. I required about 0.5 degrees of control from the beam and i had at best about 4 degrees and a very slow response.
I guess that's the problem giving a electronics student a partially mechanical project.
m0nkeyville 1 year ago
You could probably have achieved it by using an easing function to slow the ball before it reached its destination. Really depends on how accurate your sensor is and how precise and responsive the motor/servo is.
TheOneFreeMind 3 years ago
The sensor was excellent....capable of about 1mm precision. The servo was rubbish as its precision was never going to be responsive or accurate enough with such a large beam. With a better system of beam control the fuzzy logic and proportional differential control methods would have been successful but the beam engineering let me down.
m0nkeyville 3 years ago
Wow..... What sensor did you use to measure the position of the ball in the tube??
eviltim666016 3 years ago
I used an Ultrasonic SRF04 range finder. Then used a PIC18F452 to interface it.
m0nkeyville 3 years ago
Yup that's basically it. The control box worked fine but the beam mechanics were rubbish. Even though i knew i wanted to put the beam at an offset of 1 degree i couldn't achieve it. Basically meant that the ball oscillated around a point rather than settling on it. If anyone wants code etc i'm happy to hand it out. University is over for me
m0nkeyville 4 years ago
what does it do?
ronzam2002 4 years ago
i think it just tries to get a ball to stay in a area
Skylord12345 4 years ago