Machine Assignment I worked in Automation of the Machine

Norway

Assignment 15

This is my contributions to the group machine .. Which is our machine is a Plotter that A Changable Head
This is the Machine Page ..

So My task is to make the Interface with the machine ..
Information I needed to start Work :

Working Area Size : A4
What type of Gcode we will use : MI-GRBL


I thought about Interfacing to make it for the machine without using any other software ..
So I thought about Make 2 ways to take pictures ..
1) Through the Camera of the laptop
2) Through Importing a camera

So lets start with how to work with the machine ..
I start Setup the Enviroment I wil work on .. I start Working with Python and Opencv for Imageprocessing .. And Start Coding


I started here to Get Streaming from Camera ..


I Started Here to read Images ..
Then Start Testing the Threshoulding Techniques that compitable with me ..





This is the Final Results I was Happy to get ..
Then I started To get the Pixel Matrix From it ..


Then I succedded


Then I started Understanding the Output files That comes out From Inkscape as Haitham Told Me they worked Very Well ..

So I think about understand how it works ..


Then I start Making My GCode Generator for This GRBL ..


And this 2 Functions were to draw Pixels step by step One Down or Up ..
Then I thought about make it more eaisly to make it in One Function by sending 2 Points Up Or 2 Downs as Starting and Ending ..
So I made this Function ..

Then I start Adding 2 Ways Working .. As those Draws , Movejog and Algorithm ..


After I knew that It is so hard to make it to pictures .. SO I thought to make Shapes .. After A lot of testing on 640 * 480 Pixels and 24 *24 Pixels ..
All Failed As the machine There are a problem with the Y Problem “ The End Effector Connected to “ It cant handle a Very Small Steps after Configuring it with $101 = 10 For example and Start vibrating As I think the Stoping Tourque is Very High So we need more voltage to come over it or give a full Step + there are a problems with fricitions …











As I used in cad week Openscad I thought to use part of it to draw something with machines ..
So I took the Equations that I make to draw it ..
Then I started to implement it .. like This




Then I start To Add Some Screws to make the Endeffector more Stable with the motor as I am trying On wood and then paper ..

After That It works Very Well ..
Advanges that we did :

1) We make multiple ways to control the machine from writing Gcode manually to use Inkscape using Extenstion to use Python Generator Code to use Openscad Code to Use Impage processing and start generating Gcode for Pictures

2) We used a Different GRBL that Called MI GRBL that control Servo Motor instead of Stepper Motor in Z

3) We Make a Automatic Stop Sensor with a good mount in the machine and Working Great

4) The Pen Mount Was great But because It was damaged so we had to fix it manually to can works in Integration and Programming




challenges with the machine :

1) there were a problem with the mechanical Design that it was very high and without a fixed bed to work with ..

2) the design of the pen holder was cracked and we Fixed it Manually to get it work

3) there was a huge frictions between screws that can't help the motors do a small moves so we cant draw pictures on .. because the smallest step was 1 cm and all the bed the machine can cover is A4 paper

4) we didnt have a lot of details about the mechanical Design and Edit it as the one who was responsible for the assignment dropped out

5) the machine need to have a base to can stand at .. with any strong move the machine can fall dowm




Details About The File Attatched ..

Code 1 : Get Threshoulded Picture took alive from Built in Camera and Export from it a GCODE and Pixels color .. Is it a black or white ? ..
Code 2 : Sending alive Gcode to the GRBL and Machine start working ..
Code 3 : Generate a Gcode from Openscad’s Code “ Generating Points Of polygon For Example “ And start Drawing it easily ..
Code 4 and 5 : Took 2 Photos that can be 640 * 480 for the first code and Second Code is to be a Icon 24 * 24 And Generate the Gcode
Code 6 : There are 2 Algorithms First One draw pixel by Pixel .. Codeand the other one is getting the black lines and Drawing it ..
Issues You may Face :
1) Is the $100 and $101 Values To make the Machine Precise ? More Small Value is better to get a great value ..
2) Is their a Servo in the Design As here in Egypt we used the M5 and M3 S90 To control The servo ..
if the Pen is fixed There will be no Need to use M5 and M3 Codes ..
Recommendations :
Try to Use the Code of the Icon as It generate a Small Gcode and Make a quick Pilot for it
There is a Code Called the Perfect Code I recommend to use it ..
That is all
The link For Python Codes