Week 7: Computer Controlled Machining

This week, the task was to design a furniture piece of our election, cut it using a router CNC and assemble it. Group assignment Week 7

CNC Router

CNC stands for Computer Numerical Control. It refers to machines that are controlled by code to automate tasks like cutting, drilling, and shaping as part of a digital manufacturing process. A CNC machine is essentially a computer that takes code and turns it into motion.

Types

  • Milling machines: Versatile CNC machine tools that carve 2D and 3D shapes out of metal, plastic, or wood, including milling in 3-, 4-, and 5-axis configurations for more complex geometry and fewer setups.

  • Additing manufacturing machines: Additive manufacturing (AM) machines, or 3D printers, create 3D objects from digital files by depositing materials in layers. For more datails you can go to my Week 5.

  • Laser Cutting Machines: Are Computer Numerical Control (CNC) tools that use a high-powered, focused laser beam to cut, engrave, or mark materials with high precision and speed. For more datails you can go to my Week 3.

CNCs use to types of code, G-CODE and M-CODE:

G-CODE is a programming language for CNC that instructs machines where and how to move. The G in G-CODE stands for "Geometric" because is the type of movement the code produces.

G-CODE
N## G## X## Y## Z## F## S## T## M##
N##: Line Number.
G##: Motion.
X##: Horizontal Position (X axis).
Y##: Vertical Position (Y axis).
Z##: Depth (Z axis).
F##: Feed Rate.
S##: Spindle Speed.
T##: Tool selection.
M##: Miscellaneous functions.

M-CODE is a programming language for CNC that instructs machines on what to do. The M-CODE has miscellaneous functions, bit it doesn't instructs on where to go.

Miscellaneous functions
M00:Program stop.
M01:Optional program stop.
M02:End or program.
M03:Spindle on clockwise.
M04:Spindle on counterclockwise.
M05:Spindle stop.
M06:Tool change.
M07:Flood coolant on.
M08:Flood coolant off.
M30:End of program / Return to start.
M41:Spindle low gear range.
M42:Spindle high gear range.

Design

Stress Analysis

My idea from the start was to build a piece of furniture with three specific functions: to serve as a bench press so I could do pec exercises at home, a place to store my dumbbells, and finally, a bench so more people could sit in my living room.

That is why it was important to calculate the structural strength so that it could support at least 100 kg. I used the next formula:

\frac{5\omega L^{4}}{384\varepsilon I}
Fab

Steps to add a library

Fab

1. In the initial menu, click on the section Plugin and Content Manager.

Steps

Fab

2.After clicking on the section, another menu will appear where we can see the Plugins and libraries supported by KiCad.

Steps

Fab

4. Finally, we must go to the Libraries section and write KiCad FabLib. The Fab Academy library will appear and we just have to click install.

Base

Fab Fab

1. First, I created a center point rectange in the top plane.

Base

Fab Fab

1. First, I created a center point rectange in the top plane.

Create a project

To create a new project we have to click on File placed in the top left corner and select New Project.

Fab

Steps to create a new project

Fab

2.Subsequently, a Folder will be created. We will have to write the name of the new Folder and choose the place were it will be saved.

Steps to create a new project

Fab

3.Finally, the new project folder will be added and the next step is design the Schematic.

Project Design

My projects name is FAB_PCB. To begin the desgin we have to select the Schematic Editor.

Fab

Schematic Design

Fab

1. Once in Schematic Editor a board will appear.

Schematic Design

Top Tools

Fab
Top Tools Save. Save changes.
Schematic Setup. Edit the Schematic Setup.
Page Settings. Edit the format of the page.
Print.Print the page.
Plot.Plot the page.
Paste.
Undo/Redo.
Find/Find and Replace. Allows to find a component and replace it.
Refresh.
Zoom (5).
Navigate (3).
Rotate clockwise/counterclockwise.
Mirror Vertically/Horizontally. Flip selected items.
Symbol Editor. Create, Delete and Edit Schematic Symbols.
Symbol Library Browser. Allows to watch the list of components included in the program and edit them.
Footprint Editor. Create, Delete and Edit board Footprints.
Symbol Editor. Create, Delete and Edit Schematic Symbols.
Electrical Rulechecker. Runs a test(ERC) and looks for mistakes in the Schematic.
Simulator.Shows the SPICE or IBIS simulation.

