Shop OBEX P1 Docs P2 Docs Learn Events
Closed loop SERVO control — Parallax Forums

Closed loop SERVO control

ArchiverArchiver Posts: 46,084
edited 2003-02-27 12:33 in General Discussion
Hello,

I am triing to write the code for a closed loop-feed back program that reads an
input from a sensor and compensates the neutral servo position so that the servo
moves incrementally until the sensor has a zero reading. My approach so far has
been to use LOOKDOWN tables. My sensor readings are registered as signed decimal
SDEC. One direction would be + and the other - . I am using hobby servos to
control the platform. Does any one have any similar code that I could use a
base.

thx



Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now

[noparse][[/noparse]Non-text portions of this message have been removed]

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2003-02-27 12:33
    Hi there

    I am trying to writ similar code.

    Can you e-mail me what you have already, Mybe we could put our heads
    together to crack this problem.
    I am Very interested in what we can achieve together !

    Snippet of what I have written below:
    Sweepright:
    Debug cr,"Servo moving right ?",cr
    for position= curpos to 214 step 1 'sweep right
    increments of 0.36 deg
    Pause 250 ' Sweep slowly at speed 1/4 sec
    serout signal,n96n,[noparse][[/noparse]sync,servo,position] 'send the
    signal
    next
    Debug " Servo now at Right LOCK" ,cr
    pause time
    for loop =0 to 5
    Debug"Right LED light on for ",DEC loop," second ?"
    Debug cr
    for loop2 =0 to 1000 'light LED for 5 seconds
    low LED1 'Turn on right LED
    next
    next
    high LED1 'Turn off right LED
    Pause 250 ' Wait 1/4 second
    'debug cls
    RETURN





    Chris-H

    --- In basicstamps@yahoogroups.com, marcos <mmaarrccooss@y...> wrote:
    >
    > Hello,
    >
    > I am triing to write the code for a closed loop-feed back program
    that reads an input from a sensor and compensates the neutral servo
    position so that the servo moves incrementally until the sensor has a
    zero reading. My approach so far has been to use LOOKDOWN tables. My
    sensor readings are registered as signed decimal SDEC. One direction
    would be + and the other - . I am using hobby servos to control the
    platform. Does any one have any similar code that I could use a base.
    >
    > thx
    >
    >
    >
    >
    > Do you Yahoo!?
    > Yahoo! Mail Plus - Powerful. Affordable. Sign up now
    >
    > [noparse][[/noparse]Non-text portions of this message have been removed]
Sign In or Register to comment.