Go to Post FIRST is the best thing that has ever happened to me...FIRST has taught me so much more than anything I learned in the classroom. The thing with my team, is we are so close, we are family, and I have figured out so much about who I am because of FIRST. - princessnatalie [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 10-02-2007, 12:58
JimHull's Avatar
JimHull JimHull is offline
Registered User
FRC #1891
 
Join Date: Feb 2007
Location: Boise, ID
Posts: 11
JimHull is an unknown quantity at this point
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   Spotlight this post!  
Unread 10-02-2007, 13:01
Gamer930's Avatar
Gamer930 Gamer930 is offline
Team 930 and 171 Alumni
AKA: Justin
no team
Team Role: Alumni
 
Join Date: Mar 2002
Rookie Year: 2002
Location: New Berlin, WI
Posts: 388
Gamer930 is a splendid one to beholdGamer930 is a splendid one to beholdGamer930 is a splendid one to beholdGamer930 is a splendid one to beholdGamer930 is a splendid one to beholdGamer930 is a splendid one to beholdGamer930 is a splendid one to beholdGamer930 is a splendid one to behold
Re: HS-322D servo programming question

That would be correct on the programming terms. . . .

Couple things it could be. . .
  • Code is in an if statement and the statement is never true
  • Backup battery not attached (dead) the servos are powered by the backup battery
__________________
2010 to Present, Scorekeeper/Field Power Volunteer for FRC/FTC/FLL
2005 - 2010, Team 171 College Mentor
2002 - 2005, Team 930 Student
  #3   Spotlight this post!  
Unread 10-02-2007, 13:02
FlyingDutchman FlyingDutchman is offline
Registered User
FRC #1566
 
Join Date: Jan 2006
Location: Idaho Falls
Posts: 38
FlyingDutchman will become famous soon enoughFlyingDutchman will become famous soon enough
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   Spotlight this post!  
Unread 10-02-2007, 13:04
JimHull's Avatar
JimHull JimHull is offline
Registered User
FRC #1891
 
Join Date: Feb 2007
Location: Boise, ID
Posts: 11
JimHull is an unknown quantity at this point
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   Spotlight this post!  
Unread 10-02-2007, 13:09
FlyingDutchman FlyingDutchman is offline
Registered User
FRC #1566
 
Join Date: Jan 2006
Location: Idaho Falls
Posts: 38
FlyingDutchman will become famous soon enoughFlyingDutchman will become famous soon enough
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   Spotlight this post!  
Unread 10-02-2007, 13:11
Eclipse's Avatar
Eclipse Eclipse is offline
Registered User
AKA: Sensei Hanzo
FRC #1250 (Gatro-Bots)
Team Role: Programmer
 
Join Date: Feb 2006
Rookie Year: 2004
Location: Dearborn, MI
Posts: 18
Eclipse is an unknown quantity at this point
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.
__________________
xXx.S3nS31-h4nz0.xXx
  #7   Spotlight this post!  
Unread 10-02-2007, 13:16
JimHull's Avatar
JimHull JimHull is offline
Registered User
FRC #1891
 
Join Date: Feb 2007
Location: Boise, ID
Posts: 11
JimHull is an unknown quantity at this point
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   Spotlight this post!  
Unread 10-02-2007, 13:19
Eclipse's Avatar
Eclipse Eclipse is offline
Registered User
AKA: Sensei Hanzo
FRC #1250 (Gatro-Bots)
Team Role: Programmer
 
Join Date: Feb 2006
Rookie Year: 2004
Location: Dearborn, MI
Posts: 18
Eclipse is an unknown quantity at this point
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?
__________________
xXx.S3nS31-h4nz0.xXx
  #9   Spotlight this post!  
Unread 10-02-2007, 13:41
JimHull's Avatar
JimHull JimHull is offline
Registered User
FRC #1891
 
Join Date: Feb 2007
Location: Boise, ID
Posts: 11
JimHull is an unknown quantity at this point
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   Spotlight this post!  
Unread 10-02-2007, 13:57
Eclipse's Avatar
Eclipse Eclipse is offline
Registered User
AKA: Sensei Hanzo
FRC #1250 (Gatro-Bots)
Team Role: Programmer
 
Join Date: Feb 2006
Rookie Year: 2004
Location: Dearborn, MI
Posts: 18
Eclipse is an unknown quantity at this point
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?
__________________
xXx.S3nS31-h4nz0.xXx
  #11   Spotlight this post!  
Unread 10-02-2007, 14:45
JimHull's Avatar
JimHull JimHull is offline
Registered User
FRC #1891
 
Join Date: Feb 2007
Location: Boise, ID
Posts: 11
JimHull is an unknown quantity at this point
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   Spotlight this post!  
Unread 10-02-2007, 15:12
Eclipse's Avatar
Eclipse Eclipse is offline
Registered User
AKA: Sensei Hanzo
FRC #1250 (Gatro-Bots)
Team Role: Programmer
 
Join Date: Feb 2006
Rookie Year: 2004
Location: Dearborn, MI
Posts: 18
Eclipse is an unknown quantity at this point
Re: HS-322D servo programming question

Ha ha. Don't worry. I've had that problem too. XD;

Well, glad you figured it out. =)
__________________
xXx.S3nS31-h4nz0.xXx
  #13   Spotlight this post!  
Unread 10-02-2007, 15:14
JimHull's Avatar
JimHull JimHull is offline
Registered User
FRC #1891
 
Join Date: Feb 2007
Location: Boise, ID
Posts: 11
JimHull is an unknown quantity at this point
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.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT -5. The time now is 20:49.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi