velB = (sin(mill ) + 0.1) * 0.1; // generate sine wave for motor velocity with an amplitude of 0.0 to 1.0
velB = velB * 15; // map sine wave to analog values ( 0.0 … 1.0 ⇒ 55 … 255 )
velA = (sin(mill ) + 0.1) * 0.1; // generate sine wave for motor velocity with an amplitude of 0.0 to 1.0
velA = velB ;
What the heck? You waste time calculating a new value for velA using the same formula as for velB, and then assign velB to valA. Why on earth would you do that?
It would seem to me that on the second cycle, you'd want to use mill - the time that the cycle takes as the input to sin(), not mill.
The sin() function takes a value in radians, between 0 and 2PI. After mill exceeds 2PI, sin() takes longer because it needs to adjust the input value to be between 0 and 2PI.
Print put some key values to see what is happening.