Make an acceleration/deceleration ramp : any ideas?


Closed Thread
Results 1 to 14 of 14

Hybrid View

  1. #1

    Question Make an acceleration/deceleration ramp : any ideas?

    Hi,

    I'm currently making a 3-phase VFD for an AC motor.
    The program is 70-80% done, but I've to make an acceleration/deceleration ramp.

    In other words, I start with a minimum value defined by the user (for exemple : 10), and I reach the maximum value defined by the user (for exemple 1200) linearly in x seconds (again defined by the user).

    Here an exemple :


    So any ideas how I can do that simply?
    -With a low-priority interrupt?
    -With a for...next loop?
    -etc.

    Thanks for your future help.
    Last edited by pxidr84; - 31st March 2011 at 18:38.

  2. #2
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    967


    Did you find this post helpful? Yes | No

    Default Re: Make an acceleration/deceleration ramp : any ideas?

    If you do not intend running any tasks in the background while doing the acc/deceleration, the following idea may work

    Code:
    Rate = ((Max-Min) *1000)/ Time   ' the 1000 is since I assume a mS time base
    Here the Time variable is specified in seconds.

    Now, using a 1mS time base, you can do this

    Code:
    for x = 0 to rate
       Output = Output + Rate  ' increase the output by a fraction we calculated
       pause 1           ' this is the 1mS time base I talked of
    next
    Rate could be -ve to decelerate.

  3. #3


    Did you find this post helpful? Yes | No

    Default Re: Make an acceleration/deceleration ramp : any ideas?

    Quote Originally Posted by Jerson View Post
    If you do not intend running any tasks in the background while doing the acc/deceleration, the following idea may work

    Code:
    Rate = ((Max-Min) *1000)/ Time   ' the 1000 is since I assume a mS time base
    Here the Time variable is specified in seconds.

    Now, using a 1mS time base, you can do this

    Code:
    for x = 0 to rate
       Output = Output + Rate  ' increase the output by a fraction we calculated
       pause 1           ' this is the 1mS time base I talked of
    next
    Rate could be -ve to decelerate.
    Hello,

    Thanks for your idea, I will try this into my program, but unfortunately I think that the "pause" command will make problems, because a lot of things are running in the background during this acc/deceleration (like the sine PWM generation high priority interrupt, using timer 1).

    I think use this in a low frequency and low priority interrupt (with timer 0), maybe the "pause" command will be useless?

    Note I'm using Darrel Taylor's interrupts.

  4. #4
    Join Date
    Oct 2005
    Location
    Pinckney, Michigan
    Posts
    91


    Did you find this post helpful? Yes | No

    Default Re: Make an acceleration/deceleration ramp : any ideas?

    My approach would be to generate the "points" you need for the line equation, given your slope and time parameters, in Excel. Then print a CSV file of the results, then copy the CSV file into your program as a table. It'll take some minor editing to generate your table but no big deal, and get the values from the table with Lookup or Lookup2. You can even change the slope of your ramp easily by adjusting the dwell time at each point, etc.

    I do this sort of thing a lot for thermistor temperature tables, etc. Saves the time of executing the extensive formula for thermistor values.

  5. #5


    Did you find this post helpful? Yes | No

    Default Re: Make an acceleration/deceleration ramp : any ideas?

    Can you give more info?

    What is the motor being used for?

    How does the user change the speed?

    Typical servo systems use a PID routine.

    Henrik Olsson posted a great PID program example on the forum. As I recall the thread mentioned motors and DT interupts.

  6. #6


    Did you find this post helpful? Yes | No

    Default Re: Make an acceleration/deceleration ramp : any ideas?

    I don't want to use a PID routine or a lookup table (because a lookup table is hungry of program memory space). It's a open-loop inverter.

    The user changes the frequency reference by turning a potentiometer connected to a ADCIN port.

    Exemple :

    Note the acceleration and deceleration ramp of the output frequency, that changes the speed of the AC motor.

    I like to have a routine (in a low-priority interrupt for exemple, to have the most accurate timings) that increments a value from the actual output frequency (for exemple 20Hz) to the frequency reference (for exemple 60Hz, defined by the user) in x seconds (for exemple 10 seconds, can be modified in real-time), and that without using any "pause" command (because my PIC has a lot things to do during this time).
    Last edited by pxidr84; - 1st April 2011 at 17:17.

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