Shop OBEX P1 Docs P2 Docs Learn Events
Continuous Rotation Servo - Page 2 — Parallax Forums

Continuous Rotation Servo

2»

Comments

  • SomniumSomnium Posts: 46
    edited 2006-10-18 00:58
    OK!... i know how to control the position of the standard servo! Woot!... but have no idea how to do it with the continuous servo... and still no idea how to incorporate the button
  • SomniumSomnium Posts: 46
    edited 2006-10-18 01:34
    more progress through experimentation... continuous servo seems to run and stop eventually, but doesn't stop at specific points... will need to work on this more...

    -edit-

    furthur experimentation... continuous servo doesn't seem to follow rules... or its supposed to do that...

    Initial Position Position change Outcome Angle
    2000 1900 720ish
    1598 1000 270 then back 180
    1598 500 190 then back 360
    2000 1000 540 then back 90

    is this normal or is there something wrong?

    Post Edited (Somnium) : 10/18/2006 1:42:49 AM GMT
  • James LongJames Long Posts: 1,181
    edited 2006-10-18 01:41
    more progress through experimentation... continuous servo seems to run and stop eventually, but doesn't stop at specific points... will need to work on this more...
    That is one problem associated with a continuous servo. The stopping point has to do with the timing of your program....not the servo itself. The servo rotates in the desired direction (depending on the pulse) until you tell it to stop.

    A regular servo only positions itself to the pulse length. But it can not go in a full revolution.......so there are trade offs for each type.

    James L
  • Joel RosenzweigJoel Rosenzweig Posts: 52
    edited 2006-10-18 01:44
    Somnium,

    A continuous rotation servo will do exactly that.· You give it a pulse that is non-neutral (other than about 1.5ms) and it will rotate continuously, provided you keep giving it pulses every 20ms.· If you give it pulse > neutral pulse, you get a rotation in one direction.· If you give it a pulse < neutral position, it goes the other direction.· These devices are no longer really "servos".· They're more like traditional motors when used this way, with a special front end.· These modified servos will not stop at specific points.· The best you can do is to stop them at specific times, which you will extrapolate to a certain amount of angular rotation.· If you need it to stop at a specific angle of rotation, you need to add an external shaft encoder.· Otherwise, you're back to using an unmodified servo. ;-)

    The unmodified servos will go to a specified position, directly proportional to the pulse width that you give it, from 1.0 to 2.0ms, extreme to extreme.

    If you want to stop a continuous rotation servo, you need to send it a neutral pulse.· and if you want to lock it there, you have to continue to send neutral pulses every 20 ms.·

    If you want to move a continuous rotation servo just a little bit, that means you have to send it non-neutral pulses for a certain amount of time.· It will move for as long as you keep giving it these pulses, spaced 20ms apart.· The magnitude of the pulse determines the direction of rotation.· See above.·

    Joel-
    ·
  • SomniumSomnium Posts: 46
    edited 2006-10-18 01:51
    what is this shaft encoder? hmm... oh jeez... that's a seperate part... urgh... guess its more experimentation... cry.gif
  • Joel RosenzweigJoel Rosenzweig Posts: 52
    edited 2006-10-18 02:01
    A shaft encoder is a device that outputs a series of pulses as the shaft it is connected to spins. Some shaft encoders output a pulse train using quadrature output (2 signals, 4 values) that can be used to determine relative direction of rotation. Others output a discreet word that describes absolute position.

    Don't worry about this.. this isn't what you need for your project. I think you need to step back and figure out what you are really trying to accomplish. Earlier in the thread, you stated that you knew how to move a standard servo, and a continuous rotation servo. So, now that you have both building blocks working, you should be good to go, right? Is the success that you stated above an accurate statement, or do you still have issues getting either to work?

    Joel-
  • SomniumSomnium Posts: 46
    edited 2006-10-18 02:03
    sweet!! ok i got it to move like 1 degree stop and repeat... i know how to modify this so i'm gud... i just need to figure out the button portion of the code now yeah.gif
    u have no idea how happy I am... thanx fo all the help... not there yet but getting there
  • James LongJames Long Posts: 1,181
    edited 2006-10-18 02:07
    Glad you got it moving....now on to more complex things...and keyboard head banging.



    James L
  • SomniumSomnium Posts: 46
    edited 2006-10-18 02:31
    hehe oh goodie... thats all a little 2day and all of 2morrow... whoop di doo... shakehead.gif
  • James LongJames Long Posts: 1,181
    edited 2006-10-18 03:41
    Hey....remember we think this is fun!!· devil.gif



    James L
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2006-10-18 04:41
    Somnium,

    Just remember that we have all been there. You must have patience and your results will eventually pay off.
    The caveat is that once you are bitten by the bug it is usually here to stay, creating more and more challenges
    for you to overcome along the way. Have fun!! enjoy the ride!!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • SomniumSomnium Posts: 46
    edited 2006-10-18 18:15
    Umm... hmm... here's what i have so far...

    CON
    
    _clkmode = xtal1 + pll16x        'Sets the clock speed to 80 MHz using a times 16 multiplier
    _xinfreq = 5_000_000             'Crystal speed: 5 MHz
    button = 22
    servo1 = 1
    servo2 = 3
    '  
    OBJ
      SERVO : "Servo4"
    
    PUB START
      Button_1
    
    PUB Button_1 | unit0
      servo.start(0,0,1000,1,0,0,1000,3)
      Dira[noparse][[/noparse]button] := 0
      Dira[noparse][[/noparse]servo1] := 1
      Dira[noparse][[/noparse]servo2] := 1
    
      If Ina[noparse][[/noparse]button] == 1
        servo.wait(1)
        servo.wait(3)
        servo.move_to(1,700,42)
        servo.move_to(3,700,42)
        servo.wait(1)
        servo.wait(3)
        servo.move_to(1,65,0)
        servo.move_to(3,65,0)
        servo.wait(1)
        servo.wait(3)
      else
        servo.wait(1)
        servo.wait(3)
        servo.move_to(1,65,0)
        servo.move_to(3,65,0) 
    
    



    button isn't workin still... i also came upon a problem... I'm makin this convier (don't know how to spell it) belt and apparently i didn't make them with even space... there are ten spaces... is it possible to make it move a certain amount for each time pressed?... like the first time it's some amount then the second time a different amount... then repeat for every ten
  • SomniumSomnium Posts: 46
    edited 2006-10-18 18:41
    i have a thought of how to do the code i want but unsure as to how... i'll say it verbally

    Button pushed add 1 to "X"
    check "X" and move servo dependent on that number
    When "X" reaches 10 erase and repeat over

    I'm so confused as to how to do this... help plz!
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2006-10-18 18:46
    You need a repeat in your button_1 routine otherwise it will check the button and finish instantly.

    The repeat should be before the if statement so it will keep checking the button, if it is pressed it will do one thing otherwise it will do the other.

    Graham
  • SomniumSomnium Posts: 46
    edited 2006-10-18 21:17
    alright sweet... got the button to react with the servo... now i need help with this portion...
    I'm makin this convier (don't know how to spell it) belt and 
    apparently i didn't make them with even space... there are 
    ten spaces... is it possible to make it move a certain amount 
    for each time pressed?... like the first time it's some amount 
    then the second time a different amount... then repeat for 
    every ten
    



    any ideas and thoughts would be great
  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-18 22:16
    With the continuous rotation servos, you can't reliably get them to move the same amount every time you activate them (to move your conveyor belt [noparse][[/noparse]conveys stuff down the road or whatever]). If you need reliable positioning, you will need an external encoder of some kind. Look at Parallax's encoder for the BOE-BOT <http://www.parallax.com/detail.asp?product_id=28107>. This just counts the number of wheel holes that move by a sensor, but can provide fairly accurate wheel positioning data. You could attach a sensor belt to your conveyor belt, just a fabric or plastic/rubber strip with holes evenly spaced where you want the belt to stop. An IR sensor near your servo motor could sense when a hole comes by and cause the Propeller to stop the servo right there.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2006-10-18 23:06
    You could also put marks on the conveyor belt, and use an optical sensor to detect them. It sounds as if your belt is separated into zones or pockets. You could just have one mark per pocket, and program the Prop to stop when it sees the mark. If the belt will be used in a dirty industrial environment, holes would be better than marks, or even small magnets used with Hall-effect sensors or reed switches.

    -Phil
  • SomniumSomnium Posts: 46
    edited 2006-10-19 00:55
    umm... well... here's the thing... 9 out of 10 of them are evenly spaced... one is off... i'll do some more modifications and see what happens... i do have a photo resistor... mayb i cud try and use that somehow...
Sign In or Register to comment.