lundi 14 septembre 2015

XY Plotter with LabVIEW and STM32F4



Abstract -- the aim of this project is to design and build a XY-Plotter capable of drawing computer processed images or graphs. It details design choices, high-level control processing, and the low-level control algorithms that were used with graphical interfaces programmed in LabVIEW. The control is implemented using the Stm32F4 board 

I. Project Description :
A XY-Plotter is a robot that operates in two axes of motions ("X" and "Y") in order to draw different shapes or write a text. It is composed of two special mechanisms for raising and lowering a pen. The plotter has a hole in its base where the pen goes through. It is designed to print on either paper or any surface such as a wall. The plotter should simply be placed against the surface and the pen will draw away through the hole. Each axis is powered using a single stepper motor and belt. But, is that all what a XY-Plotter can do? Definitely not! It may be useful for young children or persons suffering from writing disabilities, such as having a broken hand; they can write using their smartphones by simply dictating texts. Modulo small changes, it can be used to place electronic components on a Printed Circuit Board (PCB).

a.High-level architecture
The figure below summarized the overall architecture of the XY-Plotter . Indeed, the user can select ether he needs to draw a mathematical curve or extract the shapes from a given picture. An additional interface simulates the robot movement (with adjustable speed) and visualizes the real-time behavior of the robot

b.XY-Plotter Mechanics
To minimize the costs, we decided to realize the XY-Plotter using two old printers. It was very difficult to adapt all the parts and have a good precision. these figures shows some different steps to build and assemble the different parts of the robot.

c. Canny Edge interface
To simplify the use of our plotter, the software application was divided into three interfaces that will be detailed in this section. This interface allows the upload of an image file, extract the shapes of the features it contains and returns the set of their coordinates as text file. This requires of course to go through several steps:
In the first step (reading the image file), the image file is opened using IMAQ ReadFile . The file format can be a standard format (BMP, TIFF, JPEG, JPEG2000, PNG, and AIPD) or a nonstandard format already defined by the user. In all cases, the read pixels are converted automatically into the image type passed by.
The second step is the shape detection. After getting the picture, we invoke the IMAQ CannyEdgeDetection, which uses a specialized edge detection method to accurately estimate the location of edges even under conditions of poor signal-to-noise ratios.
The result is a binary image. It represents a black & white converted image that can be reproduced by the robot using black ink on white paper. It is worth mentioning here that the details level of detected edges is tuneable through the use of a user fixed threshold value.
The final step is the generation of the edge points coordinates. To find the number of edge segments in an image and get the coordinates of the pixels in each segment, we used the IMAQ GetPointsOnContour function. It joins adjoining edge pixels into edge segments.
The image bellow  shows an example of segment information after detecting the Edge and generating coordinate of contour points

As aforementioned, the final job for this interface is to return a text file containing all the coordinates of the detected contour points. 




d. Curve drawer interface
As defined in the NI-LabVIEW documentation, the XY-graph is a general-purpose, Cartesian graphing object that plots multivalued functions, such as circular shapes or waveforms with a varying time base. The XY-graph displays any set of points, evenly sampled or not.
This graphing object will be used along with the LabVIEW formula interpreter supporting the standard mathematical operators (" + ", " - " , " * ", "/ ") and a very large number of mathematical functions (trigonometry functions, logarithm and exponential functions and random numbers generators).
These two LabVIEW objects are two key components for our XY-Plotter. In fact they allow us draw and visualise several plots right before printing them. They both form our so called “Curve drawer interface”


E. Printer interface and 3D-model
The XY plotter GUI shown in figure below allows the user to see a preview and reel time impression with 3d model.
After confirming , the command are send via serial connection.
the serial port would have to be selected properly for appropriate communication between computer and microcontroller. Once the communication was established, the computer was ready to send information to the microcontroller.
The idea is to send a command and wait until the device respond with ‘ok’

II.EXAMPLE OF USES :
A.drawing on paper :
We present here a simple test of our realized robot. It represents a complete built, realized and tested system. As shown in the figure, we succeeded in printing the logo of National Instrument and an arbitrary character.

B.Laser Engraver example
This robot can be easily upgraded to Laser Engraver by adding a 500mW laser engraver


In the image bellow, a list of suggested materials that can be used to engrave with laser is given, that are: wood board, colorful paper cards, dark opaque acrylic, etc. Besides, the list of possible cutter material include among others: colourful paper cards, foam papers, etc.


C.PCB example
Milling a PCB is not an easy task, especially when it is homemade, so with this robot we can add a sharp tools attached to a high performance motor  to make our PCB  more easily , faster , with high accuracy 
After uprating the XY Plotter. The CannyEdge interface do the job by extracting all the path. The Robot can print circuit-traces directly on to a carrier board
 

IIi.Other software Version using Qt
This version is under developing:






 
References
   [1]    J. TRAVIS and J. KRING. “LabVIEW for Everyone: Graphical Programming Made Easy and Fun”, National Instruments Virtual Instrumentation Series. Prentice Hall PTR, 2006.
   [2]     (2012) The Mantis robot website. [Online]. Available: http://www.mantisrobot.com/
   [3]    BLUETOOTH, S. I. G. Specification of the Bluetooth System, version 1.1. http://www. bluetooth. com, 2001.


Team members
This project is realized by Nidhal Mars, an engineering student at ENSI, “Embedded Software and Systems” specialization. It is supervised by Dr.-Ing.Mohamed Amine Abid (Researchgate / Linkedin) and Dr.-Ing.Chadlia JARAD (Researchgate / Linkedin) , associate professors at ENSI.



2 commentaires: