{'fraction_non_alphanumeric': 0.026878548779588524, 'fraction_numerical': 0.006267974338175651, 'mean_word_length': 4.781200042630289, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Intelligent Robotic Handling of Fabrics Towards Sewing

Handling of flexible materials is one of the most challenging problems that have arisen in the field of robot manipulators. Besides the difficulties (e.g. geometrical uncertainty, obstacle avoidance, etc.) that emerge when handling rigid materials using robots, flexible materials pose additional problems due to their unpredictable, non-linear and complex mechanical behaviour in conjunction with their high flexibility and high bending deformations. The fact that sewing fabrics is a “sensitive” operation, since fabrics distort and change their shape even under small-imposed forces, poses barriers in the development of automated sewing systems. On the other hand, the need for great flexibility in garment assembly system is really imperative, since cloth manufacturing should cope with the fast fashion changes and new materials for fabrics and responding to the consumer demands. Our research efforts are focused on the development of intelligent control systems with multi-sensor feedback, enabling robots to perform skillful tasks in realistic environments towards higher flexibility and automation. In this work, the robot control approaches based on artificial intelligence for handling fabrics towards feeding in the sewing machine are described in detail.


Introduction
Handling of flexible materials is one of the most challenging problems that have arisen in the field of robot manipulators. Besides the difficulties (e.g. geometrical uncertainty, obstacle avoidance, etc.) that emerge when handling rigid materials using robots, flexible materials pose additional problems due to their unpredictable, non-linear and complex mechanical behaviour in conjunction with their high flexibility and high bending deformations. The fact that sewing fabrics is a "sensitive" operation, since fabrics distort and change their shape even under small-imposed forces, poses barriers in the development of automated sewing systems. On the other hand, the need for great flexibility in garment assembly system is really imperative, since cloth manufacturing should cope with the fast fashion changes and new materials for fabrics and responding to the consumer demands. Our research efforts are focused on the development of intelligent control systems with multi-sensor feedback, enabling robots to perform skillful tasks in realistic environments towards higher flexibility and automation. In this work, the robot control approaches based on artificial intelligence for handling fabrics towards feeding in the sewing machine are described in detail.

State-of-the art and Related work
The cloth manufacturing is one of the less automated industries, compared with other industries such as automotive, computer etc. The main reason for this delay is the high bending flexibility of the fabric in changing its shape when it is handled. The high versatility of the fabric size, type, shape and their material characteristics increase the difficulties for the introduction of flexible automation in cloth making industry. The automatic systems that are up-to-date available, are characterized by high specialization, minimal programmability, limited flexibility to changes and require human intervention to accommodate different sizes and fabric types. The fabric handling operations in the clothing industry can be divided in the following classes: separation, grasping, translation, placing, positioning, feeding and sewing. A lot of research has been done in the fabric acquisition using robotic grippers (Taylor, 1990;Monkman, 1996;Koustoumpardis & Aspragathos, 2004). While few researchers have worked on the automatic feeding of fabrics into the sewing machine.
In the sewing process, two robotic handling tasks (Gilbert et.al., 1995;Koustoumpardis & Aspragathos, 1999) require sophisticated control. The first one deals with the manipulation (translation and orientation) of the cloth and the second one with the control of the cloth tension. A method for the manipulation of various fabric shapes was introduced (Torgerson & Paul, 1988) using visual information. The determination of robot motion paths is based on visual feedback defining the location of the fabric edges in world coordinates. The developed algorithm was used for handling both polygonal and non-polygonal shapes, whereas the accuracy of the approximation to the desired seam line depends on the camera resolution. However, this algorithm is based on geometrical computations, which has to be done manually for each fabric shape. In addition, the algorithm has been constructed ignoring the buckling or wrinkling that appears during fabric handling. The first advanced robot sewing system reported by Gershon & Porat (1986;) is the FIGARO system, where an integrated robotic system for sewing has been developed. In the FIGARO system, the following components are integrated: a robot manipulator endowed with a two-fingered end-effector, a sewing machine, two miniature CCD cameras mounted on the sewing machine and a force sensor mounted on one of the two fingers. For the fabric tension control an estimated cloth velocity was used based on the sewing machine shaft encoder and a correction to this estimation was computed by a proportional-integral controller in order to derive the robot velocity. The gains of the controller were adjusted by trial and error, which should be modified for a new type of fabric (Gershon, 1993). With the fabric tension control the buckling of the fabric was prevented and good seam quality was obtained. A parallel process decomposition of the robot-sewing task was proposed (Gershon, 1990) to address the problem of robot sewing. A robot arm manipulates the fabric towards the desired orientation and control the fabric tension during the sewing process. The sewing task was decomposed into four concurrent processes within a superposition parallel architecture. The controlled system is modelled as: a mass-spring-damper model for representing the robot's equivalent dynamic behaviour, a nonlinear damped spring for the fabric, whereas the table friction acting on the fabric is included in the model. The performance of sewing is decomposed into straight line seams and seams that follow the edge contour. The complete system demonstrated robustness in the experiments. After FIGARO system, an automated sewing system coordinating two robots handling the fabric on the table has been developed (Kudo et al., 2000). On top of robot hands coordination, fabric tension control and synchronization with the sewing machine speed were considered. Visual information was used to control seam path and its deviation from the desired trajectory through a CCD camera mounted on the sewing machine. Sewing experiments were carried out for a straight-line trajectory using pressing force control, fabric tension control and fabric position manipulation control. The experiments have been extended to seams that follow curved-line trajectory using coordinated position/force control. Extended experimentation under a wide variety of sewing speeds, panel contours, number of plies and fabric type proved the effectiveness and the robustness of the developed system. As far as artificial vision for the control of the manipulator is concerned, the visual servoing systems are based on two main approaches: position-based and image-based visual servo control (Hutchinson et al., 1996). In the position-based control systems, the error is Intelligent Robotic Handling of Fabrics towards Sewing 561 computed in the 3D Cartesian space. The position error is computed using or not the model of the target depending on the visual features available in the image. The main advantage of this approach is that the camera trajectory is directly controlled in Cartesian space. However, this approach has the limitation of being sensitive to calibration errors that arise either from a coarse calibration of the camera or from errors appeared in the 3D model of the target. In the image-based control systems, the error is directly computed in the 2D image space. The main advantage of this approach is that there is no need for the 3D model of the target and it is quite robust not only with respect to camera but also to robot calibration errors. However, the Jacobian matrix is a function of the distance between the camera and the target, which is not easily calculated and this is a serious limitation of this model-free control approach. A combination of the previous two approaches is used in the 2 1/2 D visual servo systems, where the error to be minimized is specified both in the image and in the pose space. This method avoids their respective disadvantages: contrarily to the position-based visual servoing, it does not need any geometric 3D model of the object. In comparison to the image-based visual servoing, it ensures the convergence of the control law in the whole task space. For the most of the handling tasks and essentially in sewing, the cloth must be held taut and unwrinkled. The seam quality is extremely sensitive to cloth tension variations appeared in the sewing process. These undesirable tension variations affect the product quality. The difficulties are more evident when the seam is performed along the cloth bias, due to the increased fabric extensibility. Gershon (1990) justified the need of force feedback control in order to fulfil the above fabric's tension requirements. Furthermore, he underlined that the conventional control methods are inadequate to handle a fabric tension problem due to the fabric nonlinear behaviour, the noisy cloth tension signal, etc. Therefore, it is vital to develop more sophisticate and intelligent control methods. Stylios (1996) reported that the intelligent behaviour can be expressed in terms of sensing, processing, actuating, learning and adapting without any previous knowledge about the properties of the object that the human is handling. To apply this approach in robot handling task, control systems based on Neural Networks should be designed. The ability of Neural Networks to work without having any previous knowledge of the controlled system behaviour and their ability to learn from examples and to adapt as they modify themselves during the training phase, incorporate the human like behaviour in handling of non-rigid materials. The Neural Networks and Fuzzy Logic benefits have been used in apparel industry (Stylios & Sotomi, 1996) and especially in gripper's design for fabric handling (Tsourveloudis et.al., 2000). The objective of the present work is the development of a robotic system for handling of non-rigid materials lying on a working table. The work is focused on the handling of flexible materials lying at a random location and orientation on a table and guide them towards the sewing needle and along the "seam line", as well as on the control of the appropriate tensional force in order to maintain constant high seam quality. The handling strategies are developed for fabrics of various shapes (convex, non-convex, with straight and curved edges). A robot fuzzy controller is presented, for guiding the fabric towards the sewing needle, where the fuzzy rules are derived by studying human sewing. Our goal is to design a robust controller, which autonomously determines the motion of the robot avoiding special geometrical computations and independent of the fabric's shape. The appropriate velocity of the robot end effector in the sewing process is regulated by a Neuro-Controller. Likewise, the appropriate tensional force applied to the fabric is determined by the developed Fuzzy Logic decision mechanism.

The robotized sewing problem
A scheme of the concept and the experimental layout of the sewing process are illustrated in Fig. 1. The sewing machine pulls the the fabric with the machine velocity, while the robot endeffector has to follow with the robot velocity, while manipulating and applying a recommended tensional force to the fabric. The gripper contact with the piece of fabric is performed through rubberized ends that press slightly the fabric on the sewing table as it is shown in Fig. 1. The force sensor mounted on the robot end-effector measures a tensional force when the distance between the two acting points of the velocities is greater than the free length of the fabric, or measures a compressive force when this distance is less than the free length of the fabric. The first case occurs when the sewing machine velocity is greater than the robot end-effector velocity so the fabric is extended, while in the second case, the robot velocity is greater than the machine velocity and then the fabric is compressed. For obtaining pucker-free seams a constant tensional force should be assured. The fabric characteristics and properties have to be taken into account in an automated robot sewing system. The appropriate tensional force depends on the fabric properties (Koustoumpardis & Aspragathos, 2003) while its variations during the sewing process affect the seam quality. Thereby, the fabrics have to be recognized into categories (knitted, woven etc.) depending on their physical properties. Another important factor that should be considered is the shape of the fabric, which can be convex or non-convex, with straightand/or curved lines. It can be concluded that an automated sewing system demands a classification of the fabrics into various categories as well as a preliminary scheme of the optimum path the robot should follow in order to produce the desired stitches. In the proposed sewing system, these demands have been taken into account for the design of a hierarchical control scheme. The target for this robot controller is the guidance of the robot to apply a constant tensional force while the robot end-effector manipulates the fabric in the sewing process.

Pre-sewing tasks
The fabric handling tasks for cloth sewing are ply separation, placement on the working table, manipulation towards the sewing needle and fabric's tension control during the sewing process. For the tasks "ply separation" and "placement on the working table" work has been done on the design of a robotic air-jet gripper for destacking fabrics (Zoumponos & Aspragathos, 2004) and the placement of fabrics on a working table (Zoumponos & Aspragathos, 2005) where a fuzzy motion planning was developed to control the robot. After the fabric has been placed at a random location on the working table, a number of sub-tasks should be performed before the sewing process starts. These preliminary sub-tasks are: 1. The recognition of the fabric's shape. The camera captures the image of the fabric piece lying on the working table free of wrinkles before the robot end-effector touches the fabric. The shape (convex or non-convex, with or without curvatures) and the location of the fabric are identified and is used as the reference shape, while the piece is handled by the robot. 2. The edges that will be sewed. There are two main kinds of stitches: those ones that are performed in order to join two parts of cloth together and others that are performed for decorative and aesthetical purposes (e.g. in the pockets of trousers and shirts). However, there are parts of cloths, where both types of stitches should be conducted. For example, if the fabric piece is a pocket, all edges, except for one, should be sewed and there are decorative stitches should be added. The information of the stitching lines on the fabric and the type of the stitches is taken from a CAD system where the cloth has been engineered. 3. Planning of the sewing process. The best sequence of the seam segments is determined before the sewing process in order to reduce the cycle time of the sewing. The optimum sequence can be found using Genetic Algorithms  and this is the next step after the stitching lines have been determined. However, one should keep in mind that some stitches have antecedence in relation to others. In the previous example, the stitches that serve aesthetical purposes should be performed before the pocket is sewed onto the trouser part. 4. The extraction of the "seam line". The sewing process will be performed on a "seam line" situated inside the fabric edges. Since the fabric edges are extracted from the image taken from the camera, the "seam line" is situated some millimetres inside the fabric's outer line. For the straight lines, the "seam line" is found by transferring the outer lines inside the fabric and the intersection of these lines constitute the vertices of the "seam line". Consequently, the "seam line" is parallel to the outer edge and the distance between the outer edge and the "seam line" is determined, since it is different for different parts of the cloth. For the curved lines, the process of determining the "seam line" is similar to the aforementioned process, since the curve has been approximated by a polygon. The distance between the outer edge line and the "seam line" depends on the cloth part that is going to be sewed and is defined by the clothing industry manufacturer. The system is capable of automatically extracting the "seam line" after the outer edges have been defined. It is clear that this distance is greater for a part from a trousers' leg than a part from a shit's sleeve. 5. The initial position of the end-effector. The fabric lies on the table at a random location with a random orientation and the end-effector has to move towards the fabric and touch it so that it can lead it towards the sewing machine. The problem of determining the critical buckling length L c between the front edge and the end-effector location (see Fig. 2(a)) in order to avoid the buckling of the fabric has been investigated by Gershon & Grosberg (1992). In Fig. 2(b), the fabric buckling is illustrated when the initial length is larger than the critical one. Therefore, the robot gripper should touch the fabric at a distance from the front edge equal or shorter than the critical length in order to prevent the buckling. It has been investigated and concluded (Koustoumpardis & Aspragathos, 2003) that the appropriate position of the end-effector on the fabric depends mainly on the fabric type and its flexibility. A fuzzy decision mechanism is used as shown in Fig. 3. The term "flexibility" represents an index, which is estimated by an expert specifying a flexibility degree between 0-100%. The determined values of the critical buckling length L c are not strictly restrictive. This length can be equal or smaller than that determined using the Fuzzy decision mechanism, since the critical length L c is the maximum permissible. The cases that smaller length must be used are determined by the geometric limits of the work cell components and their layout. For example, when the robot manipulator used in sewing has a maximum reach smaller than the derived by the Fuzzy mechanism, then the initial length L can be smaller than the critical one in order to meet the physical constrains of the robot. However, in the case of handling small pieces of fabric, the position of the end-effector should be such that the covered area of the fabric be the smallest to facilitate the identification of the piece by the vision system. After the execution of the above five preliminary sub-tasks the sewing process can be started. Throughout the sewing two main tasks are investigated and respective robot control algorithms are developed for the manipulation (translation and orientation) of the fabric and the regulation of the fabric's tensional force.

Manipulation of fabric
The proposed system is a combination of image-based and position-based control system. The image-based analysis is used for the identification of the fabric's shape. After the image acquisition of the fabric, the features (vertices for the straight edges and dominant points for the curved edges), the needle-point and the sewing line's orientation are derived from the image analysis. The position of the needle is known in the robot coordinate system too. The position of the end-effector on the fabric is random, but is subject to the constraints discussed in the previous section. This position is unknown in the image coordinate system; however, the robot system gives feedback of the current position of the robot in the robot coordinate system and the robot end-effector is now referred to the robot base system. Moreover, the relation between the robot-and the image-coordinate system is known from the calibration of the camera. For the manipulation of the fabric towards the needle, the image based-approximation is used, since both the distance and the orientation of the movement are known in the image coordinate system. For the rotation of the fabric around the needle, the rotation angle is computed in the image coordinate system, but for the rotation of the robot end-effector around the needle, the needle-position relative to the robot base is used.

Sewing fabrics with straight edges
Fabrics are limp materials that present a rather unpredictable behaviour during handling.
Since the fabric bending rigidity is very small, when the gravitational forces are applied to a piece of fabric its shape changes completely. Therefore, sewing the fabric using a robot is not easy due to the wrinkling, folding and buckling. Since fabric's shape is considerably changed, the handling of fabrics is performed onto a work table to ensure a kind of rigidization. However, it is possible that wrinkles will appear in robotic handling of fabrics lying on the table.
Since the fabric has been laid at a random location on the work table, the end-effector is placed at a proper position on the fabric, so that buckling problems are eliminated. At this point, the robot sewing process is ready to start. The sewing process consists of three subtasks: the manipulation of the fabric towards the needle, the sewing of the edge and the rotation around the needle which are described in the following: 1. The manipulation towards the sewing needle. The manipulation of the fabric is performed by properly translating and orientating the end-effector guiding the fabric. The "seam line" are determined on the fabric shape identified by the vision system. In Fig. 4, the robot is going to guide a sleeve towards the sewing machine in order to sew all its edges. The distance (r) between the current position of the seam starting vertex and the needle and the angle (θ) between the sewing line direction and the current direction of the first edge of the "seam line" are computed (Fig. 4) based on the image features identification. The linear and angular velocity of the fabric are derived from the position and orientation error through the designed fuzzy decision system described in Section 0. The position error (e r ) and the orientation error (e θ ) and their rate are the input data, whereas the linear and angular velocities (u), (ω) of the end-effector respectively are the output data.
The new position and orientation of the end-effector is computed through the linear and angular velocity, the time step dt and the angle φ, which is computed from the image. The fabric is transferred to a new position as a result of the movement of the end-effector, which is stuck on the fabric so the fabric does not slip relative to the gripper. However, the system can overcome the possible slipping under the cost of greater cycle time for the task. This manipulation stops when the edge of the fabric reaches the needle with the desired orientation within an acceptable tolerance. 2. The stitching process. The edge of the "seam line" of the fabric that was aligned with the sewing line is ready to be sewed. In sewing, the fabric is guided along the sewing line with a velocity, which should reconciles with the velocity of the sewing machine, so that good seam quality is ensured. The orientation error is monitored by the vision system and the error is fed to the robot controller in order to correct the orientation of the fabric. 3. The rotation around the sewing needle. After one edge the "seam line" has been sewed, the fabric is rotated around the needle until the next edge of the "seam line" coincides with the sewing line. The orientation error (e θ ) of the next edge in relation to the sewing line and its time rate are computed. These are the inputs to the fuzzy system that controls the rotation of the fabric around the needle, whereas the output is the angular velocity of the end-effector. When this edge of the fabric coincides with the sewing line under a certain tolerance, it is ready for sewing. The sewing process is iterated until all the edges of the "seam line" planned for sewing, are sewed.

Sewing fabrics with curved edges
Robot sewing is a complicated task that demands high accuracy, so that good seam quality is produced. The fact that current industrial robots can only be programmed to execute straight or circular motions leads to the need for developing an approach for sewing fabrics with arbitrary shape. To overcome this limitation and simultaneously exploiting the straight motion of the robot, the curved edges are approximated through straight lines. However, the shapes of cloth parts have edges of arbitrary curvature and circular or free form curved seams are mainly used for aesthetical or decorative reasons. Therefore, more attention should be paid to the problem of sewing fabrics with arbitrary curved edges. The problem of approximating the arbitrary curved edges of the fabrics with straight-line segment has been addressed using two different methods: the Teh-Chin Dominant Point Detection Algorithm implemented for fabrics  and Genetic Algorithms with variable-length chromosomes (Zacharia b et al., 2006). In both approaches, our major goal was to ensure that the deviation from the desired path is lower than a predefined acceptable tolerance, so that the seam can be considered successful and the seam quality is satisfactory. In the approach based on Genetic Algorithms, an additional goal is the minimization of the number of straight line segment of the polygon that approximates the curve. Initially, the camera captures the image of the fabric with the curved edge. The Teh-Chin Dominant Point Detection Algorithm (Teh & Chin, 1989) has been applied in order to extract the dominant points of the curve, using two criteria. The first deals with the length of the chord and the second with the ratio of the perpendicular distance from a point to the chord to the length of the chord. Next, the successive dominant points are joined with straight lines. However, using this method implies that the maximum deviation between the real curve and the straight lines is not defined through the algorithm, but it is found experimentally.
To overcome the drawback of defining the deviation through experimentation, Genetic Algorithms have been used as an alternative to the polygonal approximation of the curve edges of the fabric. In this work, a Genetic Algorithm version is introduced for determining the minimum total time needed for accomplishing the sewing process. This is achieved by approximating the curve section by a polygon with the minimum number of sides under the condition that the maximum deviation between the real and the desired "seam line" is less than an acceptable tolerance. After the outer curved edge has been approximated by a polygon section, the problem of robot sewing fabrics with curved edges is reduced to the problem of sewing fabrics with straight edges. The procedure that is followed is similar to the procedure described in Section 4.1 for fabrics with straight edges.

The fuzzy control system for the manipulation of the fabric
From the standpoint of robot control design, the control systems are based on the plant models and make use of the relevant geometry for robot path analysis. However, in the developed robotic system for handling fabrics, the construction of a model running in real time is rather impossible. To alleviate this difficulty, and simultaneously make the system more flexible, a fuzzy logic controller is designed for handling the fabric towards the sewing needle. A further advantage of the fuzzy controller is that it is robust and quite fast in deriving the control outputs. The proposed controller  outputs the linear and angular velocity of the robot's end-effector. The block diagram for the control system is shown in Fig. 5, where the symbols in parenthesis stand for the fuzzy system that controls the orientation. After the camera has captured the image, the vertices of the fabric are extracted. Then, the current position r of the selected vertex and the orientation θ of the fabric edge are computed from the image, whereas the position of the needle r d and the orientation θ d of the sewing line in the image coordinate system are a priori known. The errors, defined as: e r =r d -r, e θ =θ d -θ, where r d =0 and θ d =0, and the error rates, defined as: e r ΄= e r /dt, e θ ΄= e θ /dt, are the inputs of the controller. The fuzzy controller outputs the linear and angular velocity and the robot end-effector moves to its new position. The design of the proposed controller has the advantage that an analytical model of the robot and the fabric is not necessary, nor special mathematical computations for each fabric shape. In addition, the knowledge of the behaviour of the system is incorporated into the controller so the system responds to any position and orientation error regardless of the properties of the fabric. Lastly, the controller is able to manipulate a piece of fabric regardless of the shape and the type of the fabric and independent of the position and the orientation of the end-effector onto the fabric taking into account the constraints for avoiding buckling and highly covered fabric area. Therefore, the proposed fuzzy controller is flexible and robust, because it is capable of handling various types and shapes of fabrics. Two fuzzy control systems are developed to extract the translational and angular velocity of the robot's end-effector. Each one input variable is expressed by three linguistic terms: small, medium and large, whereas each output variable is expressed by five linguistic terms: very small, small, medium, large and very large. The membership functions for the two inputs and the output of the system that controls the translation of the fabric are presented in Fig. 6(a), (b) and (c). For the fuzzification of the inputs, the linguistic terms small and large are defined by trapezoidal shapes and the term medium is defined by a triangular shape. For the fuzzification of the output, trapezoidal shapes define the terms very small and very large, whereas triangular shapes define the terms small, medium and large. It should be mentioned that the universe of discourse for the position error is defined in pixels and not in centimetres, since the distances are computed on the image. For the system that controls the rotation of the fabric, similar membership functions are provided through extended experimentation. The rule base of each system is composed of 3×3=9 linguistic rules. The rule base includes the knowledge acquired by the systematic investigation of the fabric handling by human workers in feeding the sewing machine. The acquired knowledge is formulated in rules of the following form: "The larger the distance from the needle and the smaller its error rate is, the faster the fabric should move towards the needle" "The larger the angle between the fabric's edge and the "seam line" and the smaller its error rate is, the faster the fabric should rotate towards the "seam line"" Table 1 shows the Fuzzy Associative Memory of the system that controls the translation of the fabric, where the rule confidence is equal to one. The Fuzzy Associative Memory for the rotation is similar, but it is not presented due to the space limit. It should be mentioned that for the implication process the 'min' operator is used, whereas for the aggregation process the 'max' operator is used and the defuzzification process is performed using the centroid method. Fig. 7 shows the hierarchical structure of the intelligent control scheme for the robotized tensional force regulation. This system communicates with the controller of a commercial robot by sending commands to adjust the robot end-effector velocity. In the higher level labelled "Decision making level", decisions about the system initialization are taken. This level incorporates two Fuzzy Logic decision mechanisms, where qualitative knowledge concerning fabric properties is processed.

Control of the fabric's tensional force
Fuzzy definition of critical length L c Fig. 7. Fuzzy decision mechanism and Neuro-Controller scheme.
The first part of this level labelled "Fuzzy definition of length L c " is responsible for the determination of the initial end-effector position on the fabric as it has been described in details in the Pre-sewing tasks (No.5) in Section 0. The second part labelled "Fuzzy definition of fabric tension" defines the desired tensionalforce that should be applied to the fabric; and it is described in Section 0 in details. In the lower level the "F.N.N. controller" outputs the robot end-effector velocity of the sewing process, by regulating the fabric tension.

Determination of the appropriate tensional force
The input to F.N.N. controller is the desired tension that should be applied to the fabric in order to meet the quality standards of the seam. Therefore, a specific force value has to be estimated for each type of the sewed fabric. Since the aim is to achieve a flexible system, an intelligent estimator of the desired tension-force is developed. When the knowledge engineer acquires knowledge from the sewing experts, linguistic variables are used to describe the type of fabric, the necessary tension force applied to the fabric, the location of the hands, etc. Concerning the types of the fabric-cloth linguistic variables such as soft, hard, extensible or very extensible etc. are used. For the description of the applied tension-force similar linguistic variables are used: low force, very low force, etc. This linguistic form is followed for the determination of the desired tension-force as the input to the F.N.N. controller. A number of expert seamstresses-tailors were interviewed, inquired and their work was investigated. The target of the queries was to acquire the knowledge concerning the way they handle different types of fabrics. In the questioning, the handling actions that were mostly investigated are related to the pushing or pulling each type of fabric and how much.
According to the experience of the seamstresses-tailors (i) the fabric is pulled during the sewing procedure so as to keep it outstretched, which means that only tensional force must be applied on the fabric and (ii) the appropriate tension-force for different fabrics depends on: • The extensibility of the fabric. The experts delineate the extensibility of the fabric with linguistic variables such as: a cloth has medium extensibility, high extensibility, very high extensibility, low extensibility and very low extensibility.

•
The direction of the fabric in which the "seam line" is performed (the bias of the fabric).
For "the fabric extensibility", the applied tensional force for different fabrics is expressed by the following general but essential rule: "As much as more extensible the fabric is, so much higher tension-force is applied to it" According to the experts this tension-force is expressed with linguistic variables such as medium, large, very large, small and very small tensional force. Considering that the extensibility increases along the bias of the fabric as confirmed by Potluri & Porat (1996), the tension-force has to become higher in that "direction". Therefore, the expert applies "higher" tension-force to the same fabric when it is sewed along its bias, than the tension-force applied when it is sewed along the yarn direction. The maximum tension-force is applied while the sewing direction is 45° to the yarns. The experts were not able to provide us with the specific values of the tension-force that they apply to each type of the fabric. Nevertheless, they produce high quality seamed products while they use linguistic variables in order to express the tensionforce and they use the same linguistic variables when they are training new seamstresses-tailors. The conclusion was that the decision concerning the determination of the appropriate tension-force that has to be applied to a sewed fabric incorporates fuzziness. Therefore, the fuzzy set theory was assumed as appropriate to be used. According to the acquired knowledge, the two input fuzzy variables "extensibility" and "direction" and one output called "tension-force" are defined. The membership functions and the corresponding linguistic values of these fuzzy variables are illustrated in Fig. 8 & Fig. 9. www.intechopen.com As it is illustrated in Fig. 8(a), for the fabric's extensibility five linguistic values are defined, while the universe of discourse is normalized in the percent scale, which indicates the expert's estimation about how much a fabric can be extended without puckering compared with other fabrics. For the fabric's direction (bias) three linguistic values are defined ( Fig. 8(b)), while the universe of discourse is normalized in the percent scale, which indicates the expert's estimation about the sewed direction on the fabric. The percentage of 100% means that the fabric is sewed at 45° to the yarns. Similarly, the five linguistic values of the output variable "tension-force" are defined as it is shown in Fig. 9. The rules derived after knowledge acquisition, are of the following form: If extensibility is x And direction is y Then tension is z and the FAM is presented in Table 2. where, x ∈ {very low, low, medium, high, very high}, y ∈ {zero, medium, great} and z ∈ {very low, low, medium, high, very high}.  The 7-steps process of a fuzzy system described by Zimmermann (1996) is followed: input, fuzzification, rules, rule evaluation, aggregation, defuzzification and output. For the rule evaluation phase the 'min' operation is used; and for the aggregation mechanism the 'max' operation. The centroid defuzzification method is used since this method is the most widely used and has several advantages (Cox, 1994). Fig. 10 shows the tensional force controller based on Neural Networks. The performance of this scheme is considered successful, when the tensional force applied to the fabric is equal to the desired one, which is specified via the "Fuzzy definition of fabric tension" module.

The Neuro-Controller for the force regulation
The  The force error given by the difference between the desired and the feedback measured force is used in the backpropagation method for training the F.N.N. The Feedforward Neural Network (F.N.N.) is chosen, because its topology is simple and it has been used successfully in the majority of the Neural Nets applications (Narendra, 1996;Sun, 1989). The backpropagation algorithm is used for the training of the formulated F.N.N. (Wasserman, 1989). It is well known that the number of the hidden neurons affects the performance of the F.N.N. In the present work, after a considerable number of experiments it was concluded that five hidden neurons are appropriate considering the quality of the response rate, the response smoothness and the overshooting. The F.N.N. consists of three layers with the configuration (1-5-1), i.e. one neuron in the input layer, five in the hidden and one in the output, as Fig. 11 illustrates. In the hidden layer a threshold parameter is used for the five neurons in order to activate the neuron; and the associated activation function is the sigmoid one.
In the input neuron, the linear activation function is used (Wasserman, 1989), while in the output neuron a threshold parameter is used and the associated activation function is the sigmoid, since the velocity of the robot end-effector was assumed positive, i.e. the robot endeffector moves only forward. The Neuro-controller scheme memorizes the trained F.N.N. controller characteristics for each of the fabrics that have been successfully handled, so the final adapted weights and bias are stored under a label into a file as shown in Fig. 12. The label of each set of weights-bias reflects the inputs used to define the specific fabric type. This label corresponds to the desired tension-force that the Fuzzy decision making part of the system concludes as appropriate. If a new handling task with a piece of fabric is going to be executed, then the "memory" is searched to find a label identical or the closer one to the desired tension-force.
If there is such a label, then the weights-bias under this label are uploaded to the F.N.N. as the initial values. Even in this case, the system does not remain insensitive, the F.N.N. still adapts its weights-bias to train itself and expand its experience (on-line and endless training). Finally, the weights and bias are stored under the same label by overwriting the old values, or under a new label if the closer to the desired tension-force label had been used to initialize the F.N.N. Instead of training the F.N.N. for a wide variety of fabrics, the technique of storing the F.N.N. characteristics for each type of fabric is followed to overcome some restrictions imposed by the nature of the training set and the structure of the F.N.N. The training set of the F.N.N. including all the appeared fabric types is not a uniform set, which causes difficulties to the generalization of the Network capabilities. Moreover, the F.N.N. has one neuron in the input as well as one neuron in the output; with this topology the network is capable to represent a unique function of the model of the controlled system. Considered that two different fabrics have two quite different functions representing their behaviour, the F.N.N. cannot be trained for both of these fabrics. If another F.N.N. structure would considered in order to train it with a larger fabric's training set, then this topology should be more complicated affecting the Network size and therefore the required computational time, which is very critical for the real time performance of the system. The above description of the system "memorizing" is an approximation but still quite far from the actual seamstress-tailor train in order to sew a fabric that she/he has not be trained to do. Eventually, the utilization of the memorized characteristics by the controller resembles a continuous accumulation of experience.

Experimental results
In the following the simulated and experimental results of the two tasks (manipulation and force regulation) are presented. The specifications of the hardware as well as the limitations of the controller performance are described.

Manipulation results
The fabric manipulation experiments were carried out using a robotic manipulator with 6 rotational degrees of freedom (RV4A) and controlled by a PC AMD Athlon (tm) 64 Processor 3000 + 1,81 GHz running under Windows XP. The robot is programmed in Melfa-Basic language in Cosirop environment, while the analysis of the visual information is performed with Matlab 7.1., and each step, the resulted positional data are sent to the robot controller. The vision system consists of a Pulnix analogue video camera at 768×576 pixels resolution RGB with focal capabilities ranging from 1m-∞ and a TELE digital camera of the same resolution using Samsung zoom lenses. Both cameras are fixed above the working table in a vertical position, so that the fabric is kept in the field of view of the first camera during the servoing and the area near the needle is in the field of view of the second camera (Fig. 13). The cameras are connected to Data Translation Mach 3153 frame grabber through coaxial cables. A pointer fixed at the contact point-position was used instead of an actual sewing machine, since the effects associated with the actual sewing process is outside the scope of this work. To validate the feasibility of the proposed approach and evaluate the capability and flexibility of the system, a number of experiments were conducted. Firstly, the algorithm for the manipulation is tested for fabrics where the "seam line" is composed by straight-line segments. The handling process is repeated enough times for the same fabric and for various types of fabrics, where each time the fabric starts from a different location on the table and the gripper is attached to the fabric at a different location. The accepted position and orientation error are set equal to 2 pixels (≈ 0.25 mm) and 0.5° respectively. In the tested cases, the system shows robustness and efficiency. When the accepted position and orientation error were set to lower values, the fabric made many oscillations around the needle until the needle and the sewing line are reached. Next, the system is tested for fabrics with arbitrary curved-line segments using the Genetic Algorithm approach. The maximum number of polygon edges approximating the curved section is set to 6 and the maximum acceptable deviation ε is arbitrarily set to 8 pixels (≈ 1 mm). The optimum polygon section, resulted from the Genetic Algorithm, which approximates the arc curve section of the fabric used for the experiments is shown in Fig. 14.
The length of the arc section is about 5 cm and is approximated by a polygon section consisted of three sides and the maximum deviation for each straight-line segment from the corresponding arc section is 6.8722, 5.5480 and 7.0702 pixels, respectively. The maximum deviation (in pixels) between the needle-point and polygon approximation is computed from the captured image. The sewing process for the curved edge is successively accomplished and the results are shown in Fig. 15. The maximum deviation is 6.6323 pixels (≈0.83 mm) and is lesser than the maximum acceptable limit of 8 pixels. The average value for the deviation is 2.7501 pixels (≈0.34 mm), which is really acceptable. The steps 6-10 correspond to the part of the curve with the maximum curvature. The experiments demonstrate the efficiency and robustness of the system. Fabrics that present relatively high bending rigidity were used for the experiments, so that the fabric remains almost unchangeable and flat, without considerable wrinkles or folds. However, wrinkles and folds generated during the manipulation of the fabric are supportable, in the sense that the system is capable of coping with them without failing to follow the required motion with acceptable accuracy. www.intechopen.com

Results of the tensional force regulation
The force controller is implemented and tested by simulating the sewing process. The simulation is implemented in a Visual Programming Language (Visual Basic); where the Neural Networks and the Fuzzy Logic algorithms were constructed. The results presented in the following demonstrate the performance of the force control system. All the numerical data are normalized in order to feed them into the F.N.N. and all the outputs-results data are presented in normalized form. For the needs of the performance of the controller the inputs "extensibility", "direction" and "flexibility" are specified: (a) The fabric "extensibility" is assumed to be 20%, which is fuzzified as very low and low extensibility. (b) The "direction" of the fabric yarn, in which the seam is performed, is assumed to be 10%. For the fuzzification the bias is labelled as zero. (c) The fabric is assumed to be a knitted fabric with a "flexibility" equal to 70%.
After the fuzzification the flexibility of this knitted fabric is labelled as medium and large. After the defuzzification the fuzzy decision system outputs the desired tension-force equal to 0.12, and the critical length L c , equal to 20 cm. For the requirements of the F.N.N. controller the weights and thresholds were initialized randomly in the interval [−1, 1]. This indicates that any former experience is not utilized, which means that the controller was initialized with the worst conditions. The updating rate parameter of the F.N.N., which is used in the backpropagation learning algorithm, is assigned equal to 0.7, and the sewing machine velocity for this test is assumed equal to 0.8. In Fig. 16(a), the velocity of the robot end-effector provided by the F.N.N. controller, is compared with the sewing machine velocity. In this case, the controller reached a good approximation of the machine velocity after 150 training loops. From the results shown in Fig. 16(b), it can be concluded that as the robot velocity approaches the machine velocity, the tensional force reaches the desired value (0.12). The shapes of the "robot velocity" and "force" curves are expected and are qualitatively verified. When the sewing machine starts, the robot end-effector does not move with the appropriate velocity in order to follow the machine; therefore, the measured force is tensional and is increased rapidly as it is illustrated from the first loops in Fig. 16(b). At the same time the controller reacts to this increase of the force by adapting its weights and it derives a robot velocity greater than the machine velocity, in order to reduce the tensional force in the desired level.
Since the backpropagation training method modifies the F.N.N. weights continuously, after the last loop the error varies in the range of the third decimal for the force and of the seventh decimal for the end-effector velocity. These results were expected since a very low increase of the difference between the sewing machine velocity and the end-effector velocity results increases considerably the tensional force. The controller is also tested for its performance in the presence of disturbances due to the noise interfering in the measured force. A noise of an amplitude ±10% was added to the applied force while the topology of the F.N.N. controller kept the same as presented in the previous test in order to compare the results under the same structure of the experimental stage. For comparison the velocity and force results are shown in Fig. 17(a) and (b) respectively without noise (black line) and with noise (white line) while the desired values are shown by grey lines. The controller can be characterized as robust, since it is capable to regulate the tensional force applied to the fabric to reach the desired value while approaching the sewing machine velocity. The small variations on the applied force, shown in Fig. 17(b) (black line), are the effects of the noise and have a trend to increase when the added noise increases. These variations are acceptable when the noise ranges in ±10% of the applied force; but the seam quality is deteriorated if the noise is out of the range of ±10%. The verification of the system "memory" is performed through a simulated example. For a specific fabric, the proposed controller first operates with a "white memory", in terms of the F.N.N. weights-bias. The controller successfully adjusts the force as described in the first example with the results shown in Fig. 16(a) and (b); and the final values of the weights have been stored in the "memory" file under the label [0.12], which is the desired tensional-force. In other words the "experience" was acquired and amassed. In the next test, the controller operates with its embedded "experience" in order to determine the robot velocity for the same fabric. Therefore, the initial values of the F.N.N. weights are set-up using the stored values under the label [0.12]. In Fig. 18(a) and (b) the velocity of the robot end-effector and the force applied to the fabric are presented. By comparing the diagrams before ( Fig. 16(a) and (b)) and after ( Fig. 18(a) and (b)) the acquired "experience", it is clear that the controller's performance is improved noticeably using the previous "experience". The overshooting in both velocity and force response diagram is reduced about half, as well as the F.N.N. training time is reduced remarkably.
The simulation is performed in a PC with an AMD Duron 700 Mhz processor. A complete training loop, shown in Fig. 10, is performed in 0.96 milliseconds. For the 150 training loops where the Neuro-Controller has achieved the desired tensional force, the elapsed time is 144 milliseconds. Considering that the usual sewing speeds ranges from 0.1 m/s to 0.3 m/s, the seam that is performed in this training time (144 milliseconds) has a length ranged from 14.4 mm to 43.2 mm. Therefore, it can be concluded that the system is capable to achieve the desired tensional force of the fabric from the firsts stitches of the sewing process. Eventually, the speed efficiency of the proposed system is restricted from the refresh range of the force sensor device and the I/O of the robot controller.

Conclusions
In this work, a system for robotic handling of fabrics towards sewing is introduced. A visual servoing manipulator controller based on fuzzy logic is designed in order to guide the fabric towards the sewing machine and produce a good seam quality. The experimental results show that the proposed approach is effective and efficient method in guiding the fabric towards the sewing machine, sewing it and rotating it around the needle. Unlike some of the methods referred in the introduction, the proposed controller does not need mathematical models or calculations, but it is proved to be rather simple and robust. It seems that, using intelligent methods the robotic system could be independent and autonomous in order to perform the sewing process for the majority of fabric types, without or little human assistance. It should be stressed that the problem of sewing a piece of fabric using a robotic manipulator instead of a human expert poses additional problems, since it is more difficult for a robot to cope with buckling, folding or puckering. Considering the future research work, the proposed algorithms can be extended so that it can take into account the distortions presented during robot handling of the fabric. Finally, the integration of the systems in a single robotic workcell is the ultimate target.