Need help understanding BS1 with servos... plsout, delay, and pause
Zapper
Posts: 1
Hello... I am new to BS/PBASIC and I have a BS1 and a hobby servo (HiTek HS425BB)
I am trying to get some "predictable behavior" results with the servo and am having no luck.
Could someone please help me answer these questions:
1. Although I understand program flow and loops..... How do the PLSOUT, DELAY, and PAUSE relate to each other with servo behavior (sometimes the servo "zips" over to a position... sometimes it j e r k s ... s l o w l y to a position) When do I use which and where... etc.. COULD YOU SHOW ME A SNIPPETS?
2. why does the value "100" refer to 45 degrees left and "200" refer to 45 degrees right? what are those numbers relative to?
3. While I 'm thinking about it... I read somewhere that the servo could be "modified" to achieve full 360 rotation. How do I do that with my servo?
4. I'm not looking for "stop on a dime" precision, but at least to be able to control the speed at which the shaft turns (...move here quickly...then move there slowly... then stop... then move there medium speed... etc)
Any info would be appreciated.
I am trying to get some "predictable behavior" results with the servo and am having no luck.
Could someone please help me answer these questions:
1. Although I understand program flow and loops..... How do the PLSOUT, DELAY, and PAUSE relate to each other with servo behavior (sometimes the servo "zips" over to a position... sometimes it j e r k s ... s l o w l y to a position) When do I use which and where... etc.. COULD YOU SHOW ME A SNIPPETS?
2. why does the value "100" refer to 45 degrees left and "200" refer to 45 degrees right? what are those numbers relative to?
3. While I 'm thinking about it... I read somewhere that the servo could be "modified" to achieve full 360 rotation. How do I do that with my servo?
4. I'm not looking for "stop on a dime" precision, but at least to be able to control the speed at which the shaft turns (...move here quickly...then move there slowly... then stop... then move there medium speed... etc)
Any info would be appreciated.
Comments
While I 'm thinking about it... I read somewhere that the servo could be "modified" to achieve full 360 rotation. How do I do that with my servo?
Yes there is a way but why when you can buy one for $12.00 already that way
http://www.parallax.com/Store/Robots/RoboticComponents/tabid/198/CategoryID/70/List/0/Level/a/ProductID/102/Default.aspx?SortField=ProductName%2cProductName
I have "Modifed a couple of them this is not easy and for me it is not worth·doing it
Make sure that you follow the set up that they have at this link before you start
http://www.parallax.com/Portals/0/Downloads/docs/prod/motors/crservo.pdf
Here is the link to·“What’s a Microcontroller" this start on page 103
· http://www.parallax.com/Portals/0/Downloads/docs/books/edu/wamv2_2.pdf
Also take a look at this as well it starts on page 41
http://www.parallax.com/Portals/0/Downloads/docs/books/edu/Roboticsv2_2.pdf
SYMBOL Temp = W0 'Work space for FOR NEXT
SYMBOL Servo_pin = 0 'I/O pin that is connected to servo
FOR temp = 0 TO 200 '
PULSOUT Servo_pin,150
PAUSE 20
NEXT
FOR temp = 0 TO 200
PULSOUT Servo_pin,180
PAUSE 20
NEXT
FOR temp = 0 TO 200
PULSOUT Servo_pin,120
PAUSE 20
NEXT
Stop
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
··Thanks for any··that you may have and all of your time finding them
·
·
·
·
Sam
Post Edited (sam_sam_sam) : 4/24/2008 8:59:08 PM GMT
I would recommend reading the “What’s a Microcontroller?” manual, a free download in PDF format. While it applies to the BS2, the section on servos will explain what you need. The only real different is the PULSOUT values being used. I hope this helps. Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support