Shop OBEX P1 Docs P2 Docs Learn Events
BS2PX and Servo Motors — Parallax Forums

BS2PX and Servo Motors

wafa86wafa86 Posts: 44
edited 2010-10-05 16:42 in BASIC Stamp
Hi

I wrote a program to control the servo motor via bluetooth and it is working but not at the required level. I am reading the book of BS2 and I found out the programming of it has different numbers than the BS2PX. I used this code for forward movment:

PULSOUT 12, 2100'counter clock wise

PULSOUT 13, 1650 'clock wise

but the motion of the motors is not smooth, the motion has little vibration and not moving in stright line, it moving forward with simple heading direction to the left.

Can any one help me to find the appropriate number to use it with PULSOUT command and the equation to find out the pulse width in milisecond? and how do I calculate the RPM (rotation per min.)??????

Comments

  • FranklinFranklin Posts: 4,747
    edited 2010-10-05 15:36
    You need to add more to your program to get it to work a pause 20 and a loop. get 'what's a microcontroller' and the book on the boebot from the resourses tab of the parallax site and read up on the syntax and programming.
  • wafa86wafa86 Posts: 44
    edited 2010-10-05 15:45
    I tried PUASE 20 it make the movment more slowly so I remove it and of course, I put it in a loop, this is BS2PX module and I need to know the equation and the specific number to control the duration, the book is all about BS2 onlyyyy and I could not find any refernce mention BS2PX using servo motors, only the Penguin Robot Kit, the site mentions some thing about servo motors since this kit is using BS2PX and I saw the code it is complicated and not helpful!
  • Mike GreenMike Green Posts: 23,101
    edited 2010-10-05 15:49
    There's a supplement to the Stamp Manual about the BS2px. You can find a link to it on the Parallax Store webpage for the BS2px. It has the timing information for the BS2px. You may also be able to find the same information in the help files of the Stamp Editor.
  • W9GFOW9GFO Posts: 4,010
    edited 2010-10-05 16:09
    If you search for PULSOUT in the help files you will find this;

    attachment.php?attachmentid=74213&stc=1&d=1286320094

    Rich H
    1012 x 86 - 7K
  • wafa86wafa86 Posts: 44
    edited 2010-10-05 16:42
    okey now I get it thank u all
Sign In or Register to comment.