WEEK 15 AND 16 - MECHANICAL AND MACHINE DESIGN


INTRODUCTION

In this week assignment we chose to create X-Y AXIS PLOTTER, we decided to use an Arduino UNO + CNC Shield and two Pololu stepper carrier drivers. In this page I will ONLY document my individual contributions within the team to create the machine but higher overall view about the machine and the tasks performed can be found in THIS PAGE. This week is not ONLY about technically be able to master creating a mechanical and machine design, it is also about how to manage to work as a part of a team and master the skills needed to collaborate with others to get your work done.

Assignment Description

  • WEEK 15 - MECHANICAL DESIGN: To design a machine (mechanism + actuation + automation), including the end effector, build the passive parts and operate it manually.
  • WEEK 16 - MACHINE DESIGN:: To plan and make a machine. Document the group project and your individual contribution.

Learning Outcomes

  • Work and communicate effectively in a team and independently.
  • Design, plan and build a system.
  • Analyse and solve technical problems.
  • Recognise opportunities for improvements in the design.

Have you (Checklist)

  • Explained your individual contribution to this project on your own website.


MY CONTRIBUTION:


My contribution was in the Second-Week in the automation phase, I was responsible for OUTPUT programming part where I did the following sub-tasks:
  • Install and connect Arduino, CNC-Shield, Motor Drivers, Stepper Motors and Servo Motor.
  • Install and configure GRBL Firmware and find a solution to enable GRBL to handle the Servo mechanical movements.
  • Create a simple drawing, convert it to G-code, send it to Arduino and the CNC shield to execute.
  • Configure and fine tune the GRBL code / configuration to adjust the motor steps and the end-stops

STEPS PERFORMED:


TOOLS AND HARDWARE USED (COMPONENTS):

SOFTWARE AND APPLICATION USED:

MI-GRBL FIRMWARE INSTALLATION :

  • The normal GRBL firmware drive stepper motors, and since we have 2 stepper motors and 1 servo motor, we will need a modified GRBL firmware that can send special commands to move the Servo motor.

WHAT IS GRBL?
Grbl is a free, open source, high performance CNC milling controller written in optimized C that will run on a straight Arduino. It is a firmware that controls stepper motors and spindles/lasers. GRBL uses gcode as input and outputs signals via the arduino pins.


  • Download the MI-GRBL library from THIS LINK
  • Unzip the library file and copy the main folder into the “Libraries” folder in the folder you installed your Arduino software. Eg. C:\arduino-1.0.3\libraries\
  • Connect the Arduino UNO Board to your PC.
  • Open up the Arduino IDE -> menu : File -> Examples – > -grbl-mi -> grblUpload
  • Upload the sketch
  • Now you have the GRBL-MI Firmware uploaded to your Arduino Uno Board!


  • To test that the firmware is installed successfully, go to Tools -> Serial Monitor
  • Adjust the baud rate to 115200 and choose from the drop menu in the bottom-right "Both NL and CR", you should see the following as per the image below:

  • If you typed the $$ command in the Serial Monitor and pressed ENTER, you will see all the default GRBL configuration


CONNECTING THE CNC-SHIELD AND WIRING THE MOTORS :

  • Slide your CNC shield onto your UNO board making sure the pins are fitted as per the image below, where the power socket of the arduino is above the power of the CNC-Shield

  • Next add the DRV8825 Drivers to the X-axis slot in the CNC-Shield. On the back of the Drivers you will see the PIN identification. The enable pin must match the EN pin on the shield.
  • Repeat the previous Step to connect the second DRV8825 unit to the Y-axis slot in the CNC-Shield
  • Now you can fit the heat Sink to the DRV8825

  • Connect the Stepper motors, the Servo motor and the 12v Power Supply as per the connection drawing below.

POWER SUPPLY TIPS: I initially installed a 12 Volts / 1 Amp power supply but I noticed that it Only drive one stepper at a time but not both. Then I used another Power supply 12 volts / 1.5 Amp and it did work fine.


  • Repear the previous Step to connect the second DRV8825 unit to the Y-axis slot in the CNC-Shield
  • Now you can fit the heat Sink to the DRV8825


GETTING FAMILIAR WITH G-CODE

