Shop OBEX P1 Docs P2 Docs Learn Events
Ramping mismatched servos — Parallax Forums

Ramping mismatched servos

tradisradtradisrad Posts: 2
edited 2007-05-06 23:25 in Robotics
Hi,
I am trying to ramp my servos to start from a dead stop and slowly bring it up to speed. the code I am using is

For pulsecount = 1 to 100
·PULSOUT 12,750 - pulsecount
·PULSOUT 13,750 + pulsecount
·PAUSE 20
Next
PAUSE 100
Return

the program ramps the servos nicely, but they are mismatched and do not ramp evenly sending the BOE BOT off of its course. The PULSOUT 12 needs to stop at a count of 681 to keep it in a straight line, where PULSOUT 13 is just fine to run to full speed. Also it would be nice if I could ramp the servos at an even speed, giving it a really straight run.
At this point I feel lost on what to do
Any suggestions?
Thanks
-Rob



·

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-04-20 16:37
    Rob,

    Have you tried calibrating the servos? If not I would try that. If these aren’t our continuous rotation servos with the adjustment screw your alternative is to make left and right constants for the center pulse value and add/subtract your offsets from that. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • PARPAR Posts: 285
    edited 2007-04-21 18:24
    tradisrad said...
    Hi,
    I am trying to ramp my servos to start from a dead stop and slowly bring it up to speed. the code I am using is

    For pulsecount = 1 to 100
    ·PULSOUT 12,750 - pulsecount
    ·PULSOUT 13,750 + pulsecount
    ·PAUSE 20
    Next
    PAUSE 100
    Return

    the program ramps the servos nicely, but they are mismatched and do not ramp evenly sending the BOE BOT off of its course. ...
    Rob, In addition to what Chris suggests, it sounds like your two servos·may not be operating over the same range of travel for a given number of pulses; and/or may not be operating in a strictly parallel linear fashion throughout their respective ranges of pulsing.
    If that's the case, then your problem of advancing both servos the same amount of distance will have to be adjusted dynamically throughout the loop (i.e., pulseout12 and pulseout13 would take on individual values and be pulsed at their respective individual times). Just which servo to adjust, and by how much, at each loop step would depend on the relative linearity and range of travel in going from stopped to full-speed.· You'd have to find out these characteristics of each servo (relative to the other) by trial and error testing and measuring. It might be quicker to find two servos that show the same behavior than to be able to characterize the ideosyncratic behavior of each individual servo. Or, it may be easier to build a sensor system of ongoing feedback to detect by how much you are off-track, and to correct the travel accordingly. It really depends on just what your requirements (tolerances for wayward travel)·are and how (badly/well)·your base system behaves in that context.

    And even after getting the servos to rotate/ramp at the same rate of travel, you still will have the problem of differential traction (e.g., slipping of one wheel)·and torque(?) (e.g., due to uneven load on the two wheels, and/or uneven ground under them)·to deal with.

    PAR

    Post Edited (PAR) : 4/21/2007 6:36:24 PM GMT
  • tradisradtradisrad Posts: 2
    edited 2007-04-22 15:33
    Thanks for the replies, a co worker also suggested ramping them each at a different rate. He suggested taking my min pulse width and max pulswidth and dividing it by the counter and using that value to ramp my servo, I tried his suggestion and was no too succesful-yet.
    To go in a straight line at full speed I need to PULSOUT 12,681 and PULSOUT 13, 850, so there is a big difference in the servos.
    I have had some success at using an IF/THEN/ELSE statement and limiting the counter on pin 12 to a certain count.
    I am doing this for a school project, I dont have to have perfection..
    Thanks again
    -Rob
  • DelloDello Posts: 1
    edited 2007-04-24 16:10
    In reading the comments on the mismatched servos,·doesn't parallax sell matched servos?
  • PARPAR Posts: 285
    edited 2007-04-25 07:29
    Dello said...
    In reading the comments on the mismatched servos,·doesn't parallax sell matched servos?
    Well, how matched is "matched"? They run on the same voltages, currents, are the same sizes, use industry-standard pulse width timing, have color-coded wiring -red, white, black, turn cw and ccw, and are priced accordingly.

    Now, even if the amount and rate of turning per given pulse width were "matched", the user would still have to sense and program for wheel slippage, wheel alignments, surface irregularies, etc.

    So, understanding various strategies for sensing and correcting for mis-matched wheel travel would still be needed. Because Parallax is offering a learning opportunity, their servos are perfectly matched with that objective.

    PAR
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2007-04-25 12:57
    I don't think you will ever find a matched set of servos.

    Matching a pair of servos is·generally not done by any manufacturer or vendor. The R/C servos depend on trim in the remote control to have a center position. The servo is designed for a certain tolerance of linear change.

    The simple fact is the manufacturers never really anticipated that servos could become a huge demand in small robotics; so they never have really addressed the problem. Other than Parallax full rotation servos, the majority are modified directly from R/C limited rotation servos. Parallax went to Futaba and had a special production run. These are probably as close to matched as one will ever get without paying a lot extra for sorting and testing.

    For truly in sync control without feedback, stepper motors are often used as there is little doubt that both motors move the exact same amount. But stepper motors may require more power. You still have variance due to wheels and ground flaws.

    Alternatively, there are several feedback systems that can keep rotation the same. One is a optical sensor and disk that attach to full rotation servos.

    As you can see, tracking 'perfectly straight' become an engineering problem with several alternative solutions.

    The best way is to have the bot fix on a distant target and work its way toward it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "If you want more fiber, eat the package.· Not enough?· Eat the manual."········
    ···················· Tropical regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • WarrlokWarrlok Posts: 77
    edited 2007-04-30 21:10
    probly best to buy a compas module and be done with it because encoders wont tell u if ur tires slipped

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Problems are the "roads" of life,
    solutions are only "onramps" to the next problem



    ············································· "Brad Smith"
    ·
  • D FaustD Faust Posts: 608
    edited 2007-05-06 23:25
    Correct me if I am wrong, but couldn't you put

    PULSOUT 12, 750 - ((69/100) * pulsecount)
    PULSOUT 13, 750 + pulsecount

    (After the first set of parentheses do you use brackets in PBASIC?)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    D Faust
Sign In or Register to comment.