Effect of Flexibility of Driving Shaft on the Dynamic Behavior of a Cam Mechanism