servo pos

all right as you all (mostly) know im a newbi so i need help with servos/atom 28 what i need help with you may ask well not much just how to position servos right left middle you know the comman things
and i also want to know how to controll the servos with atom
and why i need to know you may also ask well for the project that im working on thats right you geussed it (kinda) the microbot :stuck_out_tongue:
and because i won’t to know how to use it with the ps2 controller :bulb:

you postion the servos with varying numbers between 900 and 2000…i think, 900 be the most extrene left or right, and vise versa, 1500 being the middle

btw, i think im off on the 900 or 2000, it is proabably different, someone else can tell ya

im pretty sure there is a toturial for this. Check it out on the LM website. There should 1 or 2 totorials on how to do it with the sequence (dont quot me on this) and the ssc as well as a servo positioner…anyways, get it from the site! :smiley:

every time i do 1500 just for a test the servo allways goes to the left

i wan’t to know how to pos it to the right
here is my test program and please try to modify it :slight_smile:

loop pos var word setpos servo p12,pos,1500 goto loop

With the Basic ATOM, the values go from -1200 to 1200 with 0 being the centered value. With the SSC-32 the values go from 500 to 2500 with 1500 being the center value. All of this information is in the ATOM manual (which you should get if you don’t have one) and the online documentation for the SSC-32. :slight_smile: You really need to take advantage of the online resources, including tutorials, that are here on the site. :smiley:

I have found that values from -900 to 900 will cover the complete 180 degree movement range of my servos (Hitec HS-422). This is convenient since the normal range of servos is 90 degrees each side of center. You results may vary and you may have to figure out offset values for you individual servos. I have not worked with any other servos yet, except the Hitec HSR-1422CR.

8-Dale

:blush:, im really sorry about that, i hopre i didn’t hurt your servos :blush: :blush: :blush:

is this right

setpos
 pos var word
servo p12,pos,-900
goto setpos

so this should rotate it to the right instead of the left :wink:

well any answors?

it depends on how you orientate the servo, try it out and see

Looking at page 150 in the Basic Atom Micro syntax manual it shows the syntax of the Servo command.

servo pin, rotation{,repeat}

So in your case I am not sure what your servo command will do.
in your example you have the variable pos passed to servo, but it is never set to anything. You also have repeat set to -900 so it may not do it at all, or maybe it will do it many times, depending on how the -900 is interpreted :question: .

you meen like thise

setpos
 pos var word
pos=900
servo p12,pos,-900
goto setpos

Maybe something like:

setpos
servo p12,-900
goto setpos

Or maybe something like:

pos var word
pos = -900
setpos
servo p12,pos
goto setpos

No need to keep setting pos within the loop.

and if i wan’t to go the other way
than i do this

setpos
 pos var word
 pos=900
servo p12,pos
goto setpos

possibly. Like the above posts read, it all depends on how it is interpreted.

is it possible to run to servos at once?

yes, if you code it into the IDE

no not that i meen run to servos at once like
when you have one servo moving and another one at the same time
i already know that you can controll 20 servos with the ide :open_mouth:

hmm, if it has the group movement thingy than it should

Um… I think you want to control servos using a PS2 controller?

First off don’t use the servo command. There are better ways to control servos from the atom. This tutorial is for the 4WD1 rover with a pan and tilt and gripper. It is a complex program, but if you break it down and study each section you may be able to grasp what is going on.
lynxmotion.com/images/html/build067.htm

The Viper sumo tutorial also has some basic atom code examples for controlling servos. Look at the Atom examples, not the Atom Pro.
lynxmotion.com/images/html/build044.htm

The basic flow for controlling servos is as follows.

declare variables and constants.

low p0 'this makes sure the servo pulses are positive going.
low p1

main:

Read sensors or remote controllers, do conditional comands, or follow sequences to determine the servo position values. hint you can use a byte variable for this and multiply by 10 in the pulsout command. So the range will be something like. 100 - 150 - 200, or 80 - 150 - 220.

pulsout 0,(servo0variable * 10) ’ The servo pulses are generated here.
pulsout 1,(servo1variable * 10)
pause 20

goto main

yes iknow about that allready
but it makes the servos move very slow :confused: