Group Assignment

Selecting the Machine to Design

We reviewed different options, to work with, and decide to work on a machine that could draw some geometric lines on "mates burilados" Peruvians handmade traditional crafts. are produced - gourds carving with exceptionally detailed representations of rural communities life. The gourds grow at the Peruvian coast, and they are sell as touristic handicraft. Thus we though that some carved lines could be produce with a machine. We look for examples, machines that could draw on irregular surfaces. Our instructor suggested to look for machines that draw lines on eggs. My classmate was in charge of looking for similar projects, that share some basic information on how to build them. He also found commercial options.

BENCHMARKING PROCESS

Sphere-O-Bot

It is a CNC machine design by JJRobots to draw basic figures on eggs. The key components in this design (as you can see in the picture) are:

The major barrier with this design was that we need to use a DEVIA Board, that is not available locally. However, we decide to test the framework’s design, like shown in the image below.


The EggBot Pro

This is a commercial device that allows to decorate different objects (that could be bigger that an egg). It uses a solid aluminium main frame and 2 high-torque precision stepping motors to control rotation on X axis and the movement on Y axis to generate the drawings. Also presents a pen lift mechanism using a microservomotor. It uses a 16× microstepping to give a resolution of 3200 steps/revolution in both axes.

We noticed that this design uses NEMA 17 Stepper Motor Mounting Brackets, similar to the ones used in some 3D printer modelss Which brings stepper motors stability within the whole mechanism. Thus, we decided to include this commercial elements to design our main frame, instead of printing them, in order to ensure stability, considering that rotation and Y movement at the same time could be challenging.

Engraving Easter Eggs with Laser machine

we found this variation of the egg-bot that includes a laser to engrave eggs, created by untitled.house and that you can find in its Youtube channel. Instead of a pen, it uses a water cooled 1 W laser diode. In this case the main frame is also made from aluminium.

This could be considered for a second stage of our project. In that case we will need to import the laser diode and test it with a different main frames and components.



MECHANICAL AND ELECTRONIC COMPONENTS

For this asignment we are allowed to use commercial devices, with our instructor support we select commercial boards and devices that we can use for this machine design. In this case, to build this XYZ Axis Plotter (CNC machine), all the mechanical and electronic devices that you’ll need to create this bot are:


Boards and Electronic Devices Technical Considerations

