I was carrying out a problem in which I have a fully actuated two link manipulator, so with an independent servo motor for each link that allows rotation in one direction and another (positive for counterclockwise rotation and negative for clockwise rotation).
Let's assume we start from a certain initial condition and arrive at a final condition through a feedback control of the torques applied to each motor. To do this, a counter-clockwise torque is first applied to each servo, then a clockwise torque to "brake" (no dissipation) the system.
Assuming a time interval of 10 seconds, at each sampling instant (suppose it is 0.1 seconds) I have a different torque and / or angular velocity value (suppose we always have a positive angular velocity). Consequently, by projecting the $P = \tau \omega$ products, I obtain instant by instant the value of power generated by each motor.
Now, I have two doubts. The first one concerns the power value. Is it correct to obtain a negative power value, obtained by possibly multiplying a negative torque value for the angular velocity? Or should i consider the torque absolute value? And then, is it correct to calculate the total energy value as the integral between 0 and 10 seconds of the power curve?
Of course I know that the model is very approximate and I have not even presented the dynamics and kinematics of the manipulator in question, but I would simply like to have a clear idea of the concept of power and energy.