Shop OBEX P1 Docs P2 Docs Learn Events
Potentiometer with detent? — Parallax Forums

Potentiometer with detent?

edited 2005-10-07 13:39 in BASIC Stamp
·· --Howdy! I've been fiddling around with using a pot to·position a "servo". I'm using·the teeny weeny one from Parallax that needs to be turned with a screwdriver. The application is to drive one of those surplus windshield wiper motors; I'm using the PWM output to send signals to a Victor motor controller and this is working very well.
···--The trouble is determining, with certainty, that the motor is in "neutral", so to speak. What I'm trying to do is use the motor as a winch to move a small load up and down on an art car I'm building. The winch will position the load one way when the vehicle is in motion and in another when it's parked. Although it's tempting to use a DPDT switch,·I'd·prefer to control the rate of the load's position·change with a big, easy to grasp knob on a pot that could be·located a few feet from the BOE. What's needed is a tactile feedback of some kind so that I know when the motor is in "neutral", so that the·motor isn't creeping. Text and photos of project to date at: www.nmpproducts.com/artcar.htm.
···· --Any suggestions appreciated.idea.gif

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
························ Hacking the Trailing Edge!
················http://www.nmpproducts.com/intro.htm
················---Decks a-wash in a sea of words---

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2005-05-10 19:35
    1. Have your program, which is reading the Knob, treat a range of values as a 'dead zone'.

    2. On your knob, mark the 'dead zone' as a small arc near the center of the knob movement.

    3. Your program probably should only have a few speeds for the motor -- Up Fast, Up Slow, Off, Down Slow, Down Fast might be sufficient. This allows 5 quadrants for your knob, and reduces how picky your system will be about knob position, since a range of knob resistances will result in the same output of the motor.
  • nick bernardnick bernard Posts: 329
    edited 2005-05-10 21:35
    encoder devices makes a magnetic encoder with 9b reselution and detent.
    http://www.encoderdevices.com/heavy_duty/heavy_duty.htmhttp://www.encoderdevices.com/heavy_duty/heavy_duty.htm

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    " Hey! Why is there silicone on my hemostats?"
  • Philip GamblinPhilip Gamblin Posts: 202
    edited 2005-05-11 01:13
    All Hail the Art Car... What could be a more noble cause??!· We have a great parade here in Houston, next week in fact.·I was thinking·to use a an encoder also but just a simple pulse generator whose rate would determine the rate of speed.... But I· recently reworked the PS2 Redux program so that a radio shack PS2 knock off controller's joysticks are decoded into eight PWM channels. Zero output all channels with sticks at center.·1·chip in addition to the stamp·plus driver circuit. I don't have the code on this machine or I'd post it. Let me know if you're interested.
  • edited 2005-05-12 02:04
    · --Thanks for all the· replies, gang. Lemme see if I can cover all the bases without forgetting something.

    ····· --Yes, writing program so that there's a "low" condition around neutral, to get motor turned off there, to save power and to keep it from overheating, good idea. Now all I gotta do is figure out how to state the problem in Pbasic! Lots of "IF THEN" statements I guess, yes? i.e.·I'm trying to splice this in to the program on page 158 of "What's A Microcontroller"; not even sure if I know *where* to put it, let alone *what*;· I figure it will be something like: if the value of time is more than 700·AND less than 788 then rcPin should be LOW. Any pointers appreciated.

    ···· --Re Burning Man; trying to find connections? Best bet would be to hang out at tribe.net and look for Burning Man related tribes in your area.

    ···· --Re: type of pot: I'm leaning towards a self-centering joystick, as they are cheap at the local electronics surplus outlet.

    ···· --PS I've upped the font size because the default (Veranda 2) is tiny!



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ························ Hacking the Trailing Edge!
    ················http://www.nmpproducts.com/intro.htm
    ················---Decks a-wash in a sea of words---
  • edited 2005-05-20 22:13
    ···· --Aha! Got it figured out last week but had a network glitch and couldn't move the file around. Here's the code, via copy and paste:
    ' What's a Microcontroller - MotorTest.bs2
    ' Vary motor/servo speed/direction with a potentiometer.
    ' Read pot in RC-time circuit using RCTIME commannd
    ' Scale time by 0.745 and offset by 500 for motor/servo
    ' The if then stuff is attempt to create deadband around motor neutral
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    scaleFactor···· CON·· 192
    offset········· CON·· 500
    rcPin·········· CON·· 7
    delay·········· CON·· 10
    servoPin······· CON·· 14
    time··········· VAR·· Word

    DO
    ·HIGH rcPin
    ·PAUSE delay························ ' wait allows cap time to charge
    ·RCTIME rcPin, 1, time·············· ' Execute the RCTIME command
    ·time = time */ scaleFactor········· ' Scale by 0.745 (X 256 for */).
    ·time = time + offset··············· ' Offset by 500
    ·DEBUG HOME, DEC5 time·············· ' Display adjusted time value.
    ·GOSUB TEST
    ·PULSOUT servoPin, time············· ' Send pulse to servo
    LOOP
    TEST:
    ·IF time > 700 AND time < 800 THEN time = 750
    RETURN
    ' DEBUG HOME, "time = ", DEC5 time· ' Store the time measurement in the time variable, display value
    END

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ························ Hacking the Trailing Edge!
    ················http://www.nmpproducts.com/intro.htm
    ················---Decks a-wash in a sea of words---
  • edited 2005-07-20 19:32
    · Re: joysticks: I did manage to find some surplus that are sorta applicable. It's a monster game controller thingy with really terrible pots, but the kewl thing is the centering feature, which includes a tension adjustment knob on the bottom. I got them for $5.- apiece from thinkgeek.com, plus a fairly onerous $5.- apiece for their *cheapest* shipping option. Still and all they're neat. I've stripped one down to bare bones and removed the funky pots. I had to make an adapter to·put a nice linear pot on one axis; this also involved boring a hole in one side of the case and extending the twisty bit out thru it. Next I've got to fasten the·body of the pot, then surround the·whole thing with something that will keep crud out. Finally I'll rewrite the software so that the small stick movement range will be able to reach what could be done with the multi-turn·Parallax pot. Photos soon. Have been concentrating on other aspects of the project, notably steering, but hope to get back to the electronics soon.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ························ Hacking the Trailing Edge!
    ················http://www.nmpproducts.com/intro.htm
    ················---Decks a-wash in a sea of words---
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-10-07 13:39
    Hey Ed, how was Burning Man this year? How did your art car turn out? Any pics to share with us?

    <edit> Ah I just found your pages on it, very cool, though It would have been cool to see some pics of your car in action (sign lit up etc) </edit>

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10

    Post Edited (Paul Baker) : 10/7/2005 1:57:12 PM GMT
Sign In or Register to comment.