For this asignment we are allowed to use commercial devices, with our instructor support we select commercial boards and devices that we can use for this machine design. In this case, we will need to build XYZ Axis Plotter (CNC machine), so we will need to control stepper motors. Also, we will require a microcontroler which let us run GCode programing. As part of my contribution at this stage, I will provide devices's technical information, outlining the main characteristics that we will need to ensamble and programing it.

  1. Arduino Uno
  2. In our case we choose to use from the FabAcademy Inventory the Arduino Uno.This board, base on its data sheet information, equipped with the well-known ATmega328P and the ATMega 16U2 Processor. It contains everything needed to support the microcontroller; simply connect it to a computer with a USB cable, with a AC-to-DC adapter or battery to get started. (AC power plugs: used to connect devices to wall outlets. DC power Connector jacks:used to connect devices to power supplies or batteries). USB connectors: used to provide power to and transfer data between devices. One of the major feature of Uno Wifi is the support of OTA (Over-the-air) programming for Arduino sketches and for Wifi firmware. Recommended
    • ATmega328P, 8-bit AVR Microcontroller with 32K Bytes In-System Programmable Flash. The AVR (is a family of 8-bit and 32-bit microcontrollers developed by Atmel company, now part of Microchip) enhanced with RISC architecture (Reduced Instruction Set Computer). By executing powerful instructions in a single clock cycle, achieves throughputs approaching 1 MIPS (Million Instructions per Second) per MHz allowing the system designer to optimize power consumption versus processing speed.
    • ATMega 16U2, is a low-power CMOS (complementary metal-oxide-semiconductor)8-bit microcontroller based on the AVR enhanced RISC architecture. By executing powerful instructions in a single clock cycle. It achieves throughputs approaching 1 MIPS per MHz allowing the system designer to optimize power consumption versus processing speed. You can download the datasheet here here

    Arduino Uno has:

    • 14 digital input/output pins (of which 6 can be used as PWM outputs)
    • 6 analog inputs
    • 1 USB connection
    • 16 MHz ceramic resonator (electronic component consisting of a piece of a piezoelectric ceramic material with two or more metal electrodes attached. When connected in an electronic oscillator circuit, resonant mechanical vibrations in the device generate an oscillating signal of a specific frequency.)
    • 1 Power jack.
    • ICSP header: Stands for In Circuit Serial Programming, it is a standard way to program AVR chips. It is the ICSP header that allows the microcontroller to receive the firmware or program that does all the advanced functionalities that are desired
    • reset button

    Arduino Uno General Especifications

    Item Description
    Input Voltage (recomended) 7-12 V
    Input Voltage (limit) 6-20 V
    Power Consumption 130 mA (sleepmode 80mA)
    PCB Size 53.4 x 68.6 mm
    Weight 0.025 Kg
    RAM 8 MB instruction, 12 MB data
    Operating Conditions Min 40 °C (-40°F) and Max 85 °C ( 185°F)
    (VIN) Input voltage 6-20 V
    Imput voltage form USB connector 5.5V
    Product Code A000133

    Arduino ATMega328P Processor

    The Main Processor running at up to 20 MHz. Most of its pins are connected to the external headers, however some are reserved for internal communication with the USB Bridge coprocessor. omes preprogrammed with a bootloader that allows you to upload new code to it without the use of an external hardware programmer.

    Item Description
    Microcontroller ATmega328P
    Architecture Advanced RISC
    Operating Voltage 2.7V to 5.5V
    Flash Memory 32KB.
    SRAM 2KB
    Clock Speed 16MHz
    Digital I/O Pins 14, (2 serial communication - 2 external interrupts)
    Analog Input Pins 6
    Timer/Counter Pins 3
    Crystal Oscillator Pins 2
    EEPROM 1KB
    DC Current per I/0 20 mA

    Arduino ATmega16U2 Processor Especifications

    Item Description
    Processor ATmega 16U2
    Architecture RISC
    Operating Voltage 2.7 - 5.5V
    Operating Frecuency 8 Mhz at 2.7V & 16MHz at 4.5 V
    Operation Temperature Industrial (-40°C to +85°C)
    Data Memories 16KB on In-System Self-Programmable Flash
    EEPROM 512
    SRAM 512

  3. CNC controller written for Arduino’s
  4. In our case we choose to use from the FabAcademy Inventory the Arduino CNC Shield V3.00.This board, base on its data sheet information, uses opensource firmware on Arduino to control 4 stepper motors using 4 pieces of A4988 Stepper Motor driver breakout board, together with ArduinoUno, we can build all kinds of robotics, linear motion project or projects including CNC routers, laser cutters and even pick&place machines. It uses e software called GRBL. Arduino Uno that takes G-Code commands via Serial and turns the commands into motor signals.
    • GRBL, is a no-compromise, high performance, low cost alternative to parallel-port-based motion control for CNC milling. It will run on a Arduino (Duemillanove/Uno) as long as it sports an Atmega 328. The controller is written in highly optimized C utilizing every AVR-Chips feature to achieve precise timing and asynchronous operation. It is able to maintain up to 30kHz of stable, jitter free control pulses.It accepts standards-compliant g-code and has been tested with the output of several CAM tools with no problems. Arcs, circles and helical motion are fully supported, as well as, all other primary g-code commands.

    CNC Shield has:

    • GRBL 0.9 compatible. (Open source firmware that runs on an Arduino UNO that turns G-code commands into stepper signals)
    • 4-Axis support (X, Y, Z , A-Can duplicate X,Y,Z or do a full 4th axis with custom firmware using pins D12 and D13)
    • 2 x End stops for each axis (6 in total)
    • Coolant enable
    • Uses removable A4988 compatible stepper drivers. (A4988, DRV8825 and others)
    • Jumpers to set the Micro-Stepping for the stepper drivers. (Some drivers like the DRV8825 can do up to 1/32 micro-stepping)
    • Stepper Motors can be connected with 4-pin Molex connectors or soldered in place.
    • Runs on 12-36VDC. (At the moment only the DRV8825 drivers can handle up to 36V)
    • Reset button

    CNC Shield Specifications

    Item Description
    Input voltage: 12-36V
    Motor drivers: Supports up to 4 stepper motors
    Stepper motor driver: Compatible with A4988/DRV8825 motor drivers
    Power supply: One terminal block is available for connecting the external power supply
    Pin headers: Expansion headers for adding additional functionality such as limit switches, end stops, and spindle control
    Compatibility: Compatible with the GRBL firmware and other popular CNC software

    CNC Shield Other Considerations

    • The CNC Shield has Jumpers, used to configure the 4th Axis, Micro stepping and endstop configuration. Each axis has 3 jumpers that can be set to configure the micro stepping for the A4988 plug-in driver board. You can look for data sheet information. Using two jumpers the 4th axis can be configured to clone the X or Y or Z axis. It can also run as an individual axis by using Digital Pin 12 for Stepping signal and Digital Pin 13 as direction signal.
    • Limit switch pins have been doubled up so that each axis has a “Top/+” and “Bottom/-“. This makes it easier to install two limit switches for each axis. (For use with a normally open switch)
    • It also presents end Stops, by default GRBL is configured to trigger an alert if an end-stop goes low(Gets grounded). End-stop switches are standard “always open” switches. An End-stop gets activated when the end-stop pin connects to ground(When setup with default GRBL settings).
    • EStop pins can be connected to an emergency stop switch. This does the same as the RESET button on the Arduino board.
    • Presents spindle and coolant control pins.
    • External GRBL Command Pins have been broken out allowing you to add buttons for Pause/Hold , Resume and Abort.
    • Serial Pins (D0-1) and I2C Pins (A4-5) have their own break out pins for future extensions. I2C can later be implemented by software to control things like spindle speed or heat control.

    Osoyoo web, provides this information, and a guideline for hardware installation.

  5. DRV8825 Stepper Motor Driver Carrier, High Current (Header Pins Soldered)
  6. The DRV8825 provides an integrated motor driver solution for printers, scanners, and other automated equipment applications. The device has two H-bridge drivers and a microstepping indexer, and is intended to drive a bipolar stepper motor. The output driver block consists of N-channel power MOSFET’s configured as full H-bridges to drive the motor windings. The DRV8825 is capable of driving up to 2.5 A of current from each output (with proper heat sinking, at 24 V and 25°C).
    A simple STEP/DIR interface allows easy interfacing to controller circuits. Mode pins allow for configuration of the motor in full-step up to 1/32-step modes. Decay mode is configurable so that slow decay, fast decay, or mixed decay can be used. A low-power sleep mode is provided which shuts down internal circuitry to achieve very low quiescent current draw. This sleep mode can be set using a dedicated nSLEEP pin. You can find the datasheet here

  7. NEMA 17 stepper motors
  8. This product offer a shaft motion consists of discrete angular movements of essentially uniform magnitude when driven from a sequentially switched DC power supply, such being describe at Electromate.com . It works with digital signals. One digital pulse to a step motor drive or translator causes the motor to increment one precise angle of motion. As the digital pulses increase in frequency, the step movement changes into continuous rotation. So we can test it at full motion. It has windings in the stator and permanent magnets attached to the rotor. It provides fixed mechanical increments of motion (referred as steps, and generally specified in degrees). They are considered ideal for applications that require quick positioning over a short distance, Allowing the use of an open-loop controller, which simplifies machine design and lowers cost compared to servo motor systems.

    This device holds a NEMA denomitation, that accounts for the National Electrical Manufacturers Association acronym. This mean that is standirized motor size, including designations that can help as learn more about the size and capability of practically any particular motor. Step motors are categorized by NEMA frame size, such as "size 11" or "size 23" or “size 34”. NEMA 17 stepper motors are those that have a 1.8 degree step angle (200 steps/revolution) with a 1.7 x 1.7 inch faceplate. They typically have more torque than smaller variants, such as NEMA 14 and have a recommended driving voltage of 12-24V. These steppers are also RoHS compliant (acronym for "Restriction of Hazardous Substances." A European Union directive that regulates the use of certain hazardous substances in electrical and electronic equipment - EEE).

    Stepper Motor Specifications

    Item Description
    Model No. JK42HS25-0404
    Step Angle 1.8°
    Motor Length 25 (L)mm
    Current/Phase 0.4 A
    Resistance/Phase 24 Ω
    Inductance/Phase 36mH
    Holding Torque 1.8 kg.cm
    # of Leads 4
    Detent Torque 75 g.cm
    Rotor Inertia 20 g.cm
    Mass 0.15 Kg/td>
  9. MICRO SERVO SG90
  10. Tiny and lightweight (it will fit in small places) with high output power. Servo can rotate approximately 180 degrees (90 in each direction), and works just like the standard kinds but smaller. You can use any servo code, hardware or library to control these servos. With feedback & gear box. In our case it came with a 8 different horns models (arms). We decided to use the one thah only have one arm. Regarding arms positions, it is necessary to highlight:

    • Position "0" (1.5 ms pulse)
    • Position "90" (~2ms pulse) is middle, is all the way to the right
    • Position "-90" (~1ms pulse) is all the way to the left

    You can find the datasheet here .

    Microservo SG90 Specification

    Item Description
    A (mm) 32
    B (mm) 23
    C (mm) 28.5
    D (mm) 12
    E (mm) 32
    F (mm) 19.5
    Speed (Sec) 0.1
    Torque (kg-cm 25
    Weight (g) 14.7
    Voltage 4.8-6

Hooking Up the Stepper Motor to CNC Shield

The purpose is to connect steppers motor to CNC Shield board as the below block diagram, that shows the CNC Shield connected to 3-stepper motor:

Item Description
PWM Microstepping Stepper Motor Driver Built-In Microstepping Indexer / Up to 1/32 Microstepping
Multiple Decay Modes Mixed / Slow / Fast
Operating Supply Voltage Range 8.2-V to 45-V
Reference Output 2.5-A at 24 V and TA = 25°C
Reference Output Built-In 3.3-V
Body Size 9.70 mm × 6.40 mm

Programming Set-Up

To control de CNC we are using 3 key programs, I was in charge of defining how to use:
  • Inkscape for G-Code Generation.
  • Universal Gcode Sender.
  • Inkscape for G-Code Generation. Like suggested by Elliot Williams, we follow his instructions on how to generate G-Code using Inkscape and also complement the information with Ignacio Rojas YouTube Channel.
    1. First you need to set up the graphic dimensions, thus, you need to set them them into the gourd. We assume a cylindrical shaped as a geometry, and mesure the perimeter and height that we will manage to generate the drawing. We stablish a 270x40mm area.
    2. Then, we set the 270x40mm area into a new document properties.
    3. Then you need to generate the drawing, you can use part or the total working area. The figure bellow shows the process.

    4. We used Gcodetools extension within Inkscape to generate de G-Code. For this process you need to:
      • From the Gcodetools Menu select the option “Tools library” (fig a)
      • Then a option window will open
      • Here you need to select the kind of tool type, in our case we select cylinder (Fig b).


      • This process brings you the tool features (a green box will appear in your screen). Here it is recommendable to change the feed feature (it will appear with 400) to accelerate the three axes movements.


      • Then we need to set orientation points (XY coordinates origin). Select extensions > Gcodetools>Orientation Points.
      • A new option window will open, and you only need to click apply (maintain default option) (Fig a).
      • The orientation coordinates will appear in the bottom left point of origin (Fig b).


      • You need to ensure that your images are grouped and that you turn them into vectors.
      • Then to generate the GCode first we select the images then, go to extentions>Gcodetools>Path to Gcode
      • A new option window will open (Fig a) < select preferences and here we must change “Z safe height” option (height that will achieve Z axis tool to change position). By default, appears 5mm, we must increase this number being sure that it needs to be a positive number. You have to acknowledge that this number will affect drawing time. So we set it up to 1mm (Fig b).
      • In preferences option you have also to select the folder to storage Gcode files


      • Then you need to return to Path to Gcode option and click apply.
      • A .ngc extension file will be created.
  • Universal Gcode Sender. This program connects the computer with Arduino GRBL. You need to download the program from here.
    1. The program is available in GitHub, two options are available. The UGS classic and UGS Platform. In our case use the last one because it runs without installation. Download the files and go to bin execute ugsplatform64.exe
    2. The UGS program will open and to set up the connection we need to select 115200 Bauds, port, and firmware (those options are located down the main menu).


    3. Then we need press the Connect or Disconnect button.
    4. We need to configure the GRBL parameters. Thus, send $$ command.
    5. With that command the program will echo a list of parameters. Between those, we need to focus on the ones labelled as $100 to $132 parameters (see the following picture)
    6. To send our drawing we change only six (06) specific parameters:
      • $100: X Axis Travel Resolution: 11.85 step/mm (We devided 3200 microsteps / 270mm).
      • $101: Y Axis Travel Resolution: 12 step/mm. Our Y axis has 40° movement (480 microsteps to cover 40 mm length).
      • $110: X Axis Maximum Rate: 20,000 mm/min (we test different velocities and set it more efficiently).
      • $111: Y Axis Maximum Rate: 20,000 mm/min (we test different velocities and set it more efficiently).
      • $120: X Axis acceleration – 1000 mm/sec2.
      • S121: Y Axis acceleration – 1000 mm/sec2.


    7. Then open the .ngc extension file created previously.
    8. Then click play button. The CNC will start drawing, like shown down below.