Shop OBEX P1 Docs P2 Docs Learn Events
Servo Control with Pot — Parallax Forums

Servo Control with Pot

MichelBMichelB Posts: 154
edited 2009-10-11 02:24 in BASIC Stamp
Hi, there are several·experiments·about servo control with potentiometer e.g. ControlServoWithPot.bs2 (WaM?) and SW21-EX26-Servo_Control.BS2, in all cases the range is limited to about 30° (15° to -15°). I noticed in a own application that I can have a range of 180° (90° to -90°) with pulses 310 to 1180. What do I modify in SW21-EX26 to obtain the same range. Thank you in advance.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-10-09 13:16
    Look at the program and its comments. Where is the raw RCTIME information converted into a servo pulse width? What could you do there to change the range of the control pulses?
  • MichelBMichelB Posts: 154
    edited 2009-10-09 14:54
    In my opinion I think that the raw RCTIME information converted into a servo pulse width is rcRt = (rcRt */ Scale) MAX 500 etc. Scale, MAX 500·and PwAdj may be changed?, the goal being to have 90° when the pot is at one end and -90° when it is at the other end knowing that pulses are 310 to 1180 with my components for this range.
    P.S.: I think that I don't give you the expected reply.
  • Mike GreenMike Green Posts: 23,101
    edited 2009-10-11 02:24
    Yes, you will need to change Scale. You need to determine several points of RCTIME raw data, at least for each end and the center of the potentiometer range. You should be able to calculate the Scale value needed to produce servo pulses with values of 310, 750, and 1180. If the RCTIME data ends up being too non-linear, you may need to use a more complex formula to convert the RCTIME data to pulse widths.
Sign In or Register to comment.