I am trying to use an HS-322D servo. I cannot seem to get it to respond to my commands.
It is connected to pwm05. Do I not just code pwm05=x;? “x” being 0 to 254? Am I missing something?
I am trying to use an HS-322D servo. I cannot seem to get it to respond to my commands.
It is connected to pwm05. Do I not just code pwm05=x;? “x” being 0 to 254? Am I missing something?
That would be correct on the programming terms. . . .
Couple things it could be. . .
hay sweet we’re in the same state!!! i personaly dont know so ill go get the programing captan… Yeah, uh, I think that’s all you have to do. Make sure nothing else would be controlling pwm05. Good Luck!
I did have a dead backup battery plus a bad wiring harness. Got that all taken care of. Have 7.8VDC on the bus. The servo twitches when I first power it up but then when it executes my code it does nothing. It is just straight code. No if statements.
just the normal oner of the acount… like I said before I know nothing about programing so try this is the plug all the way in and is it in the right spot:confused:
Well, if you’re expecting it to be constantly moving, that might be the problem. Pardon me if you already knew this, but servos move to positions as opposed to spinning around at different speeds. Commanding it to 0 would set it to one end of its travel and 254 would be the opposite end.
That is exactly what I want it to do. It is has 90degrees of motion and I want it to move over its entire range. So at initialization I would move it to the 0 position then when I activate it I want it to rotate the full 90degrees to the other end of its travel.
What exactly are you doing in your code? Are you setting it to 0 in User_Initialization and then setting it to 254 in the main code?
Well pwm05 is set to 127 in the initialization part of the code (default). Then in my Default_routine() I have the following:
pwm05=0;
for(i=0;i<10000;i++); // quick and dirty delay
pwm05=254;
for(i=0;i<10000;i++); // quick and dirty delay
Are you sure Default_Routine() is being called? I know that in Kevin’s code, Default_Routine() is commented out due to it interfering with camera PWMs. Try checking that?
Ok. First of all. I need more sleep.
Here is what happened. I was making changes to and downloading the wrong code. The rest of the team had created a new directory for a new version of code and had left the old source code open. I was in effect downloading the same hex code all this time. Unmodified hex code.
So. The solution is so freakin’ simple.
pwm05=x; // set Servo to desired position.
Thanks for all the help guys and gals…
Ha ha. Don’t worry. I’ve had that problem too. XD;
Well, glad you figured it out. =)
I hope my struggle will help others overcome any hurdles they encounter with the servos. There is very little information in the forums on the servos so I knew it had to be a very simple implimentation.