A linear curve has infinite acceleration at each point of inflection. Infinite acceleration is physically impossible. Therefore, it is not possible to follow a linear curve exactly and smoothly. If you do not use feed forwards and decrease the gains, you will have smoother motion, but the axis will not track the profile exactly.

Usually, the best solution is to define a curve that specifies the acceleration when transitioning from one linear segment to another. For example, the cubic-interpolated curve below has some sections defined as constant velocity with connecting sections that are standard cubic interpolation. The curve has the Acceleration and Velocity lines turned on, so you can see exactly what the acceleration will be. This is very important when designing a curve so that you know you are making accelerations that the system can handle.