Overspeeding of a serial robot near a singularity

This construction is part of the robotics course "Geometric Fundamentals for Robot Design" http://www.iri.upc.edu/gfrd The construction shows a 3R planar robot in its "elbow down" and "elbow up" configurations, shown in black and red, respectively. The robot is performing a polishing task along the shown elliptic path. Click the "play" button in the lower-left corner to activate the motion. Observe that when the end-effector approaches the horizontal position, there is a sudden increase in the speed of joints 1 and 3. This can be better appreciated in the right plots. The plots in the first column show the trajectory in joint space, projected in the Theta1-Theta2 and Theta1-Theta3 planes. Those in the second column show the time trajectories Theta1 = Theta1(t) Theta2 = Theta2(t) Theta3 = Theta3(t) The plots Theta1 = Theta1(t) and Theta3 = Theta3(t) show a sudden increase of slope (i.e., of angular velocity in joints 1 and 3) when approaching the singularity.
Note that the end effector is asked to move with a twist of the form [vox,voy,omega] = [0,a,0] when reaching the horizontal position. This is an impossible twist in the singularity of the arm. As a consequence, this twist yields very large joint velocities when approaching the singular configuration.