Schematic Design

Right Side Tools

Fab Fab

Right tools are for the Schematic Editor section.

Right Tools Select item. Allows to select items.
Highlight Nets. Highlight wires and connections between items.
Place Symbols. Place components.
Place Power Symbols. Place Power and Ground Symbols.
Draw Wires.
Draw Buses.
Place Wire to Bus Entries.
Place No Connect Flags. To show the pins that don't have any use.
Place Junctions. Place unions between wires and items.
Place Net Labels.Assign Net tags to make connections.
Place Directive Labels. Assign Directive tags to make connections.
Place Global Labels. Assign Global tags to make connections.
Place Hierarchical Labels. Assign Hierarchical tags to make connections.
Draw Hierarchical Sheets. Draws a box of Hierarchical items.
Place Sheet Pins.
Sync Sheet Pins. Synchronize sheet pins and Hierarchical Sheets.
Text.Add text.
Draw Text Boxes. Draws a box with a label.
Draw Tables.

Schematic Design

Left Side Tools

Fab Fab

Left tools are for the PCB Layout section.

Left Tools Show Grid. Display background grid in the edit window.
Grid Overrides. Enables item-specific grids that overrides the current grid.
Polar Coordinates. Switch between Polar and Cartesian Coordinates.
Inches. Changes de board units to inches.
Mils. Changes de board units to mils.
Milimeters. Changes de board units to milimeters.
Full-Windows Crosshairs. Switch display of full-window crosshairs.
Constrain to H, V 45. Limits actions to horizontal, vertical or 45 degrees from the starting point.
Show Ratsnet. Show lines or arcs that represent missing connections on the board.
Curved Ratsnet Lines. Show ratsnet with curved lines.
Inactive Layer View Mode. Toggle inactive layers between normal and dimmed.
Draw Zone Fills. Show filled areas on board.
Draw Zone Outlines. Show only zones boundaries.
Sketch Pads. Show pads in outline mode.
Sketch Vias. Show vias in outline mode.
Sketch Tracks. Show tracks in outline mode.
Appearance. Show/Hide the appearance manager.

Schematic Design Steps

Fab Fab

1. First, we have to add the components we intend to use with the Place Symbol tool.

Choose Symbol.A menu will appear, with a search engine and a list of components on the left-hand side. On the right-hand side, you can see the symbol and footprint of the components you select. It is preferable to select those that have a symbol and footprint.

Schematic Design Steps

Fab

2. Then place the components on the board. I used only components that are in the Fab library.

My components Micro USB. It will act as my power source.
AMS1117. It is a power regulator that recives a 0 - 12V input and gives an output of 3.3V that I used to power my circuit. AMS1117 Datasheet.
WS2812B. It is a intelligent control LED light source that the control circuit and RGB chip are integrated in a package of 5050 components. It internal include intelligent digital port data latch and signal reshaping ampli fication drive circuit. WS2812B Datasheet.
4 pins button. It is a button with four pins, 2 connected linealy between each other.
XIAO RP2040. It is a small microcontroller that carries the powerful Dual-core RP2040 processor that can flexible clock running up to 133 MHz which is a low-power microcontrollers. On the Seeed Studio XIAO RP2040 there is also 264KB of SRAM, and 2MB of on-board Flash memory which can provide more program to save and run. On the other hand, this little board has good performance in processing but needs less power.XIAO RP2040 features.
1206 Ceramic Capacitor. It is a passive, two-terminal electronic component that stores electrical energy temporarily. 1206 SMD components typically meassure 3.2mm X 1.6mm (0.126 X 0.063 inches).
1206 Resistor. It is a passive, two-terminal electrical component that implements electrical resistance to limit or regulate the flow of electric current in a circuit.

