One of our programming teams post-season goals (yes post-season ) is to start using motion profiling. I wrote a motion profile generator in labview which utilizes the “Copioli” method (Motion Profile Generater-Demo.vi (28.4 KB)). I directly copied the math from the excel spread sheet released by CTR electronics (Motion Profile Generator.xlsx (148 KB)) and it appeared to work fine. However, in some specific situations the profile generator either fails to get to the location as fast as it could (acceleration maxes out at a value below the specified max acceleration) or it doesn’t get to the location at all. I thought this was a problem with how I copied the math but I put the same inputs in the spread sheet and got the same incorrect results. I also checked my math using a different spread sheet which uses the same method (Motion Profile - Copioli Method-2.xlsx (18.6 KB)) and I got the same results. Images of the profile failing to get to the target are attached. Please note I changed the inputs so instead of inputting T1, T2 you can input max acceleration and max jerk into the vi.
Hi Ryan,
The spreadsheet in our example also uses the Copioli Method *, so it follows that you get the same generated results.
It’s not clear what you’re observation is. Are you saying the generated profile doesn’t match your expectations? If so, exactly what is wrong with the generate profile screenshots that you attached? Those plots seem reasonable at first glance.
…Or are you saying the physical motion of the mechanism isn’t matching your expectations? If so the specified cruise-velocity/acceleration may need to be tweaked, or gains need to be adjusted to better honor the generated target profile.*
The issue is that the motion profile results in a final position of 1.7956 instead of the target final position of 4. Look at the attached images, the position line in the spreadsheet and the vi both don’t end up at 4. I’m assuming that if this motion profile was used on a motor the motor would end up turning just 1.7956 units instead of 4, because the position line is effectively just calculated by integrating the velocity line and the position and velocity arrays are the only pieces of data used to control the motor, but I haven’t tested it.
Looks like the problem is T1 is bigger than T4, and the generator isn’t meant to know how to handle reducing the peak of the velocity curve.
To confirm this, first set T2 to ‘1’ to remove the s-curving. This gives us a trapezoid. You can bump this up later to put s-curving back.
Next look at T4. T4 is dist/vprog => 4 rot / 3rps => 1333ms. If you set T1 to this the trapezoid reduces to a triangle, meaning we don’t spend time any time at a velocity of vprog.
Now keep increasing T1, the generator doesn’t know to add more time to the profile to make up for the loss in area due to the reduction in max-velocity (peak of the triangle). That’s the limitation.
To work around that limitation, reduce Vprog to be at or below what’s actually possible based on where the Velocity curve is now (peaks at about 2.5rps).
It boils down to make sure the specified vprog is obtainable. Changing T1 means changing the time between zero-speed and vprog-speed.
The issue with that method is that I want to generate profiles in real time which have a set max acceleration, velocity, and jerk. That method offers too little control.
Also try this.
Thanks! That seems to work. I’m assuming all you just added “max vel adj” and made that the max velocity input. However, there is another issue. The same type of adjustment must be made to acceleration. Otherwise if you increase acceleration beyond what is possible to reach some issues occur. Specifically the acceleration maxes out way below what the maximum actually is. I am uncertain how to determine what the maximum possible acceleration should be.
It boils down to make sure the specified vprog is obtainable.
Yes, ether’s solution seems to make sure that that happens.
To give credit where credit is due: The online spreadsheet at the link I provided is the work of Jared Russell; an adaptation I believe of Paul Copioli’s original spreadsheet.