Go to Post FIRST is like pizza--you and I might prefer different toppings, but there's no wrong way to do it. - Billfred [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 14-07-2005, 20:53
[527]phil's Avatar
[527]phil [527]phil is offline
Alumni
AKA: Phil
FRC #0527 (red dragons)
Team Role: Alumni
 
Join Date: Oct 2004
Rookie Year: 2003
Location: N.Massapequa
Posts: 282
[527]phil is a glorious beacon of light[527]phil is a glorious beacon of light[527]phil is a glorious beacon of light[527]phil is a glorious beacon of light[527]phil is a glorious beacon of light
Send a message via AIM to [527]phil
Servo command confusion?!?!?!?!

OK first off I've asked many people what to do, all their advice should work in theory. But never work in reality. I'm currently trying to program my robo-one style robot to walk (very tricky). I need to move more than one servo at a time, I'm using a BASIC atom from lynxmotion. To move one servo i tried using "SERVO (#of pin servo is on), (how much i want it to move)" or "PULSOUT (#of pin servo is on), (how much i want it to move)". The thing is if i put 2 or more of these right ofter each other
(ie. SERVO 1, 800
SERVO 2, 800
SERVO 3, 800)
It will move servo 1, then servo 2, then servo 3 or in the order that the statements are entered. Is there a way that i can move all 3 together? If you need more info to help just ask.
__________________
Whats the difference between mechanical engineers and civil engineers?

Mechanical engineers build weapons, civil engineers build targets

Last edited by [527]phil : 14-07-2005 at 20:56.
  #2   Spotlight this post!  
Unread 14-07-2005, 21:02
sanddrag sanddrag is offline
On to my 16th year in FRC
FRC #0696 (Circuit Breakers)
Team Role: Teacher
 
Join Date: Jul 2002
Rookie Year: 2002
Location: Glendale, CA
Posts: 8,510
sanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond repute
Re: Servo command confusion?!?!?!?!

Try putting
SERVO 1, 800: SERVO 2, 800: SERVO 3, 800

or

PULSOUT 1, 800: PULSOUT 2, 800: PULSOUT 3, 800:

at least that's the way it works with a Basic Stamp.
__________________
Teacher/Engineer/Machinist - Team 696 Circuit Breakers, 2011 - Present
Mentor/Engineer/Machinist, Team 968 RAWC, 2007-2010
Technical Mentor, Team 696 Circuit Breakers, 2005-2007
Student Mechanical Leader and Driver, Team 696 Circuit Breakers, 2002-2004
  #3   Spotlight this post!  
Unread 14-07-2005, 21:37
[527]phil's Avatar
[527]phil [527]phil is offline
Alumni
AKA: Phil
FRC #0527 (red dragons)
Team Role: Alumni
 
Join Date: Oct 2004
Rookie Year: 2003
Location: N.Massapequa
Posts: 282
[527]phil is a glorious beacon of light[527]phil is a glorious beacon of light[527]phil is a glorious beacon of light[527]phil is a glorious beacon of light[527]phil is a glorious beacon of light
Send a message via AIM to [527]phil
Re: Servo command confusion?!?!?!?!

Nope didn't work, the manual says i have to use MSERVO then the pin # of the first servo, and then some other stuff. But when i try to add anything after MSERVO it turns black and tells me that there are errors when i try to program the chip.
__________________
Whats the difference between mechanical engineers and civil engineers?

Mechanical engineers build weapons, civil engineers build targets
  #4   Spotlight this post!  
Unread 14-07-2005, 21:49
sanddrag sanddrag is offline
On to my 16th year in FRC
FRC #0696 (Circuit Breakers)
Team Role: Teacher
 
Join Date: Jul 2002
Rookie Year: 2002
Location: Glendale, CA
Posts: 8,510
sanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond repute
Re: Servo command confusion?!?!?!?!

Quote:
Originally Posted by [527]phil
Nope didn't work, the manual says i have to use MSERVO then the pin # of the first servo, and then some other stuff. But when i try to add anything after MSERVO it turns black and tells me that there are errors when i try to program the chip.
Hrrm, so using a colon : and putting the commands ont he same line doesn't work huh? I thought it might because it does on a Parallax BS but other than that I don't know since I'm not a programmer.

I hope someone else has the answer because it seems to be an interesting problem and I am curious too as to what the solution is.
__________________
Teacher/Engineer/Machinist - Team 696 Circuit Breakers, 2011 - Present
Mentor/Engineer/Machinist, Team 968 RAWC, 2007-2010
Technical Mentor, Team 696 Circuit Breakers, 2005-2007
Student Mechanical Leader and Driver, Team 696 Circuit Breakers, 2002-2004
  #5   Spotlight this post!  
Unread 15-07-2005, 08:10
Gdeaver Gdeaver is offline
Registered User
FRC #1640
Team Role: Mentor
 
Join Date: Mar 2004
Rookie Year: 2001
Location: West Chester, Pa.
Posts: 1,363
Gdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond repute
Re: Servo command confusion?!?!?!?!

I believe the atom does not have hardware pwm in the chip. The servo command is a software implemented pwm. The sevo command is going to take a good amount of time. If you have to control the Servo signal very fast then you'll need hardware pwm. The FRC has several hardware pwm outputs. there are several other microcontrolers that have pwm hardware or you could use a seperate pwm chip to control the servos.
  #6   Spotlight this post!  
Unread 15-07-2005, 08:26
[527]phil's Avatar
[527]phil [527]phil is offline
Alumni
AKA: Phil
FRC #0527 (red dragons)
Team Role: Alumni
 
Join Date: Oct 2004
Rookie Year: 2003
Location: N.Massapequa
Posts: 282
[527]phil is a glorious beacon of light[527]phil is a glorious beacon of light[527]phil is a glorious beacon of light[527]phil is a glorious beacon of light[527]phil is a glorious beacon of light
Send a message via AIM to [527]phil
Re: Servo command confusion?!?!?!?!

Quote:
Originally Posted by Gdeaver
I believe the atom does not have hardware pwm in the chip. The servo command is a software implemented pwm. The sevo command is going to take a good amount of time. If you have to control the Servo signal very fast then you'll need hardware pwm. The FRC has several hardware pwm outputs. there are several other microcontrolers that have pwm hardware or you could use a seperate pwm chip to control the servos.
The basic atom comes equipped with 16 direct servo pots, and 4 aux ports. It can handle all of the servos. But I don't know which command to use in order to move more than one. It's not a hardware problem it's a programming problem.
__________________
Whats the difference between mechanical engineers and civil engineers?

Mechanical engineers build weapons, civil engineers build targets
  #7   Spotlight this post!  
Unread 15-07-2005, 12:35
Gdeaver Gdeaver is offline
Registered User
FRC #1640
Team Role: Mentor
 
Join Date: Mar 2004
Rookie Year: 2001
Location: West Chester, Pa.
Posts: 1,363
Gdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond repute
Re: Servo command confusion?!?!?!?!

If the basic atom pins are conected to the servos, then the behavior you are getting is the way it works. If you are using a servo board that the basic atom comunicates with and the board has a hardware PWM IC then the you have to reference the servo board comands. With a seperate servo board you could get the control you want. With out the hardware details, can't tell which is the case. As a work around you could try puting the 3 servo commands in a loop and make small position changes each time thru the loop till you get to the desired positions. You mention a mservo command . I didn't see this in the atom manual. Could it be an add in from the servo board? If its the case then it sounds like you have to add a function or something to your program.
  #8   Spotlight this post!  
Unread 15-07-2005, 17:21
[527]phil's Avatar
[527]phil [527]phil is offline
Alumni
AKA: Phil
FRC #0527 (red dragons)
Team Role: Alumni
 
