Jump to content
Owais

SERVO SMOOTHING FOR ROBOTIC ARM

Recommended Posts

Hi, i am making a robotic arm in which i have installed 6 servos i have written the code for my system and the servos are working accordingly the only problem is that all the servos ar moving very fast and thus the overall system seems as if it would break apart at any moment i have tried the landtastic module it works good but it a bit too slow as its basic version has default timings set to around 5 secs which is a little too slow for my robotic arm and also that my system is not wireless and i am directly giving signal to all servos from PIC 16f877a. I am using TOWER PRO SERVOS which give around 180 DEG rotation. Please i need help urgently as this is my final year project, please do also let me know wheather i could use landtastic in my system or not and if anyone could help me in changing the timings of landtastic or any other possible solution. Waiting for help.............

Share this post


Link to post
Share on other sites

It seems from your description that you're controlling the servos from a microcontroller with a program you've written yourself, i.e you have full control over the generated servo signal - so what prevents you from implementing the slower rotation in your program?

Edited by Kilrah

Share this post


Link to post
Share on other sites

thanks for the reply Kilrah, u r ryt i have written the program myself but the program is just for generating the PWM for servos and i am using CCS compiler for it. I am not sure how to control the speed of RC SERVOs through programming and due to this when the servo recieves signal it immediately turns to the corresponding direction.

Please let me know if i can control the speed through programming and how. thanks once again.

Share this post


Link to post
Share on other sites

If you're sending a standard servo signal extended for 180°, you're sending a ~500-2500us long pulse to your servo every 20ms, the length of the pulse controlling the position. To slow down, instead of instantly going from let's say 700us to 1800us from one pulse to the other, one way is to add a "layer" in your code that will limit how much the pulse width can change from one sent pulse to the other, "how much" determining the speed. So if you're at 700us, want to go to 1800us, and you limit to 20us per step, your routine instead of sending to the servo a 700us pulse followed by a 1800us one would send 700, 720, 740,... up to 1800, taking 55 cycles or 1.1 second to reach the desired position.

Share this post


Link to post
Share on other sites

i have implemented the difference of 20us, but it was too slow and had a lot of jerks. where as using the same method i have given the difference of 80us, it works almost perfect, but it has minor jerks. here is the part of code

while(1)

{

i=400;

while(i<=2400)

{

servo=1;

delay_us(i);

servo=0;

d1=20000-i;

delay_us(d1);

i=i+80;

}}

please let me know if i can improve this code by any means. also please consider that i have 5 motors working in parallel (robotic arm joints)

Edited by Owais

Share this post


Link to post
Share on other sites

Hard to comment without seeing the whole program, except that the delay_us() method is quite "dirty", i'd expect an interrupt-driven or hardware signal generation.

If you have jitter you most likely have some interrupts being used. Everytime an interrupt is fired it will halt the exection of the delays until it's finished, where the delay resumes - so obviously the delay becomes totally wrong, messing up the signal timings.

Share this post


Link to post
Share on other sites

well thankyou for the help. actually i am not quite sure about the interrupt methods. lets say i am satisfied with the jerks from this method. but now the problem is i have to provide different signals to 5 motors in parallel. that is i have to provide 80 degrees to base, 40 to base joint, 30 to above joint, 20 to wrist and 70 to gripper.

all angles should be provided simultaneously such that all motors get signal in parallel. i am using port C of PIC16f877A for motors.

can you help me out a little, actually i am stuck currently and have no choice and chance in such a short notice.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×