<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
    <channel>
        <title>Automatic Orientation System for a Vibrometer Laser - Home</title>
        <link>http://laser.mozello.com/home/</link>
        <description>Automatic Orientation System for a Vibrometer Laser - Home</description>
                    <item>
                <title>Twenty seventh week</title>
                <link>http://laser.mozello.com/home/params/post/1281257/twenty-seventh-week</link>
                <pubDate>Sat, 26 Aug 2017 23:26:00 +0000</pubDate>
                <description>The calibration matrix between the galvanometer and the kinetic was implemented in order to represent the points in the right place. This matrix was just a translation matrix since it was not expected any rotation between the devices. With this task completed, the point were still on the wrong place. &lt;br&gt;&lt;br&gt;So by drawing a square with the limits of the galvanometer, it was found that the x axis was smaller than the y axis. This could be a galvanometer problem if it wasn&#039;t for the potentiometer on the driver that can be adjusted. &lt;br&gt;So to adjust the the potentiometer in order to do 20º another temporary structure was build to indicate where the 20º should be. &lt;br&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/medium/caixa_testes-1.png&quot; style=&quot;width: 315px;&quot; class=&quot;moze-img-center&quot;&gt;&lt;br&gt;&lt;div class=&quot;moze-center&quot;&gt;Figure 1 - Structure to calibrate axis&lt;/div&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/medium/caixa_testes_2.png&quot; style=&quot;width: 382px;&quot; class=&quot;moze-img-center&quot;&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;Figure 2 - Top view &lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/medium/caixa_testes_3.png&quot; style=&quot;width: 309px;&quot; class=&quot;moze-img-center&quot;&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;Figure 3 - Measurements on the wood to calibrate.&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt;&lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt;By performing this task, another problems arrived. The points that after this calibration were in the correct place, at least the drawing was equal to the one on the app, were now just a small line instead of a point, this means that the laser is turning on when the galvanometer is still trying to reach the correct coordinate. &lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt;After a quick research, it was found that there are a couple of other different variables that needed to be adjusted. Since there is no information on how to calibrate the drivers, this task can&#039;t be done, since the drivers need someone with knowledge on this kind of calibrations.&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt;This will be the only topic missing, but, with a calibrated galvanometer, everything that was built and programmed, should work the it. &lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt; This way the writing of the thesis will continue.&amp;nbsp; &lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt; &lt;br&gt;&lt;/p&gt;&lt;br&gt;</description>
            </item>
                    <item>
                <title>Twenty sixth week</title>
                <link>http://laser.mozello.com/home/params/post/1276612/twenty-sixth-week</link>
                <pubDate>Mon, 21 Aug 2017 23:47:00 +0000</pubDate>
                <description>To solve the previous problem with the program freezing when the vcc was set to 0v, two 1k resistors were added, connecting&amp;nbsp; the 5v to the SDA, and the 5V to the SCL.&lt;br&gt;&lt;br&gt;This way the problems with the address of the DAC&#039;s were solved. So the construction of the shield begun. It needs to have the same functions in the same pins as the low pass filter shield so the shields could be replaced without the need to change the arduino code. &lt;br&gt;&lt;br&gt;&lt;div class=&quot;moze-center&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/medium/shiled21.jpg&quot; style=&quot;width: 463px;&quot; class=&quot;moze-img-center&quot;&gt;&lt;/div&gt;&lt;p class=&quot;moze-center&quot;&gt;Figure 1 - Top view Shield &lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/medium/shield22.jpg&quot; style=&quot;width: 460px;&quot; class=&quot;moze-img-center&quot;&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;Figure 2 - Underneath view of the shield &lt;br&gt;&lt;/p&gt;&lt;br&gt;

