The robot, endowed with pen, reproduces in real time on paper the movement acted by the pen on the tablet. The Wii Remote Controller has been used for the generation of the orientation references for the utensil tern, whose origin is fixed in comparison with the basic tern. 
Furthermore, when used as a remote control, it manages the passage between the two operation modalities: writing on tablet andmoving controlled by Wii Remote. To be able to realize this application, the followings modules have been implemented:
Supervisor: this module, developed as a state diagram in Stateflow® implements the of state transition logic of the system. In answer to the asynchronous events produced by outside (i. e. pressure of the buttons on the Wii Remote or on the tablet). The acquisition of external signal are realized through mailbox by a task soft realtime, the module answers with an opportune transition of state;
Inverse Closed Loop Kinematics (CLIK): this module implements the algorithm of inversion kinematics;
Trajectory Generator: this module produces the trajectory (in the operational space) starting from the references imposed by the acquisition devices by means of non-linear filtration techniques; The trajectory is brought to the joints space through the CLIK modules;
Direct kinematics: this module, which implements the manipulator direct kinematics, is used at the initial step of the algorithm to get position and initial orientation of the manipulator starting from the initial position in the joints space; these variables are actually used to initialize the integrators of the CLIK and the non-linear filters of generation of the trajectory;
Preconditioning of the signal: this module, further to carry out the preliminary operations of the algorithm deals with the unitary quaternions made out the readings of the positions of the joints coming from the sensor.