Motion profile generator.


Closed Thread
Results 1 to 40 of 56

Hybrid View

  1. #1
    Join Date
    May 2013
    Location
    australia
    Posts
    2,680


    Did you find this post helpful? Yes | No

    Default Re: Motion profile generator.

    this works on the real servo motor. what a difference the qei module makes ,and 14 bit pwm seems much smoother
    pid rate now 1ms ramp rate 8ms with 49 steps , no attempt yet to handle short moves but long ones are good . fwd and backwards moves are good .
    pos counter 24bit / vmax and accel are fixed constants so far
    Attached Files Attached Files

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,622


    Did you find this post helpful? Yes | No

    Default Re: Motion profile generator.

    Hi Richard,
    I've actually made some progress myself too, just for fun I'm attaching a photo of my little testbed. It was designed a long time ago, at the time I was Little "afraid" of the PCPWM module so it's actually using the normal CCP module for the PWM output, 19.531kHz, 10bit resolution. What PWM frequency are you using to get 14bit with the PCPWM module?

    Name:  Testbed.jpg
Views: 1269
Size:  237.4 KB

    Anyway, my code seems to work pretty good in the real world too. PID-rate is 1220Hz (derived from the PWM time base, 1:16 postscale). Initially I tried to run the profile generator "slower" than the PID but it really didn't want to fly properly. Now it's updating at the same rate as the PID and it's working pretty good. The CPU load is pretty high during deceleration but I'm "only" running it at 20MHz on this board so at 40MHz it'll be more relaxed. Acceleration, velocity and distance can be set arbitrarily.

    Time is limited and motivation to work on it comes and go but I'll keep poking at it.

    /Henrik.

  3. #3
    Join Date
    May 2013
    Location
    australia
    Posts
    2,680


    Did you find this post helpful? Yes | No

    Default Re: Motion profile generator.

    yes noise is an issue for 14 bit its 1.8khz , much quieter at 16khz and 10 bit res fosc is 32mhz (8meg rock *4pll)

    I need to make a better test bed 600ma from the l293d is a bit limiting .

    got the pid routine under 500us worst case using floats . I find that floats are easier to work with (mentally) for experimenting with but will go back to ints when I have things sussed out.

    I'm not sure how I will go about implementing variable velocity or accel yet. I was just really happy to get " pid lock " and good position control to start with.

    ps using the microchip c floating point library adds 8k bytes to the pgm its huge
    Last edited by richard; - 18th October 2014 at 15:52.

Similar Threads

  1. Motion Capturing
    By koossa in forum Off Topic
    Replies: 0
    Last Post: - 30th June 2009, 12:05
  2. Suggest a motion sensor Please
    By sougata in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 4th March 2007, 14:22
  3. Wireless Motion Sensors.
    By koossa in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 17th October 2006, 22:57
  4. Need low Profile LCDs
    By Foxx373 in forum General
    Replies: 8
    Last Post: - 26th October 2005, 18:33
  5. Motion Tracking
    By JEC in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 5th November 2004, 01:58

Members who have read this thread : 0

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