|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
HS-322D servo programming question
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? |
|
#2
|
|||||
|
|||||
|
Re: HS-322D servo programming question
That would be correct on the programming terms. . . .
Couple things it could be. . .
|
|
#3
|
|||
|
|||
|
Re: HS-322D servo programming question
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!
|
|
#4
|
||||
|
||||
|
Re: HS-322D servo programming question
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.
|
|
#5
|
|||
|
|||
|
Re: HS-322D servo programming question
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
![]() |
|
#6
|
||||
|
||||
|
Re: HS-322D servo programming question
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.
|
|
#7
|
||||
|
||||
|
Re: HS-322D servo programming question
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.
|
|
#8
|
||||
|
||||
|
Re: HS-322D servo programming question
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?
|
|
#9
|
||||
|
||||
|
Re: HS-322D servo programming question
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 |
|
#10
|
||||
|
||||
|
Re: HS-322D servo programming question
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?
|
|
#11
|
||||
|
||||
|
Re: HS-322D servo programming question
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.... |
|
#12
|
||||
|
||||
|
Re: HS-322D servo programming question
Ha ha. Don't worry. I've had that problem too. XD;
Well, glad you figured it out. =) |
|
#13
|
||||
|
||||
|
Re: HS-322D servo programming question
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.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Question about CMUCAM servo output | itsme | Programming | 9 | 13-01-2007 17:44 |
| C programming question | starchypizza | Programming | 2 | 18-11-2006 23:13 |
| Servo behavior question / advanced servo/PIC programming question | DanL | Electrical | 12 | 18-10-2005 18:33 |
| C Programming Question | tophq | Programming | 7 | 16-02-2004 12:56 |
| Programming question | archiver | 2001 | 6 | 23-06-2002 22:57 |