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.

Boards and Electronic Devices

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