Schematic Design Steps

Fab Fab

3. Then I added the corresponding connections according to my purpose.

Power and regulation.To power my circuit, I placed the micro USB port and connected it using two global ground and 5V labels, which is the initial voltage I intend to supply to my circuit. I left the other pins, which are for data transfer, with a No connection flag, indicating that they will not be used. To regulate and reduce the initial voltage I used the AMS1117. It requieres two capacitors for device stabilty, one in the input an one in the output. The one in the input is of 10µF and the one in the output of 22µF.
LED arrangment. the LED arrangement, I selected WS2812Bs because they are RGB and can change color through programming. I connected them to a pin on my Xiao using a resistor and a label, then connected the LEDs in series and connected the first power pin to a capacitor for component safety. Finally, I left some holes so that more LEDs could be added if desired.

Schematic Design Steps

Fab Fab
XIAO RP2040. I connected the XIAO to the output voltage given by the AMS1117 and to the global ground. I also connected the LEDs to one pin of my XIAO and my buttons to its respective pin.
Buttons. The arrange of the buttons is pull-down, in order to read 0 while not clicking on it and read active while clicking it.

PCB Design

Fab Fab

1. In the top menu of the Schematic Editor on the far right is a green symbol that opens the PCB Editor.

Most important tools for PCB edition

Fab
Top tools Footprint Editor. Create, delete and edit a footprint.
Footprint Library browser. Display the full list of components footprints.
3D Viewer. Show 3D viewer window.
Update PCB from Schematic. Update PCB with changes from Schematic.
Design Rule Checker. Opens the rule checker window.
Switch to Schematic Editor. Return to the Schematic section.
Scripting Console. Show the Python scripting console.
Fab
Right tools Select Item.
Local Ratsnet. Display the full list of components footprints.
Place Footprint. Toggle Ratsnet display of selected components.
Route single track. Wires the components.
Tune lenght of a single track.
Place Vias.
Draw Filled Zones.
Draw Rule Areas.
Draw Polygons.
Draw Bezier Curves.
Place Reference Images.Add bitmap images.
Draw Text.
Draw Text Boxes.
Draw Tables.
Draw Orthogonal Dimensions.

Layers.Determine the layer where the path will be.
Objects.Sets the opacity and which elements of the PCB can be seen.
Nets.Establishes the networks of the components and their visualization.

PCB Design

Fab

2. In the PCB Editor, using the Update PCB from Schematic tool the components can be added or updated.

Fab Fab

PCB Design

Fab

3. Then, using the Route single track tool, we can route the electronic connections between components.

Fab
Calculator tool. Before defining the size, it is important to calculate it using the calculator tool given by KiCad. To do that we first have to go to the start menu and open the Calculator tool.
Then add the Current (I) and the Temperature rise we are expecting our PCB to have and look fo the result the calculator will give back to us in the right top side. The calculator works by using a formula explained at the bottom.
Fab Fab
Track thickness. To change the track thickness we must go to the top tool section and click on Track use netclass width. Subsequently, select Edit Pre-defined Sizes.
Fab
Track thickness. Inside that section we can add tracks sizes by clicking the + symbol located at the bottom of the window, and in the width section we can change the width of the new track we added. Then we'll just have to click Ok.

PCB Design

Fab

4. Then we have to choose the thickness we have already created and start connecting the components. KiCad will show us where we should connect our items, so it is very intuitive. For default the net where the tracks are is F.CU, we must left it there because that is what the program interprets as the tracks.

Fab Fab

5. After tracing the tracks between our items, we have to draw the border of the PCB. For that we have to use the Draw Polygons tool and surround our items. We must change the net to Edge.Cuts.

Fab

6. Then we have to change the width of the polygon by right-clicking the shape and selecting properties. I use a width of 1 mm.

Fab Fab

7. Finally we have to add a filled zone. to do that we have to use the tool with that name and draw it inside the PCB, then a window will appear and we'll have to leave it without any net.

PCB Design

Fab

8. see how the PCB will look, we have to use the 3D Viewer.

Fab

NI Multisim

NI Multisim

NI Multisim is a powerful industry-standard SPICE simulation and circuit design software developed by National Instruments.

CS

Schematic

Fab

1. We have to open NI Multisim and a board will open.

Schematic

Fab

2. Above is a bar with components to simulate. We have to click on the symbols to choose thwe type of component we want to use.

Component bar

Fab

Source. The source components are the ones that power the system. In the left side list we can choose a specific type of component, in the center top we can search for a specific component of the family and in the right side we can see the symbol and place the component in the board. This repeats in each section.

Fab

Basic. These are the basic components such as resistors, buttons, capacitors, etc. We can select the specific family in the left list.

Component bar

Fab

Diodes. A diode is an electronic component that allows current to flow in only one direction, making it essential for various applications in electronics. We can select LEDs, SCRs, FWBs.

Fab

Transistors. These are the basic components such as resistors, buttons, capacitors, etc. We can select the specific family in the left list.

Component bar

Fab

Diodes. The source components are the ones that power the system. In the left side list we can choose a specific type of component, in the center top we can search for a specific component of the family and in the right side we can see the symbol and place the component in the board. This repeats in each section.

Fab

Transistors. A transistor is a semiconductor that amplifies or switches electronic signals. Transistors serve as the basic building blocks of modern electronics.

Component bar

Fab

CMOS. Stands for Complementary Metal-Oxide-Semiconductor, a technology used to build low-power, high-efficiency integrated circuits and microchips.

Schematic

Fab Fab

3. After understanding where the components can be selected and placed, we must begin with the schematic.

Components for this example:
Red LED 220 Ohm resistor 220 Ohm resistor

First we have to select the components, then place them in the board and if we want to rotate them we have to click the component and press CTRL + R.

Schematic

Fab

4. Finally we have to press the green triangle to simulate the circuit.

Simulation

Fab Fab

1. To simulate I'll use an ALTIUM Design I made a time ago. ALTIUM is a comprehensive PCB and electronic design automation software package that allows engineers to design and customize their own circuit boards. It is similar to KiCad, but it isn't free and you can do a lot more things like simulate from there. But this time I'll use NI Multisim.

Simulation

3D Printer

For printing my piece I used an ANYCUBIC PHOTON M5s.

Fab

Steps

Fab

1. First, I connected my USB adapter so I could load my document.

Steps

Fab

2. Then I removed the cover.

Steps

Fab Fab

3. After that, I made sure that there was nothing that may obstruct the printing process.

4. Then I logged into the USB and uploaded my document.

Steps

Fab

5. After that, I started the printing.

Steps

Fab Fab

5. When the printing was finished, I gently removed my head with a spatula. My print consisted of 640 layers.

Steps

Fab

6. Finally I used an Anycubic Wash & Cure 3 to cure my piece and cleaned it using a paper towel and Isopropyl alcohol.

Results

Fab Fab

Learning outcomes

This week, I learned a lot about 3D printing and its different types. I was not aware that ISO had classified 3D printing technologies into seven categories. I also learned how complex resin printing can be. It was my first time using this type of printer, and one of my prints failed due to poor adhesion to the build plate. Additionally, the cleaning process is quite tedious, although the results are highly accurate.


I also believe that 3D scanning is a remarkable tool for accurately replicating real structures. Its application in museums could be extremely valuable for the preservation of statues and historical artifacts.


When comparing filament printing and resin printing, I think both technologies have their own strengths and weaknesses. However, resin printing offers superior surface quality and detail, while filament printing is better suited for producing stronger and more durable structures.

Files