Show Posts
Pages: [1]
1  Topics / Robotics / Re: Help with this code please. on: September 26, 2012, 11:10:09 pm
I just thoght that by making the mods to a servo for continuous rotation I would get a DC motor.

How did you modified the servo exactly?

Servos have IC circuit & a pot inside, while DC motor don't. Did you remove the pot & the circuit (PCB)? As far as I know, you still need motor driver (e.g L293D) to controlling direction & speed of a DC motor.

Even if you modified your servo for continuous rotation like usually people do (e.g : http://letsmakerobots.com/node/4873) , not all kind servos are easily modified.

Well, like I asked before, how did you modified the servo exactly?

2  Topics / Robotics / Re: Help with this code please. on: September 26, 2012, 08:00:21 pm
Hi biotech..
Why are you using PWM for servo??
Have you already know how servos work?
I suggest you to use servo library, or you can write your own code, but not using PWM.

You may want to read this first before you write your own servo code :
http://www.servocity.com/html/how_do_servos_work_.html

Or you can use this library :
http://arduino.cc/en/Reference/Servo
3  Topics / Robotics / Re: Help for my shaking quadruped robot on: September 26, 2012, 10:14:34 am
Code:
    else if(distance <= CRITdistance) {
            resetPREVangle();
            prevmillis = millis();
            while(millis() - prevmillis < 5000) {
                walkBWD();
            }

            resetPREVangle();
            ultrasoundSWITCH = 1;
            stallVAR = 0;
            turnRightVAR = 0;
            turnLeftVAR = 0;

            rotate();
    }

OOPS.. Sorry tuxduino!!
You were right! It did work!!
I forgot I'd used "while" function inside my rotate function that make sure the rotate routine won't interfere by the change of "CRITdistance" value.
THANKS ALOT tuxduino!!!!  smiley-grin  smiley-grin
4  Topics / Robotics / Re: Help for my shaking quadruped robot on: September 26, 2012, 09:56:24 am
I spotted this:

Code:
else if(distance <= CRITdistance) {
        CRITvar = 1;                    // you assign a value
        switch(CRITvar) {            // then immediately test for its value
        case 1 :                            // of course this case will always be selected
            resetPREVangle();
            prevmillis = millis();
            while(millis() - prevmillis < 5000) {
                walkBWD();
                CRITvar = 2;
            }                          // missing "break", so case 2: will also be executed

        case 2 :
            resetPREVangle();
            ultrasoundSWITCH = 1;
            stallVAR = 0;
            turnRightVAR = 0;
            turnLeftVAR = 0;

            rotate();
            break;
        }
    }

CRITVar is not used elsewhere, so the code can be simplified as follows:


Code:
    else if(distance <= CRITdistance) {
            resetPREVangle();
            prevmillis = millis();
            while(millis() - prevmillis < 5000) {
                walkBWD();
            }

            resetPREVangle();
            ultrasoundSWITCH = 1;
            stallVAR = 0;
            turnRightVAR = 0;
            turnLeftVAR = 0;

            rotate();
    }

my 1 cent :-)

Awesome tuxduino!! And that's not 1 cent, that's a million for your kindness to help me!

But I need "switch" function to keep the robot rotate routine not interfere by CRITdistance value till it's rotate routine completed. You see, the robot rotate left then right (or right then left, randomly) to compare which direction has longest distance to walk by.

But it still just my argument, I need to prove it by implementing your suggestion.  smiley-razz
So I'll try your revision first..   
I'll report whether it works or not.. smiley  smiley


5  Topics / Robotics / Re: Help for my shaking quadruped robot on: September 26, 2012, 09:05:42 am
That looks really good, well done.

If anything it looks as if the servos are struggling to hold position meaning they do not have enough torque.

First find a way to check that the values you are sending are smooth, then if you want to try a higher refresh rate, let me know.
rcarduino.blogspot.com

Hi DuaneB, thanks for your reply and compliment.
I think they have enough torque, because the jitter still occured when I lift up the robot.
I'd already checked the servos values thru serial monitor before, and they appeared as they expected.
May I have your servo library please?
P.s. Great blog you have there, must bookmark it!


You can zip it and add it to a post as an attachment. (Hint: additional options below the textbox)

Done tuxduino. Hope you could help me.
But I have to warn you that my code is unprofessional, all messy and I didn't put comment lines to explain what doing what since I didn't expect someone would read it in the future. Sorry  smiley-sad
6  Topics / Robotics / Re: Help for my shaking quadruped robot on: September 26, 2012, 07:49:07 am
It looks like the input-readings are distorted.
Check the sketch for unused (but defined as input) pins and make them outputs or attach a pullup resistor on the inputs.

Thanks for answering o_lampe.
I'd checked, there is no unused input pin in my code



Never used a servo (yet), but if I remember correctly they shouldn't be controlled by pwm pins. This library has to (should) be used:

http://arduino.cc/en/Reference/Servo


the Arduino has only 256 different PWM steps per channel. A servo only 'understands' PWM signals from lets say 20% to 80% duty cycle ( wild guesssing here )
Both facts limit accuracy on the electronics side. Add mechanical inaccury and you see a trembling robot.

I don't understand o_lampe, I used standard Servo library like tuxduino mentioned before.
Can you explain how PWM has something to do with servo library?

Hi, tuxduino I was trying to post my code, but then my post exceeds 9500 character, which is not allowed. Sorry  smiley-sad


I would advice to use simplot http://www.negtronics.com/simplot (or something similar) to look at the values you are sending to the servo's.
At least then you know whether the problem is in your code or in the electronics/mechanics.
If you have a scope you can also read the signals send to the servo's. I would also check the voltage. I would not be surprised you have voltage spikes because you have 12 servo's.

Thanks alot Jantje. That's way above my level of knowledge.
I guess I need to learn from your link first..



7  Topics / Robotics / Help for my shaking quadruped robot on: September 25, 2012, 09:48:50 pm
Hi, this is my first post in this forum.

First, sorry for my english.  smiley-cry

I'm new to microcontrollers or electronics. In fact, this is my first microcontroller project.
I had made a quadruped robot with 12x HXT900 servo (3 DOF per leg). I use atmega328 with arduino bootloader. The problem is the servos are jitter too much. I already have research that most conclude that the problem is on the cheap servos (HXT900). Is that true? Is there any solution without replace the servos?
Please tell me if you need more information about this robot to help me. Here is my robot video :



Thanks before for your help..  smiley


Pages: [1]