Join Date: Oct 2004
Rookie Year: 2003
Location: N.Massapequa
Posts: 282
[527]phil is a glorious beacon of light[527]phil is a glorious beacon of light[527]phil is a glorious beacon of light[527]phil is a glorious beacon of light[527]phil is a glorious beacon of light
Send a message via AIM to [527]phil
Re: Servo command confusion?!?!?!?!

Quote:
Originally Posted by Gdeaver
If the basic atom pins are conected to the servos, then the behavior you are getting is the way it works. If you are using a servo board that the basic atom comunicates with and the board has a hardware PWM IC then the you have to reference the servo board comands. With a seperate servo board you could get the control you want. With out the hardware details, can't tell which is the case. As a work around you could try puting the 3 servo commands in a loop and make small position changes each time thru the loop till you get to the desired positions. You mention a mservo command . I didn't see this in the atom manual. Could it be an add in from the servo board? If its the case then it sounds like you have to add a function or something to your program.
no no no, i think you miss understood me, the board that's holding the BASIC atom 24 pro is the one with the servo pins. I'm not directly connecting the controller chip to the servos.

This is the board with the inputs BASIC atom control board
__________________
Whats the difference between mechanical engineers and civil engineers?

Mechanical engineers build weapons, civil engineers build targets
  #9   Spotlight this post!  
Unread 15-07-2005, 19:48
Gdeaver Gdeaver is offline
Registered User
FRC #1640
Team Role: Mentor
 
Join Date: Mar 2004
Rookie Year: 2001
Location: West Chester, Pa.
Posts: 1,363
Gdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond repute
Re: Servo command confusion?!?!?!?!

Ok, your not using a separate servo board. Then the servo command is generating software PWM signals. Think of the servo command as a little function that turns the pin on and off according to the parameters that you give it. It generates the PWM signal for a certain period of time. Then it stops and returns to the next line of code. The atom servo command has a parameter that tells the command to repeat it's self up to 30 times. You only want 1 period so it should be 1. The behavior your getting is exactly as expected. A work around to give the appearance of simultaneous control would be to put the servo commands in a loop and make small incremental changes. Something like the following.

Dim I
for I = -1200 to 1200 step 100
servo 1,I,1
servo 2,I,1
servo 3,I,1
next

The range and step can be changed to suit your needs. Depending on the speed of the processor and interpreter this should give the appearance of the servos moving together. If it's not fast enough or it's jerky then you may have to use a servo board. Look at the SSC-32 servo board from the site you referenced
  #10   Spotlight this post!  
Unread 15-07-2005, 20:10
sanddrag sanddrag is offline
On to my 16th year in FRC
FRC #0696 (Circuit Breakers)
Team Role: Teacher
 
Join Date: Jul 2002
Rookie Year: 2002
Location: Glendale, CA
Posts: 8,510
sanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond repute
Re: Servo command confusion?!?!?!?!

Looking back at my Basic Stamp code which uses PULSOUT, it is in a DO loop. Also, there is a PAUSE of 20 (I guess that's milliseconds) in the loop.
__________________
Teacher/Engineer/Machinist - Team 696 Circuit Breakers, 2011 - Present
Mentor/Engineer/Machinist, Team 968 RAWC, 2007-2010
Technical Mentor, Team 696 Circuit Breakers, 2005-2007
Student Mechanical Leader and Driver, Team 696 Circuit Breakers, 2002-2004
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
Problem controlling a servo Entropia Programming 2 18-06-2005 18:36
servo range of motion tux Control System 4 07-05-2005 02:32
Servo Compact Design Problems!!! Dominator_Legen Electrical 22 07-04-2005 18:15
Servo Help Dominator_Legen Motors 3 11-03-2005 19:50
Wiring a Servo to the RC n0t4g4iN Motors 3 21-02-2005 15:46


All times are GMT -5. The time now is 04:43.

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