Closed SansoneG closed 1 year ago
@jschleicher @hslusarek I would like to discuss if we could skip the stop trajectory completely and let the firmware do the stopping. Then we would not need the acceleration limit, either.
I'm not sure if, the firmware offers a stopping command in the meantime. My latest information is, that "halt" does close the brakes and thus wears out the mechanics, which has only limited numbers of "STOP-0" cycles.
But if we abort the trajectory and stay on the latest position, the firmware will stop the movement asap without closing the brakes?
But if we abort the trajectory and stay on the latest position, the firmware will stop the movement asap without closing the brakes?
I'm not sure if I understand your suggestion correctly, because your suggestion will cause a massive jerk if the robot moved with full speed beforehand. For me, a strong/massive jerk does not sound good, especially with regard to the mechanical components of the robot. But maybe I misunderstand your suggestion?
But if we abort the trajectory and stay on the latest position, the firmware will stop the movement asap without closing the brakes?
I'm not sure if I understand your suggestion correctly, because your suggestion will cause a massive jerk if the robot moved with full speed beforehand. For me, a strong/massive jerk does not sound good, especially with regard to the mechanical components of the robot. But maybe I misunderstand your suggestion?
Yes, you understood correctly. But:
The joint values sent by the controller should obey the joint limits for both velocity and acceleration. That's what the configuration values are meant for.
But this issue is about planned trajectories that violate the acceleration limit in the controller - is there any connection to the stop trajectory, that I'm missing? Or is your suggestion independent from our current issue?
The joint values sent by the controller should obey the joint limits for both velocity and acceleration. That's what the configuration values are meant for.
But this issue is about planned trajectories that violate the acceleration limit in the controller - is there any connection to the stop trajectory, that I'm missing? Or is your suggestion independent from our current issue?
My suggestion is connected to the current issue, because I questioned the acceleration limit which was only introduced due to a poor stop trajectory. I know, I question a lot... But it is answered now. Thank you.
I know, I question a lot...
I think this is a good quality for a developer. :+1:
This is the desired velocity the controller produces from a PTP trajectory. You can see that the acceleration varies at the beginning:
I think the trajectories which are generated by the planner do not violate the limit. But through its interpolation routine the controller can slightly deviate from the intended trajectory.
I see possible solutions:
The first option sounds like a quick fix. So I'd prefer to increase the limit inside the controller by 5-10% for now. I'll add a PBI to determine the actual limits to achieve 250mm/s incl. the delay.
@SansoneG can you please elaborate on the original issue: You are in Auto mode, right? Then we should not care about the limits.
@SansoneG can you please elaborate on the original issue: You are in Auto mode, right? Then we should not care about the limits.
Yes, the behaviour was observed in AUTO mode. The acceleration and velocity limits imposed by the robot hardware should not be exceeded even in AUTO mode. I think this is what was meant here. But by planning a movement with seemingly accepted acceleration values, the controller stops the movement. That is the issue.
Yes, the planner planning a trajectory that not violates the limits is one thing. We use the speed override for this: https://github.com/PilzDE/pilz_robots/blob/81b2dff62e9142139850a58e718d13d5355cfb97/prbt_hardware_support/src/operation_mode_setup_executor.cpp#L43
But I think we do not evaluate the operation mode when checking the acceleration limit: https://github.com/PilzDE/pilz_robots/blob/81b2dff62e9142139850a58e718d13d5355cfb97/pilz_control/include/pilz_control/pilz_joint_trajectory_controller_impl.h#L326 We check it when evaluating the speed limit: https://github.com/PilzDE/pilz_robots/blob/81b2dff62e9142139850a58e718d13d5355cfb97/pilz_control/src/cartesian_speed_monitor.cpp#L91
I understand where you are coming from now. If I understand correctly we cannot simply ignore the acceleration limit in AUTO mode, because the acceleration limit also serves the purpose of not allowing crazy stop trajectories.
Yes, the planner planning a trajectory that not violates the limits is one thing. We use the speed override for this:
The purpose of setting the speed override to 0.1
is limiting the cartesian speed in T1. The acceleration limit is another matter. It should never be violated such that the hardware is not damaged.
The first option sounds like a quick fix. So I'd prefer to increase the limit inside the controller by 5-10% for now. I'll add a PBI to determine the actual limits to achieve 250mm/s incl. the delay.
The quick fix should work for now. Imho the time and effort we would spend in determining "good" limits (I think it is not straightforward) would be better invested in a proper solution.
The acceleration limit is another matter. It should never be violated such that the hardware is not damaged.
Okay, I got it. Thanks
For better understanding this picture shows the desired joint velocity of a single joint at the beginning of a PTP trajectory (Acceleration limits disabled).
The acceleration with which the trajectory is planned is exceeded in the first segment.
@jschleicher For the demo program we need more than 100% increase of the limit inside the controller. See https://github.com/PilzDE/pilz_robots/pull/442
LIN trajectory with acceleration scale 0.1
:
The oscillations shown above happen for LIN and CIRC.
I guess the crucial point is the computation of the velocities in the trajectory points. For PTP the velocities are obtained directly from the trapezoidal profile. Opposed to that, LIN and CIRC are planned in cartesian space, the positions are transformed via the inverse kinematic and the velocities are computed as follows: https://github.com/PilzDE/pilz_industrial_motion/blob/dd9b30aaaab9c3cdb4b524d4970dfeb91e48e62f/pilz_trajectory_generation/src/trajectory_functions.cpp#L290 Using these approximated values, the positions and velocities do not "fit together" very well which leads to the oscillations.
d values, the positions and velocities do not "fit together" very well which leads to the oscillations.
I am seeing similar oscillations of the velocity profile from a LIN planned trajectory. But evaluating the output-trajectories with the rqt_joint_trajectory_plot tool shows me, that the trajectories are clean before entering the joint_trajectory_controller.
After some investigation, i found this parameter. in the trajectory_generator.h. I increased the frequency by a order of 10, so sampling_time = 0.01 and the resulting velocity/acceleration trajectories become free of oscillations. I assume that the sampling_time of 10Hz is to low for a smooth interpolation of the joint-trajectory controller?
Unfortunately I did not find yet, where this parameter could be passed to the trajectorygenerator*, so it remains hard-coded for me at the moment.
Would be happy to get a feedback to this thoughts
Commit
cb782c272ee6
Steps to reproduce
How can the issue/bug be reproduced?
Expected behavior
Planning and Executing works without error.
Observed behavior
Planning works, but executing fails. The robot doesn't even start moving.
Logfiles
Reference to test
https://github.com/PilzDE/pilz_robots/blob/melodic-devel/pilz_control/test/acceptance_test_acceleration_limit.md