Putting robotics at your service™

Free shipping on orders over $200

program for my project

Print view Share :
Previous topicNext topic

Page 6 of 6 [ 85 posts ]

1, 2, 3, 4, 5, 6
Novice ( offline )
Posts: 55
Posted: 2011-12-15 14:20 
Hi,
One thing is bothering me a lot right now: Every time when I start to run my servo with Bot Board II (for 180 degree moving), the the servo always quickly rotates to 0 degree first, then start its normal program. How can I get rid of the first quick move? I wish all moves are very slow as I programed.
Thank you.
Yongxin


User avatar
Guru ( offline )
Posts: 4920
Posted: 2011-12-15 14:40 
The problem is that when you first turn on your system. The system knows nothing about where the servo is, so it jumps to your first location. One work around is if you know where your servos resting point, tell it go there first and then tell it to move where you want it...

Kurt


Novice ( offline )
Posts: 55
Posted: 2011-12-15 18:36 
Hi, Kurt,
Thank you very much for your reply. So glad hearing from you.

Actually, no matter where I want it go, it always rapidly goes back to 0 degree levels and then start from 0 degree to where I want, except that it is originally at 0 degree.

For example, its position is at +90 degree, I set it starts at +90 degree, and after I switch it on, the servo moves back to 0 degree first, then moves to +90 degree and keeps running normally. Even I set up a "pause" at beginning, after I turn it on, the servo is still running back to 0 degree first, then starts the "pause".

Do we have a way to fix it? It will be OK as long as we can get rid of the fast move. I do not care where it starts very much.

Thanks again.

Yongxin


User avatar
Expert ( offline )
Posts: 628
Posted: 2012-01-08 18:21 
It will depend on what you are using. If you are using the SSC32/BotBoard/AtomPro28 then the SSC32 has a startup sequence programmed into. You can change this sequence in the SSC32. If you are using the ARC32 then I'll need to see your code to see what is causing it.

_________________
Basicmicro


Novice ( offline )
Posts: 55
Posted: 2012-04-06 11:10 
Thank you, Nathan.
Actually, I do not know what I have is SSC32 or ARC32. Neither is labeled on the boards (cards) I have. Jim recommanded them to me, he must know. All codes I am using could be found in this topic. They were developed by either Jim or Curt and they all cause abrupt move when the servo gets start. Following is an example:

MYSERVO con P4
hsPosition var sword
Position1 con -9000 'about -90 degrees (adjust to desired angle)
Position2 con 9000 'about +90 degrees
Time1 con 5000 '5 second pause value (adjust)
Time2 con 5000 '5 second pause value
HSSpeed con ((Position1-Position2)*20)/3000 ' This calculates the speed value. 3000 is in ms adjust...
sound 9, [100\880, 100\988, 100\1046, 100\1175]
low 0
HSERVOENABLE ' I don't think this is needed any more
hservo[MYSERVO\hsPosition]
start:
toggle P12
hsPosition = Position1
hservo[MYSERVO\hsPosition\HSSpeed]
hservowait[MYSERVO]
pause Time1
toggle P13
hsPosition = Position2
hservo[MYSERVO\hsPosition\HSSpeed]
hservowait[MYSERVO]
pause Time2
toggle p14
goto start

This problem bother me a lot. If you can further help me to get it resolved, I'll appreciatr it very much.
Yongxin


Novice ( offline )
Posts: 55
Posted: 2012-04-06 11:27 
It seems not ARC32.


User avatar
Guru ( offline )
Posts: 9256
Posted: 2012-04-09 11:18 
There is no mystery as to what is happening. It is a very common and easily understood problem. The hobby servo is an input only device. It will move when told to, but you can't ask it where it is. On the first move you must tell the servo to go to the position that is closest to where it physically is before power is applied. So you must change your program to do this. I do not know of any other way to say it.

BTW. The BotBoard II and the SSC-32 has the names silk screened right on the boards in large letters. The ARC-32 has no markings on it.

_________________
Jim Frye, the Robot Guy
http://www.lynxmotion.com
I've always tried to do my best...


Novice ( offline )
Posts: 55
Posted: 2012-04-09 12:03 
Hi, Jim,
Thank you for your reply.
I see "Bot Board II" on the board, but not SSC32. I also see a PS2 on the bosrd. Does it mean my board is PS2/Bot Board II in stead of SSC32/Bot Board II? Or SSC32 and Bot Board are the same thing?
My problem is that everytime when I start the servo, it very quickly moves to 0 degree then moves to the first position (e.g. +90 degrees) in my program with the speed I want. I do not want it move that fast. Can you tell me how I slow down the first move? You know I almost know nothing about the programming and all programs I am using were made by you and Curte......
Thank you again.
Yongxin


User avatar
Guru ( offline )
Posts: 9256
Posted: 2012-04-09 12:11 
The Botboard II is a carrier for the Atom or Basic Atom processors. The SSC-32 is a servo controller.

You need to modify your program to move the servo to a new first position. You will need to learn how to program in order to get the servos to move the way you want them to. If you try to do it we can help answer questions, but we're not here to write programs for people.

_________________
Jim Frye, the Robot Guy
http://www.lynxmotion.com
I've always tried to do my best...


Novice ( offline )
Posts: 55
Posted: 2013-01-03 21:32 
I am using following program to operate my servo, but it only operate one servo. I tried to add P5, P6, and P7 in, but did not work.
I also want to run more servoes with the same program (such as on P7 or P8) after stop P4, but I still can not get it work. Could any one teach me to do these? Thank you in advance.

MYSERVO con P4
hsPosition var sword
Position1 con -8700 'about -90 degrees (adjust to desired angle)
Position2 con -4137 'about -51.8 degrees
Position3 con -1885 'about -19.5 degrees
Position4 con 0 'about 0 degrees
Position5 con 1885 'about 19.5 degrees
Position6 con 4137 'about 51.8 degrees
Position7 con 8700 'about 90 degrees
Time1 con 15000 '15 second pause value (adjust)
Time2 con 15000 '15 second pause value
Time3 con 20000 '20 second puase value
Time4 con 308000 '5 minutes and 8 seconds pause value
HSSpeed con ((Position7-Position1)*20)/30000 ' This calculates the speed value. 30000 is in ms adjust...
sound 9, [100\880, 100\988, 100\1046, 100\1175]
low 0
HSERVOENABLE ' I don't think this is needed any more
hservo[MYSERVO\hsPosition]
start:
toggle P5
hsPosition = Position1
hservo[MYSERVO\hsPosition\HSSpeed]
hservowait[MYSERVO]
pause Time4
toggle P5
hsPosition = Position2
hservo[MYSERVO\hsPosition\HSSpeed]
hservowait[MYSERVO]
pause Time2
toggle p5
hsPosition = Position3
hservo[MYSERVO\hsPosition\HSSpeed]
hservowait[MYSERVO]
pause Time1
toggle P5
hsPosition = Position4
hservo[MYSERVO\hsPosition\HSSpeed]
hservowait[MYSERVO]
pause Time2
toggle p5
hsPosition = Position5
hservo[MYSERVO\hsPosition\HSSpeed]
hservowait[MYSERVO]
pause Time1
toggle P5
hsPosition = Position6
hservo[MYSERVO\hsPosition\HSSpeed]
hservowait[MYSERVO]
pause Time2
toggle p5
hsPosition = Position7
hservo[MYSERVO\hsPosition\HSSpeed]
hservowait[MYSERVO]
pause Time2
toggle p5
end


1, 2, 3, 4, 5, 6

All times are UTC - 5 hours [ DST ]. It is currently 2014-11-25 22:50
Feedback Form
Feedback Form