17. Machine design & Mechanical design¶
This week we made a machine!!!!
In this assigment I focused on making the electronics of the machine work and it was quite a headache, I have never progeamed anny machine and its not an easy task.
We decided o use an Arduino Uno with a CNC shield to controll all the motors, using GRBL optimized to control a servo. at first sight was quite an easy task but I found out really fast that is was not going to be as sataigt forward as I was planning.
The first thing that I found it was not working was that the servo, it did not move at any moment and I thought that the problem was because the GRBL that I uploaded so, I started reading lots of isues from other people that was commenting more or less the same problem as me, but noting worked. The servo was still static and I did not know why. After some more reading and thinking from where the problem may come from I realized that the gcodes I was generating where not sending any message before and after each line to move up and down the servo. Then I jumped to look for the gcode that may move the servo, M3 to activate m3 s180 to move up m3 s0 to move down and M5 to stop the servo. This solved my first issue.
To sovle this I modified the way on creating the gcodes in InkScape, to generate the codes I use an extension for gcode generation that is quite easy, you can find lots of tutorials in the web, the thing is that you have to modify an option that let you add a line of code in the begining and at the end of each vector. At the begining of each vector we are going to put the servo at the down position in order to make the comb scratch the surface of the water and move the servo up when the line finish. This options can be modified and saved in the folder where Inkscape saves the python scripts of the extensions, the file you want to change is named gcodetools.py
Second the hard limits of the machine were triggered when were not supposed to be, this is still a mistery but the thing that may cause this is the wiring of all the macine because, the whole machine is wired with short jumper cables that are conncted each other and holded with some heat shrink tubing.
All this mess of jumpers may cause some noise and the arduino is reading as is the end stops were triggered. This still have to be solved but for the moment I am using the machine with the hard limits desactivated.
I focused on tidy the cables and making a little bit everyting more presentable. making some PCB to distribute the cables from one place to the other.
Files¶
Outline cable tidy Traces cable tidy Outline join motors traces join motors support comb