&lt;iframe class=&quot;moze-iframe&quot; src=&quot;http://www.youtube.com/embed/GR3wSg5kMDc?autoplay=1&amp;amp;loop=1&amp;amp;playlist=GR3wSg5kMDc&quot; allowfullscreen=&quot;allowfullscreen&quot; width=&quot;645px&quot; height=&quot;363px&quot;&gt;&lt;/iframe&gt;&lt;br&gt;&amp;nbsp;The arduino code for the dacs was also built. Leaving only the calibrations to do.&lt;br&gt;&lt;div class=&quot;moze-center&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/dac_conections.jpg&quot; style=&quot;width: 447px;&quot; class=&quot;moze-img-center&quot;&gt;&lt;/div&gt;&lt;p class=&quot;moze-center&quot;&gt;Figure 3 - DAC shield connections. &lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt;The purpose of the figure 3 is to show the position of the 2 galvanometer wires are connected for future reference. &lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/medium/galva_test_dacs-1.jpg&quot; style=&quot;width: 398px;&quot; class=&quot;moze-img-center&quot;&gt;&lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;Figure 4 - Using the DAC shield to do a square with the galvanometer limits&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/dac_shield_test.PNG&quot; style=&quot;width: 390px;&quot; class=&quot;moze-img-center&quot;&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;Figure 5 - Mesh points on the computer&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/medium/dac_points.jpg&quot; style=&quot;width: 422px;&quot; class=&quot;moze-img-center&quot;&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;Figure 6 - Result on the object&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt;As said before only the calibrations are missing right now. &lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt;As for the green laser pointer, it can use 12v or 5v. Using the 5V from the arduino, the laser has trouble flashing with the same speed as the red pointer. When the laser is connected to the 12v, the bright is super intense, and can cause harm by looking at his reflections. The green laser is class III b. This way the laser that will be used is the red one. This can be changed any time just by removing the red and connecting the green laser, since there is no changes in the code. &lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt;&lt;br&gt;&lt;/p&gt;</description>
            </item>
                    <item>
                <title>Twenty fourth to Twenty fifth weeks</title>
                <link>http://laser.mozello.com/home/params/post/1271947/</link>
                <pubDate>Tue, 15 Aug 2017 23:48:00 +0000</pubDate>
                <description>Calculations for the arduino representation of the cycles;&lt;br&gt;&lt;ul&gt;&lt;li&gt;Time to write 40 points (square)&amp;nbsp; without delays - 1812 microseconds;&lt;/li&gt;&lt;li&gt;Max number of points of the galvanometer - 20 000 points per second;&lt;/li&gt;&lt;li&gt;Points to get 20 frames - 1000 points (20 000/20) ;&lt;br&gt;&lt;/li&gt;&lt;li&gt;To represent something 20 times per second means 1000 points in &lt;span class=&quot;timestr&quot;&gt;50 ms;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;timestr&quot;&gt;Delay according to the number of points - 1000 points in 50 ms, means 1 point with a delay of 50 microseconds.&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Tests with the arduino showed that the galvanometer can&#039;t handle that speed, instead the pause was 140 microseconds. The figure used to test it was a square with 10 points in each side. Then, by turning the laser on after the 140 microseconds delay, it was observed that it was on before the galvanometer reached it&#039;s destination. So in order to turn on the laser when the location of the mirrors was the intended point, the necessary delay was 700 microseconds. Then, for the laser to be seen it would need a delay of 50 microseconds. The final delay is 750 microseconds. with means that only 66 points will be possible at 20fps. &lt;br&gt;&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/medium/app_last.PNG&quot;&gt;Figure 1 - New app ( the calibrations panel still needs work)&lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt;The new app allows to:&amp;nbsp;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Control the box lights; &lt;br&gt;&lt;/li&gt;&lt;li&gt;See the box temperature;&lt;/li&gt;&lt;li&gt;View the point cloud in real time from the kinect; ( it&#039;s possible to hide it and see the depth cam image instead.) &lt;br&gt;&lt;/li&gt;&lt;li&gt;Show the galvanometer limits to show the user, where to put the part. &lt;br&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p class=&quot;moze-left&quot;&gt;To change the colour of the box lights, infrared communication between the arduino and the lights (bought with the receiver) was established. &lt;img src=&quot;//site-470199.mozfiles.com/files/470199/medium/ir_envia_recebe.jpg&quot; style=&quot;width: 446px;&quot; class=&quot;moze-img-center&quot;&gt;&lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;Figure 2- IR sensors&lt;br&gt;&lt;/p&gt;&lt;p&gt;To read the temperature, a temperature sensor was installed on the top of the second shelf. Since the drivers of the galvanometer, when &quot;online&quot;, heated up to a reasonable temperature, a fan was installed. The fan speed is always maximum since its connected directly to the 12V power source. The decision to keep it that way was the lack of time. &lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/medium/fan_and_power_source.jpg&quot; style=&quot;width: 464px;&quot; class=&quot;moze-img-center&quot;&gt;Figure 3 - Fan and 12V power source&lt;br&gt;&lt;/p&gt;&lt;p&gt;To work the the serial port, more code on the matlab and arduino was developed. &lt;br&gt;&lt;/p&gt;&lt;p&gt;One timer was created on the arduino to send the temperature every 2 seconds and another two were created on the matlab for the app, one to update the point cloud every 250 milliseconds and another to look for COM ports available. &lt;br&gt;&lt;/p&gt;&lt;p&gt;The code for the arduino to recieve the data of the points was rewritten. The readuntilstring() function, when used to read large strings fails. So an alternative function used to read the string char by char and build the string. Then getValue() was used, which was found on &lt;a href=&quot;https://stackoverflow.com/questions/9072320/split-string-into-string-array&quot; target=&quot;_blank&quot;&gt;link&lt;/a&gt;, separates the string in smaller strings by the char &quot;;&quot;, which was the same used before. Since the entire string was saved, no need to create a matrix to save it, so that part was deleted and instead of readding a matrix, the string will be read. &lt;br&gt;&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/medium/box_2_0.jpg&quot; style=&quot;width: 478px;&quot; class=&quot;moze-img-center&quot;&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;Figure 4- Box aspect inside at this date. &lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt;To avoid having 3 wires laying around, a solution with a usb hub and a usb extension cable was studied but the kinect somehow detects when it&#039;s not connected directly to the computer, so that solution was left behind. &lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt;Also, to try to only use one low-pass-filter for each mirror, a solution with a logical gate was tested, but it was found that the logical gate only works at 100% with a digital signal. So, two more low pass filters were built into the arduino shield, since the logical gate was already welded. This way, 2 pwm signal are sent, and 4 digital signals control each one of the gates. The pwm signal is sent to both pins on each mirror (up and down), and, other arduino pin controls if it is on or off. &lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt;Results.&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/points_to_draw.PNG&quot; style=&quot;width: 471px;&quot; class=&quot;moze-img-center&quot;&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;Figure 5 - Computer plot ( intended points) &lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/medium/real_points.jpg&quot; style=&quot;width: 443px;&quot; class=&quot;moze-img-center&quot;&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;Figure 6 - Real world result&amp;nbsp;&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt;Since the old platform to hold the laser was made for the first points, its dimensions were wrong, so a new platform was built in wood for the both laser pointers, the 5mw and the 80 mw lasers. &lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/medium/laser_bases.jpg&quot; style=&quot;width: 459px;&quot; class=&quot;moze-img-center&quot;&gt;Figure 7 - Laser platforms &lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt;Also, for the vision component, a light was installed on the front of the box. Since there was no relay available at the time, a button was also installed. &lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/luz1.jpg&quot; style=&quot;width: 399px;&quot; class=&quot;moze-img-center&quot;&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;Figure 8- LED light and button &lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/medium/light2.jpg&quot; style=&quot;width: 420px;&quot; class=&quot;moze-img-center&quot;&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;Figure 9 - LED light on&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt;The light is positioned right under the rgb cam of the kinect.&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt;&lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;DAC experiments &lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt;The dac that will be used on the work are the MCP4725. This device communicates via I2C. This kind of communication is made using the address of each device. Since the DAC&#039;s have the same address it&#039;s impossible to send commands to just one. So, ways to change the address have been searched. A solution was found on &lt;a href=&quot;https://learn.sparkfun.com/tutorials/mcp4725-digital-to-analog-converter-hookup-guide&quot; target=&quot;_blank&quot;&gt;link&lt;/a&gt; which said &quot;To change the address of your other device, simply de-solder the jumper 
and add a blob of solder to the middle pad and the Vcc pad.&quot;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/i2c_dac_change.png&quot; style=&quot;width: 379px;&quot; class=&quot;moze-img-center&quot;&gt; &lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt;This way the addresses 0x62 and 0x63 were possible. Since only 2 DAC&#039;s were necessary at a time, the vcc pin was set to 0v on 2 DAC&#039;s and 5 on the other 2. This was supposed to allow to operate one DAC at a time but instead the system froze. &lt;br&gt;&lt;/p&gt;</description>
            </item>
                    <item>
                <title>Twenty first week to Twenty third</title>
                <link>http://laser.mozello.com/home/params/post/1260313/twenty-first-week-to-twenty-third</link>
                <pubDate>Tue, 01 Aug 2017 02:54:00 +0000</pubDate>
                <description>&lt;ul&gt;&lt;li&gt;Creation of the equipment box.&lt;/li&gt;&lt;li&gt;Creation of the shield&lt;/li&gt;&lt;li&gt;Assemble of all equipment. &lt;br&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/medium/20597746_10207746992392919_1719298731_o.jpg&quot; style=&quot;width: 332px;&quot; class=&quot;moze-img-center&quot;&gt;&lt;br&gt;&lt;img src=&quot;http://site-470199.mozfiles.com/files/470199/medium/20623271_10207746993072936_63376230_o.jpg&quot; style=&quot;width: 339px;&quot; class=&quot;moze-img-center&quot;&gt;&lt;img src=&quot;http://site-470199.mozfiles.com/files/470199/medium/20590507_10207746992712927_636652544_o.jpg&quot; style=&quot;width: 337px;&quot; class=&quot;moze-img-center&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/medium/20615311_10207746992192914_924598370_o.jpg&quot;&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;Figure 1-4. Equipment Box&lt;img src=&quot;http://site-470199.mozfiles.com/files/470199/medium/20543125_10207747012633425_1135804046_o.jpg&quot; style=&quot;width: 342px;&quot; class=&quot;moze-img-center&quot;&gt;Figure 5 - Arduino Shield for low-pass-filter pwm signal&lt;br&gt;&lt;/p&gt;</description>
            </item>
                    <item>
                <title>Eleventh to Twentieth week</title>
                <link>http://laser.mozello.com/home/params/post/1238620/</link>
                <pubDate>Mon, 03 Jul 2017 23:31:00 +0000</pubDate>
                <description>A first model of the dissertation was written.&lt;br&gt;&lt;br&gt;Tests with the high frequency PWM signal have been done in order to validate the possibility of avoiding an analogue signal. &lt;br&gt;In the tests with a frequency arround 30kHz PWM,&amp;nbsp; a delay of one millisecond was used for allowing the figure to be visible. With this delay and the high frequency PWM, after just 10 points, adding more would result in the impossibility of they being represented at the same time. Also, and this was the biggest issue, the laser path would have some inconsistencies, since it had the same effect as if it was being turned on and off.&amp;nbsp; The first attempt to solve this issue, was a low pass filter, but the effect was the same as high frequency PWM alone.&lt;br&gt;&lt;br&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/medium/19885715_10207533691340526_455151562_o.jpg&quot; style=&quot;width: 368px;&quot; class=&quot;moze-img-center&quot;&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;Figure 1- Result with the low pass filter, analogue write loop cycle from 0 to 255 and 255 to 0. &lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/19832596_10207533696540656_1709464036_n.jpg&quot; style=&quot;width: 293px;&quot; class=&quot;moze-img-center&quot;&gt;Figure 2 - Low pass filter used &lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt;The filter was used with a pwm frequency of 200kHz.&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt;Manual work: &lt;br&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Laser pointer was glued to the base.&lt;/li&gt;&lt;/ul&gt;&lt;div class=&quot;moze-center&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/19756095_10207533698500705_1583880614_n.jpg&quot; style=&quot;width: 191px;&quot; class=&quot;moze-img-center&quot;&gt;Figure 3 - Glued laser pointer&lt;br&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;Galvanometer was screwed to the base.&lt;/li&gt;&lt;/ul&gt;&lt;br&gt;Since the laser pointer on figure 3 stopped running, another one was bought. All the problems with the galvanometer part were solved with this exchange. &lt;br&gt;&lt;br&gt;Then to test the laser a figure was drawed. &lt;br&gt;&lt;br&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/Pikachu_12.jpg&quot; class=&quot;moze-img-center&quot;&gt;Figure 4 - Pikachu figure&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/medium/19814477_10207544138441697_1972553281_o.jpg&quot; style=&quot;width: 416px;&quot; class=&quot;moze-img-center&quot;&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;Figure 5 - Pikachu contours with the galvanometer&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt;There is a problem with the leg of the pikachu but its possible that this problem was created when the coordinates of the leg were being copied to the arduino, since the rest of the shadow is ok. The image looks different from the figure 4 because of the scale. &lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt;&lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;br&gt;&lt;/p&gt;</description>
            </item>
                    <item>
                <title>Tenth week</title>
                <link>http://laser.mozello.com/home/params/post/1174392/tenth-week</link>
                <pubDate>Sun, 30 Apr 2017 00:13:00 +0000</pubDate>
                <description>On this week, tests with real parts were performed. Multiple backgrounds
were tested to choose the best part/background combination. Since the previous
tests were done using a red paperboard, the first idea was to use it as
background and put the object to detect on its center. Since all the objects
had shiny surfaces, they were hard to detect. To ease the detection process,
they were wrapped in painting tape. &lt;br&gt;&lt;img&gt;&lt;br&gt;&lt;br&gt;Also, since the parts were now close to white, the background was now black. The other way around was study but the shadows produced by the parts, usually lead to some confusion by the camera, and the problem was even worst in case of small holes.&amp;nbsp; &lt;br&gt;The colours tested for the background were red, pink, black and white. &lt;br&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/medium/18195856_10207055701751085_1827376096_o.jpg&quot; style=&quot;width: 394px;&quot; class=&quot;moze-img-center&quot;&gt;Figure 1 - Environment and object for tests&amp;nbsp; &lt;br&gt;&lt;/p&gt;&lt;p&gt;By testing the objects on figure 1, it was found that in previous tests, camera calibrations between infra-red and rgb sensors were forgotten. This problem is now corrected. To test the functions available to new matlab versions, version R2017a sponsored by&amp;nbsp; &lt;a class=&quot;_2yez&quot; data-hovercard=&quot;/ajax/hovercard/hovercard.php?id=213306348702828&amp;amp;extragetparams=%7B%7D&quot; href=&quot;http://engeniusteam.web.ua.pt/&quot; target=&quot;_self&quot;&gt;Engenius - UA Formula Student&lt;/a&gt; was used. &lt;br&gt;&lt;/p&gt;&lt;p&gt;Them, with the calibrations, the two methods used before were refined based on the expected result for the objects on figure 1. &lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/distance1.png&quot; style=&quot;width: 376px;&quot; class=&quot;moze-img-center&quot;&gt;Figure 2 - Result with distance&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/squares1.PNG?1493818411&quot; style=&quot;width: 392px;&quot; class=&quot;moze-img-center&quot;&gt;&lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;Figure 3 - Result with squares&lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/distance2.PNG&quot; style=&quot;width: 402px;&quot; class=&quot;moze-img-center&quot;&gt;Figure 4 - Result with distance&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/squares2.PNG&quot; style=&quot;width: 414px;&quot; class=&quot;moze-img-center&quot;&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;Figure 5 - Result with squares&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/distance3.PNG&quot; style=&quot;width: 426px;&quot; class=&quot;moze-img-center&quot;&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;Figure 6 - Result with distance&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/squares3.PNG&quot; style=&quot;width: 439px;&quot; class=&quot;moze-img-center&quot;&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;Figure 7 - Result with squares&lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/distance4.PNG&quot; style=&quot;width: 453px;&quot; class=&quot;moze-img-center&quot;&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;Figure 8 - Result with distance&lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/squares4.PNG&quot; style=&quot;width: 477px;&quot; class=&quot;moze-img-center&quot;&gt;&lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;Figure 9 - Result with squares&lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;By studding the digital potentiometer, it was found that it works in steps. &lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/medium/digital-potentiometer.jpg&quot; style=&quot;width: 311px;&quot; class=&quot;moze-img-center&quot;&gt;Figure 10 - Digital potentiometer&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt;As it can be seen on the figure above the digital potentiometer has 8 pins. The Vcc and VL are connected to 5V and the GND and VH are connected do ground. The VW is the pin with the intended voltage to control the mirrors on the galvanometer. &lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt;To ensure that voltage, pins U/D (up, down), INC (increment) and CS (chip select) need to be controlled.&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt;So, to add one step, CS needs to be low, U/D need to be high and then INC is &quot;pressed&quot; to increment one step by setting it to low. &lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/upStep.png?1493513967&quot; style=&quot;width: 283px;&quot; class=&quot;moze-img-center&quot;&gt;Figure 11 - Add one step to the digital potentiometer &lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt;To subtract one step, CS is still low but now U/D needs to be low, then you send low on INC&lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/downStep.png?1493513966&quot; class=&quot;moze-img-center&quot;&gt;&lt;br&gt;Figure 12 - Subtract one step to the digital potentiometer &lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt;To store the wiper value for the next time the device is turned on, U/D and INC both need to be high and then you set CS high. &lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/save_wiper.png&quot; class=&quot;moze-img-center&quot;&gt;Figure 13 - Save value for the next time the device is turned on&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt;If the CS value is high in any of the previous control steps, nothing happens because the device enters standby low power mode. The information on how the digital potentiometer works was found here &lt;a href=&quot;https://www.youtube.com/watch?v=iOINcW8BP3w&quot; target=&quot;_self&quot;&gt;youtube link&lt;/a&gt;.&lt;br&gt;&lt;/p&gt;&lt;p&gt;The problem with the use of the potentiometer is that it can only get a certain number of values, that are available on the file &lt;a href=&quot;http://site-470199.mozfiles.com/files/470199/valores.txt&quot; target=&quot;_blank&quot;&gt;valores.txt&lt;/a&gt;. To get all the values between 0 and 5 V a DAC could be used instead of the digital potentiometer. &lt;br&gt;&lt;/p&gt;&lt;p&gt;Also it seems to be impossible to create a well visible mesh with the galvanometer, tests with the device showed that the trail created by the laser made it seem just one line. If a small delay is set between each step, for 18 points a 4ms delay it too much but 3 ms produces a blurred line.&lt;br&gt;&lt;/p&gt;&lt;p&gt;To finish, the laser pointer used, after approx. 5 meters starts to leave a giant but since the kinect &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/hh973078.aspx#Depth_Ranges&quot; target=&quot;_self&quot;&gt;limitations&lt;/a&gt; are 4m it is ok.&lt;br&gt;&lt;/p&gt;</description>
            </item>
                    <item>
                <title>Ninth week</title>
                <link>http://laser.mozello.com/home/params/post/1166885/</link>
                <pubDate>Fri, 21 Apr 2017 23:30:00 +0000</pubDate>
                <description>To get used to the arduino, some tutorials were made. &lt;br&gt;With the tutorials completed, the galvanometer and the digital potentiometer were tested. &lt;br&gt;The digital potentiometer it the X9C103S but the tutorial found to the X9C103P had the same connections. &lt;a href=&quot;http://www.instructables.com/id/X9C103P-Basic-Operation/&quot; target=&quot;_self&quot;&gt;Link to the turorial.&lt;/a&gt;&lt;br&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/esquema_cena.PNG&quot; style=&quot;width: 380px;&quot; class=&quot;moze-img-center&quot;&gt;&lt;br&gt;&lt;p class=&quot;moze-center&quot;&gt;Figure 1 - How the digital potentiometer was connected&lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/medium/gavanometer_effect.PNG&quot; style=&quot;width: 258px;&quot; class=&quot;moze-img-center&quot;&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;Figure 2 - Galvanometer response from 0V to 5V&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt;Since only one digital potentiometer was given to be tested, both mirrors were set to the same movement. &lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt;One thing that was noticed was that all of the connections required a lot of wires which can get confused, a better solution would possibly be to print a circuit board to connect both potentiometer to each mirror controller.&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/medium/18110351_10207003981098101_661821220_o.jpg&quot; style=&quot;width: 403px;&quot; class=&quot;moze-img-center&quot;&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;Figure 3 - Connections with one potentiometer&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt;All the parts were cold even if they were turned on for some hours.&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt;Also, there is still the need to change the voltage from 0V - 5V to -5V - 5V.&lt;br&gt;&lt;/p&gt;</description>
            </item>
                    <item>
                <title>Eighth week</title>
                <link>http://laser.mozello.com/home/params/post/1159992/eight-week</link>
                <pubDate>Sat, 15 Apr 2017 22:15:00 +0000</pubDate>
                <description>&lt;span style=&quot;color: #000000&quot;&gt;The laser connections were welded and some arduino tuturials were made. &lt;br&gt;&lt;/span&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/medium/17948436_10206946901951158_381876139_o.jpg&quot; style=&quot;width: 331px;&quot; class=&quot;moze-img-center&quot;&gt;Figure 1 - Welded laser&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #000000&quot;&gt;Also the app was finished, at least the mesh creation part.&lt;/span&gt;&lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/medium/app_final.PNG&quot; style=&quot;width: 471px;&quot; class=&quot;moze-img-center&quot;&gt;&lt;span style=&quot;color: #000000&quot;&gt;Figure 2 - Mesh using 2D&lt;/span&gt;&lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/medium/app_final_distance.PNG&quot; style=&quot;width: 468px;&quot; class=&quot;moze-img-center&quot;&gt;&lt;span style=&quot;color: #000000&quot;&gt;Figure 3 - Mesh using distance between points&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/medium/app_final_squares.PNG&quot; style=&quot;width: 462px;&quot; class=&quot;moze-img-center&quot;&gt;Figure 4 - Mesh using on squares&lt;br&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #000000&quot;&gt;There are still tests that need to be done on a real object to validate the results.&amp;nbsp; &lt;br&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #000000&quot;&gt;Also the kinect limitations were study, it was found that minimum distance to the depth sensor to work is 60 cm according to &lt;a href=&quot;http://www.iheartrobotics.com/2010/12/limitations-of-kinect.html&quot; target=&quot;_self&quot;&gt;link&lt;/a&gt;, but tests with the kinect showed that it can only capture depth if the object is at least at 80 cm.&lt;br&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #000000&quot;&gt;under construction...&lt;/span&gt;&lt;/p&gt;</description>
            </item>
                    <item>
                <title>Seventh week</title>
                <link>http://laser.mozello.com/home/params/post/1159989/seventh-week</link>
                <pubDate>Sat, 15 Apr 2017 21:51:00 +0000</pubDate>
                <description>To separate the 3D mesh in multiple zones, first the distance from each point from the cloud was calculated, then a distance was stipulated and points at that certain distance were found and used as mesh. The result of this mesh is in figure 1.&lt;br&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/medium/5mm_malha.PNG&quot; style=&quot;width: 413px;&quot; class=&quot;moze-img-center&quot;&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/medium/3dmesh_step_malha2_2.PNG&quot; style=&quot;width: 407px;&quot; class=&quot;moze-img-center&quot;&gt;&lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;Figure 1- Mesh with 5mm intervals&lt;br&gt;&lt;br&gt;&lt;/p&gt;Another solution was also tried. The mesh was divided in squares and the medium gradient was calculated. &lt;br&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/medium/quadradoszonas.PNG&quot; style=&quot;width: 437px;&quot; class=&quot;moze-img-center&quot;&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;Figure 2 - Division in squares &lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt;In figure 2, the gradient from the right object was calculated and the result is the left object, then squares with a stipulated interval were created and the mean gradient in each square was calculated. The result is the middle object.&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt;By using this squares as guide to create the mesh, first a mesh with a certain density was created. This mesh would be to the zone with the highest gradient. Then, from those points, some of then were used in other intervals to create the other meshes densities. &lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt;This solution is just for the interior points since the exterior points were calculated the same way as 2D.&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt;By using the delaunay triangulation on those points the result is on figure 3.&lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/medium/3dmesh_step_malha.PNG&quot; style=&quot;width: 365px;&quot; class=&quot;moze-img-center&quot;&gt;&lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;Figure 3 - Mesh for the 3D&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt;This solution does not create a mesh as clean as 2D but the end result is what it was expected. By observing figure 4, it is possible to see that the number of points is higher than the zones with high gradient. &lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/medium/3dmesh_step_last.PNG&quot; style=&quot;width: 450px;&quot; class=&quot;moze-img-center&quot;&gt;&lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;Figure 4 - Result of the process&lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt;Another image, closer to the cam allows a better comprehension of the result. &lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/medium/3dmesh_step_malha2.PNG&quot; style=&quot;width: 531px;&quot; class=&quot;moze-img-center&quot;&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;Figure 5 - Result on an object closer to the kinect&lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt;Also the drawings for the temporary structure were finished. &lt;br&gt;&lt;/p&gt;</description>
            </item>
                    <item>
                <title>Fifth week</title>
                <link>http://laser.mozello.com/home/params/post/1140042/fifth-week</link>
                <pubDate>Tue, 28 Mar 2017 01:27:00 +0000</pubDate>
                <description>By doing the app using GUIDE on matlab, it was noticed that imaq.VideoDevice does not work like videoinput does, to show video on axes. This command was being used to capture the depth video from the kinect. By changing it to videoinput, problems appear on function depthToPointCloud that requires the information of the device. Then it was noticed that only when the preview of the imaq.VideoDevice was on, the IR emitter from the kinect was also on. When the IR emitter is turned on, by doing a preview of the videoinput, it takes a few seconds to get the depth image. A solution to keep the IR emitter always on, without the preview, was not found, but since the cameras would need to start with the app this would be irrelevant. This was only a problem when the script was executed without the app because the time it takes to get the depth cam to work was not constant. &lt;br&gt;&lt;br&gt;The first idea of app is on Figure 1, and for it to work, the imaq.VideoDevice command would be necessary to show the 3D cloud and the cloud gradient but since it was only for show and it&#039;s properties could not be changed, both images were removed.&lt;br&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/medium/app.PNG&quot; style=&quot;width: 466px;&quot; class=&quot;moze-img-center&quot;&gt;&lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;Figure 1 - First stages of the app&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt;Since it would need a way to connect to the arduino, send the mesh coordinates and do the necessary calibrations, more buttons would need to be added on the future.&lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt; It was also found a way to control the height of the camera. It was found that it only works when it is used to set the depth camera properties, since doing it on the RGB camera would result in an error. &lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt;By using the app, it was noticed that the control of zones was giving bad results. The figure 2 was made using surf command, so it does not show the gradient between height, it shows yellow colour represents the highest height and the blue the lowest. &lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/medium/zones.PNG&quot; style=&quot;width: 470px;&quot; class=&quot;moze-img-center&quot;&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;Figure 2 - Zones.&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt;The problem with the gradient was that even thou the surface shape could be seen in figure 2 very well, the result of the function gradient is on figure 3.&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/medium/gradient2.PNG&quot; style=&quot;width: 465px;&quot; class=&quot;moze-img-center&quot;&gt;Figure 3 - Gradient function&lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt;With these results, the first idea to separate the image based on its gradient, and then threat each zone as an object would work but it would take a lot of time to calculate and the result, possibly would not be as expected.&lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt;Also, the mesh processing was now done using exterior points based on the canny filter and the result was better. &lt;br&gt;&lt;/p&gt;&lt;p class=&quot;moze-center&quot;&gt;&lt;img src=&quot;//site-470199.mozfiles.com/files/470199/medium/canny_result.PNG?1491344357&quot; class=&quot;moze-img-center&quot;&gt;Figure 4 - Mesh using canny to find the contours&lt;/p&gt;&lt;p class=&quot;moze-left&quot;&gt;By testing it on the app, it was found that the result it produced were much cleaner on the contours than the function used before, but, it is just in 2D. &lt;br&gt;&lt;/p&gt;</description>
            </item>
            </channel>
</rss>