WHAT IS G-CODE?
G-code is a language in which people tell computerized machine tools how to make something. The "how" is defined by g-code instructions provided to a machine controller (industrial computer) that tells the motors where to move, how fast to move, and what path to follow.


  • I did not use G-Code before and accordingly I wenth through THIS SITE to learn more about G-Code.
  • I read also about how the GRBL can be modified to enable the CNC-Shield to deal with the STEPPER motos and I found that there are versions of GRBL that have modified functions that controls the spindle and modified the code so that it send PWM to the SERVO. In Our case in the MI-GRBL the M5 command in G-Code is modified to move the servo to 0 degrees (i.e: Pen up) and M3 S90 command is modified to move the servo to angle 90 (i.e: Pen Down)
  • Based on the previous fact, there are 2 ways to work with the CNC-Shield and a servo motor:
    • First Approach: To use a MI-GRBL firmware and InkScape Extension that create a G-Code that the MI-GRBL can understand
    • Second Approach: To use a MI-GRBL firmware and do a manual post processing to any G-Code to inject the M5 and M3 commands.

INSTALLING INKSCAPE MI-GRBL EXTENSION (TO GENERATE G-CODE):

  • If you do not have inkscape installed, then go to THIS LINK and download Inkscape then install it.
WHAT INKSCAPE VERSION TO DOWNLOAD?
Avoid downloading the latest version (i.e: Version 0.92). I initially downloaded the latest version and the MI-GRBL extensions gave a lot of errors. When I browsed to find a cause I discovered that hte latest version is not stable and a lot of extensions do not work with it. It is recommended to work with Version 0.91

  • We will be using INKSCAPE software to make G-code, but as we are using GRBL and CNC Shield for this machine as well as a servo motor, the normal G-CODE generator will not work
  • Download the MI-GRBL extension from THIS URL -> Unzip the file -> add the uncompressed files to the inkscape directory>Share>Extension folder
  • Open inkscape, set page size to 40 x 40mm
  • Draw a 20 mm x 20 mm Square -> select image -> convert to path
  • Go to extension menu -> click on MI GRBL Z-AXIS SERVO CONTORL and sunsure the following values are set in the resulting dialogue box
    • Servo up = M3
    • Servo down = M5
    • X-axis speed = 2000
    • Y-axis speed = 2000 S
    • Servo angle = 90
    • Delay = 1
  • Click on APPLY NOW, your G-code is saved at the location you mention.



SENDING THE GCODE FILE TO ARDUINO AND CGBL CONFIGURATION:

  • To stream and send G-CODE file to Arduino, I will use Universal Gcode Sender, Download the software from THIS LINK, then install it.
  • Open Universal G-code sender (Arduino must stay connected with PC/LAPTOP) and Select COM port (where the Arduino is connected)
  • Set Baud rate to 115200, clik on "OPEN"
  • Go in "COMMANDS" Tab, enter $$ for GRBL configuration and hit ENTER. The following will be displayed.


  • To test that the motors and the CNC-Shiled are working, go to the Machine Control tab -> Click on the arrows X+, X-, Y+ and Y-.
  • You should be seeing the motors moving


  • Finally to send a file:go to "FILE MODE" tab, browse to your Gcode file and then hit enter.


CONFIGURING AND CONNECTING THE HARD-LIMIT CIRCUIT:

  • Defore connecting the hardlimit Switch that my Colleague Khaled created, I wanted first to enable the hard-limit sensing in the GRBL, to do so follow the Following steps:
    • Open the universal GCode Sender and connect to the port where the Arduino is connected to, go ro command mode and type $$ then press enter.
    • From the resulting configuration, the hard limit is $21,In the command mode, type "$21 = 1" to enable this option and press enter
    • Now once I set the PIN Y+ (limit Switches Section in the CNC-Shield) to LOW, the "ALARM HARDWARE LIMIT" message appears in the Universal GCode Sender software.

REWORK NEEDED!!:
I discovered that Khaled set the triggering signal coming out from the limit switch to High. As per THIS LINK, By default GRBL is configured to trigger an alert if an end-stop goes low(Gets grounded). In CNC-Shield V3.02 There are jumpers enables the triggering signal to be high but this Jumper was only introduced in Version 3.02 and our CNC-Shield is earlier than this version. So I asked KHaled to re-program the sensor to trigger Low instead of High

  • Final result of the machine drawing a 1 CM x 1 CM square is as follows:

Files: