DT-Ints latency and other interrupt conciderations


Closed Thread
Results 1 to 40 of 59

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default

    Hi,
    I usually (well always) do it "by feel"....

    Leave I at 0 to begin with it, add P until you're starting to see severe overshoot or it starts to oscillate. When that happens start adding D to dampen it out. Once you dampened it you should be able to add some more P and then follow with even more D. Finally add I to get rid of any steady state error and increase the "stiffness".

    On my "developmemnt system" with a smalish (30W) DC-motor, 500 line encoder (2000cpr) and LMD18200 H-bridge I have P:1500, I:100, D:2000, Ti:1

    Remember that with very high gains there is a risk of overflowing the internal calculations (there's are no checks for that in PID routines). That would make the loop highly unstable and might cause the servo to run away. I'm not saying that is what is happening in your case, just that it's a possibility. It's also very imortant to set the output clamp to a proper value so you're not overflowing the PWM duty cylcle register.

    What's the resolution of your encoder?

    /Henrik.

  2. #2
    Join Date
    Dec 2009
    Location
    Kalamazoo
    Posts
    42


    Did you find this post helpful? Yes | No

    Default

    thanks for the reply. ill try your values. my encoder is only 100cpr on a yamamoto 24v motor, ripped off a photocopier machine. i have a bunch of other motors and encoders, upto 1500 cpr. does the cpr make a difference, other than more precision?
    NAG CON WIFE!
    WIFE VAR MOOD

  3. #3
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default

    Yes, it makes a hugh difference. Think about it...what if you only had four counts/revolution, then the motor could move 90 degrees without the system even knowing it. Same motor same settings but now with a 2000 counts/rev (500 lines) encoder, the 90 degree displacements now results in an error of 500 counts. This give the servo-loop a lot more "information" to work with which helps in stabalising the loop.

    If that is a 25 line encoder (100cpr) then that may be a big part of your problem. Trying 'my' values with that motor/encoder probably isn't going tp help you one bit. If possible try with a higher resolution encoder.

    /Henrik.

  4. #4
    Join Date
    Dec 2009
    Location
    Kalamazoo
    Posts
    42


    Did you find this post helpful? Yes | No

    Default

    oh no.. the encoder is 100 lines per revolution, giving a quadrature resolution of 400 cpr.

    ill try the 1500 lines per revolution, thats 6000cpr! anyway, ill experiment with all the encoded motors that i have. thanks
    NAG CON WIFE!
    WIFE VAR MOOD

  5. #5
    Join Date
    Dec 2009
    Location
    Kalamazoo
    Posts
    42


    Did you find this post helpful? Yes | No

    Smile Finally, success!!!

    after much troubleshooting, i finally found my mistake. i forgot that the pwm module has always been running at 20khz.

    i changed that to minimum allowed for 40mhz operation, which is 2.5khz, and the servo is running like a dream. thanks for all the ideas and tips.

    im starting a ac servo thread, since i got the dc servo going , and i hope ill get the same help and ideas.

    thanks guys.
    NAG CON WIFE!
    WIFE VAR MOOD

Members who have read this thread : 2

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts