Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Calculating peak velocity

  1. Nov 7, 2011 #1
    I am trying to program some motion control devices which have trapezoidal motion profiles to define a move. I can define the slewing(peak) velocity, accel/decel rates and distance to travel, the the hardware moves a motor the appropriate distance with the parameters given.

    I need to be able to define a specific amount of time that a move will last, and calculate what the peak velocity should be when all other factors are known. Starting velocity is not always zero, but ending velocity will always zero for my purposes. The move will always be trapezoidal.

    I have an equation for defining the distance traveled when all other factors are known, but I need to isolate the peak velocity to one side of the equation and I am not sharp enough at this math to be able to solve for the peak velocity. Any help would be greatly appreciated.

    d = total distance traveled
    t = total time
    AC = acceleration
    DC = deceleration
    Vi = initial velocity
    Vs = slewing (peak) velocity
    Vf = final velocity

    I have this equation which I believe is correct. I need to isolate Vs to one side:

    d = [(Vs+Vi)/2]*[(Vs-Vi)/AC] + [(Vs+Vf)/2]*[(Vf-Fs)/DC] + Vs*[t-((Vf-Vs)/DC)-((Vs-Vi)/AC)]

    I was advised to put it in quadratic form and isolate the Vs but I have found that very difficult. Please help me solve this!

  2. jcsd
  3. Nov 7, 2011 #2
    First here is a slightly cleaner way of presenting your equation
    d = \frac{Vs^2 - Vi^2}{2AC} + \frac{(Vs + Vf)(Vf - Fs)}{2DC} + Vs ( t - \frac{Vf - Vs}{DC} - \frac{Vs - Vi}{AC} )
  4. Nov 7, 2011 #3
    I then plugged this into Mathematica, the result seemed a bit hairy to type out here so I've attached it as an image.
  5. Nov 13, 2011 #4
    Dear JHamm,

    Thank you so much for doing that for me... although I screwed up an would ask you or someone else to plug this equation back in to Mathematica for me. I realized when trying to apply the equation you gave that I had included a typo in my original post. There is in fact no "Fs" variable, that was supposed to read "Vs". I have provided the corrected equation below. If you could re-run it for me as soon as possible I would greatly appreciate it.

    Thanks much - Lars


    d = [(Vs+Vi)/2]*[(Vs-Vi)/AC] + [(Vs+Vf)/2]*[(Vf-Vs)/DC] + Vs*[t-((Vf-Vs)/DC)-((Vs-Vi)/AC)]

    (sorry I tried to put it in to the MathJax format but I couldn't seem to get it to work...)
    Last edited: Nov 13, 2011
  6. Nov 13, 2011 #5
    Here is the new solution, hope it works out this time :)

    In case you were interested PhysicsForums' servers run a Latex package which allows you to format mathematical expressions, there's a quick guide here - https://www.physicsforums.com/misc/howtolatex.pdf

    Attached Files:

  7. Nov 13, 2011 #6
    Great! Thanks so much. I'll take a look at the guide.
  8. Nov 13, 2011 #7
    Could I trouble you once more? I would like to see (Vs) solved for using just a portion of the equation, leaving off the deceleration period (the middle portion of the first equation):

    d = \frac{Vs^2 - Vi^2}{2AC} + Vs ( t - \frac{Vf - Vs}{DC} - \frac{Vs - Vi}{AC} )

    and then using only the acceleration portion:
    d = \frac{Vs^2 - Vi^2}{2AC}

  9. Nov 14, 2011 #8
    No problem :)
    For the first one...

    And for the second...

  10. Nov 14, 2011 #9
    Thanks! One more question :)

    In the original equation you posted there is what I interpret as a Square Root symbol right about in the middle of the equation. I read this as if it extends to the end of the equation from there, based on the placement of parentheses.

    In the new results you posted the square root symbols extend graphically over the portion of the equation that they are meant to cover. Is this just a quirk in the graphical output of Mathematica, or am I reading the first equation wrong?

  11. Nov 14, 2011 #10
    I would take it as a quirk, it seems as though if the expression becomes too long it will just use parenthesis instead :)
  12. Nov 14, 2011 #11
    OK great, I will proceed accordingly. I have plugged the original equation in to the motion control software I'm using, and I immediately see a problem. If AC = DC then I get a division by zero error, because the first item in the equation [ 1/2(ac-dc) ] will always equal zero if AC(acceleration) is equal to DC(deceleration), which is often the case.

    I will need to set up my code to check and see if AC=DC, and if it does I will need to use an alternate equation. Would you mind running the original equation one more time for me, except replace all the DC variables with AC. I think this will get me what I need and keep the division by zero error from occurring.

    Thanks again!
  13. Nov 14, 2011 #12
    No problem mate :)


    Hope everything works out for you :)
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Similar Discussions: Calculating peak velocity