Sign in to follow this  
Followers 0
mmervenne

Programming a Trapezoidal Move Profile

3 posts in this topic

Hello all, I have a piece of material handling motor which is driven by a VFD, with position feedback from a laser. I am controlling the speed of the motor with an analog output to the VFD. I am using RSLogix 5000. I am trying to program a trapezoidal move profile. Once I receive a new Destination position and before I start the move, I calculate the following with a one shot: 1. My Current Position as the Move Start Point. 2. The difference between my current position and the destination position as the Total Move Distance. 3. Add or subtract the Total Move Distance/2 to find the move Halfway Point. 4. AccScale and DecScale are constants I am currently accelerating when my current position is less than the Halfway Point and decelerating when my current position is greater than the halfway point. I clip the output to 60 Hz if it calculates to greater than that. Deceleration works beautifully, my problem is with the acceleration. For the acceleration I am using the (Distance moved from Start Point)*AccScale. The problem is that at the beginning of the move, I have moved 0", which gives me 0 output. To get the move started, I am currently moving 5 hz to the analog output anytime the speed reference is less than 5hz. Is there a better way to do this?

Share this post


Link to post
Share on other sites
Hello man, Without putting much thinking on this, my suggestion is: Since you know the distance you're going to move, the acceleration rate and the initial speed, then you know the final speed: V1 := SQRT(V0**2 + 2*a*(d1-d0)); Where: "V1" is the final speed "V0" is your initial speed "a" is the acceleration "d1" is your final position "d0" is your starting position Once you have this, one way to reference your VFD could be: Start a timer, and: VREF := V0 + a*TIMER_01.ACC; Where: "VREF" is your reference to the VFD "TIMMER_01" is a timer Once VREF equals V1 you're done Surely you will want to limit your reference to a maximum and reset the timer when done Hope this helps Edited by chantecler

Share this post


Link to post
Share on other sites
Your approach sounds like it's working, but here's another idea. I used a VFD for a positioning application once, and I combined both methods mentioned above to make things work. I had to set the accel/decel parameters on the drive to zero and program that into the PLC. I used a timer like chantecler suggests for both accel and decel. Any time my target speed changed, I would increase or decrease the actual speed command to the VFD by a set amount every 100ms until I reached the target speed. The amount of increase/decrease depends on your application. This method worked for manual operation (jog) as well as auto. For the actual positioning, I controlled the target speed based on distance to destination, similar to your method. But I didn't bother with a calculated accel ramp, since the timers were already doing that. Here's a sample calculation: Distance = Destination - CurrentPosition TargetSpeed = Distance * RampScale If TargetSpeed > MaxSpeed Then TargetSpeed = MaxSpeed When starting a move, the distance was typically long enough to max out the speed, but the timer code would ramp up slowly. Then as I got closer to my destination, the speed would ramp down. Note that I had both the above calculation and the timer code both trying to ramp down. I had to make sure that my calculated target speed decreased MORE SLOWLY than the timer code would decrease it in order to avoid overshooting my destination. If you have no need for manual jogging, then you can simply eliminate the decel timer and only use the accel timer.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0