Week 8. Electronics production

Summary

This week we focused on learning how to use the endmill machine so we can make our own pcb for whatever purpose we want, this week reuses topics that we saw on week 4.


Group assignment

Here is the group assignment to check more information about the topic electronics production.


1. Basic concepts

1.1 What is a mini CNC?

It's a 3-axis (X, Y, Z) milling machine that uses subtractive machining. Essentially, a rotating milling cutter cuts material while the workpiece moves along the X, Y, and Z axes, controlled by a computer.

1.1.1 Why is it useful?

1.2 What is welding?

Soldering is the process of joining two pieces using a molten metal, called solder, which solidifies upon cooling and holds them together. In the current topic, soldering means heating tin with a soldering iron to join the pins of a component to the traces on a PCB, creating a mechanical and electrical connection.

1.2.1 Materials that you must have for welding

2. Exporting our files from Ki Cad

Before using the monofab we need to exporte our files from Ki Cad so we can drill, engrave and cut our pcb.

2.1 Making small changes

2.1.1 Modiying the width of my tracks

Before exporting out files I made some changes to the pcb I made on week 4, I made changes to the width of the track because I hadn't previously considered the drill bit to be used, so I was only "cutting ideally", changing my width to 0.5mm.

file1_compressed
Fig 01. Changing the width of my track

To apply the change to all tracks, press "shift+a" (select all), then go to edit, edit track and track properties, change your track width to 0.5 and click on "apply and close".

file2_compressed
Fig 02. Changing all the tracks
2.1.2 Adding pins to the pcb

I modified the outputs so I could test 3 servomotors at the same time and left the other inputs free in case I wanted to use them.

file3_compressed
Fig 03. Schematic view with the modifications
2.1.3 Add text to the pcb

This is just in a decorative way. To add text, click the button with the "T" logo, write what you want, and adjust the size. The recommendation is to use a square size so it looks good.

file4_compressed
Fig 04. Adding text

2.2 Final 3D view of my pcb

Here is how I my pcb should look like ince it is finished.

file5_compressed
Fig 05. 3D view of the pcb

2.3 Export your files from Ki Cad

Once you have done your changes, corrections and modifications you should go to File, Factory Outputs, Gerber, select SVG plot and plot.

file6_compressed
Fig 06. Factory outputs

Select only the layers that we have used in the PCB file, in my case F.Cu, User.Drawings and Edge.Cuts.

file7_compressed
Fig 07. Exporting our layers.

3. Saving the files to the monofab formmat

The Roland MonoFab SRM-20 (and other Roland milling/cutting machines) accepts RML files because this is Roland's native command format that defines the machine's paths and movements.

3.1 Open the mods CE page

The Mods CE is a page that converts SVG or PNG files to rml files so the milling/cutting machines can make what you want. You acces by clicking on the previous link or by searching roland monofab CE it will normally be the 1st or 2nd link.

exporting1_compressed
Fig 08. Mods CE page with Roland Monofab

Search for the machine that you have, in my case it will be the Roland Monofab PCB

3.2 Select your SVG or PNG

Once you have selected your machine you will upload one file, is important to follow this workflow for obtaining better results holes, engrave, cutting.

exporting2_compressed
Fig 09. Selecting the file

3.3 Select the tool

We have 3 options for the tool trace, drill and cutout. Depending on what we need we will select each function, in my case I'm doing the holes so I will select drill and it will automatically make the maths to send the instructions to the machine, in this part we will change the tool diameter for the ones that we have physically (my case will be 0.89 for hole and 2 for cutting). We can also specify how mane offsets we want the machine to do (the offsets are the nomber of times the machine will repeat the instruction) for the holes and cutting I personally recommend 1

exporting3_compressed
Fig 10. Selectng the tool

We can modify the speed at which the tool operates, which is recommended to be between 2 and 4 mm/s, and finally, we must activate the "outputs, save files" option so that our rml file is downloaded when we click on calculate.

exporting4_compressed
Fig 11. Enabling the download option

3.4 Download you file

Click on calculate to download your file and also thw page will open a new tab in which you will what the rml file will do.

exporting5_compressed
Fig 12. What the machine will do

You will repeat this process with the cutting and engravig. Except that on the engraving option you will change the tool and the number of offsets, being that the tool will be the one of 60° and the offsets will be 4 to prevent our traces from having copper burrs, because it's a mistake that happened to me and I had to sand my PCB more than expected.

exporting6_compressed
Fig 13. Engraving tool
exporting6_compressed
Fig 14. Calculating option

At the end we will have 3 files for using the machine.


4. Using the monofab

Once we have all our files we can start using the monofab, but firts we will have to install the program.

4.1 Download the program

My local instructor gave us the program to download it. We installed the program provided by our instructor and selected the endmill model.

machine1_compressed
Fig 15. Installing the program

This is the program window.

machine2_compressed
Fig 16. Window of the program
4.1.1 What each button does

We also make it lower until it produces dust, similar as we did with the CNC from week 7.

For executing our rml files we click on Cut, then add file and select the rml file, then click on output and it will automatically start drilling, cutting or engraving.

4.2 Preparing the pcb

Similar to the CNC in week 7, we will have our working material, the PCB and the sacrificial bed.

machine3_compressed
Fig 17. PCB and sacrificial bed

We attached the PCB to the bed with double-sided tape so that it wouldn't move when the tool was on it.

machine4_compressed
Fig 18. Attaching the PCB to the bed.

4.3 Preparing the machine workspace

This is the workspace of the machine.

machine5_compressed
Fig 19. Worksapce
4.3.1 Screw our sacrificial bed together

We bolted down our bed so that it wouldn't move while we were working.

machine6_compressed
Fig 20. bolting down our bed

At the end it has to look like this.

machine7_compressed
Fig 21. Final workspce
4.3.2 Drill bits to use

These are the drill bits to use, the ones for holes and cuts being the same, only changing the radius (smaller hole, larger cut) and the engraving that looks like a needle.

machine8.1_compressed
Fig 22. Drill bits used

To change the drill bits, we use an Allen wrench that loosens our drill bit by lowering it. Once it's lowered, we replace it with the drill bit we need. In our case, the drill bit can rise quite high, even to the point of being completely submerged. My recommendation is to insert the drill bit halfway or slightly less than its length, tighten the screw, and that's it.

machine8_compressed
Fig 23. Drill bit changed

4.4 Execute the files

Now that all is set up we can run our files, starting with the holes.

4.4.1 Holes

As I already mention I will follow this workflow hole, engrave and cut.

Vid 01. Making the holes
machine10_compressed
Fig 24. Result of the holes made

After each work dust from the cutted PCB is generated so we have to clean when our rml file is done so we can execute the next file.

4.4.1 Engrave
machine11_compressed
Fig 24. Result of the engrave
4.4.1 Cuts
machine12_compressed
Fig 24. Result of the cuts

4.5 Result

Here is the final result after sanding and ready to satrt welding.

machine13_compressed
Fig 25. PCB

5. Weld

Last we have to weld the components that were in our Ki Cad files. This is our workspace here at Ibero Puebla.

weld1_compressed
Fig 25. Workspace

4.1 Add flux

For welding in a better way we will aplly flux to each weld zone, like in the image in that way the heat it dissipates heat better, resulting in a more uniform and cleaner solder joint.

weld2_compressed
Fig 26. Applying flux

4.2 Start welding

We will put the tin and the soldering iron together in the place where we applied the flux.

weld3_compressed
Fig 26. Welding

Here is a comparisson of how it looks welded against not welded.

weld4_compressed
Fig 27. Not weld vs weld

4.3 Clean you soldering iron

You have to clean your soldering iron with a sponge or a metallic fiber to remove the excess of tin from the tip.

weld4_compressed
Fig 28. Cleaning the soldering iron

This is the process that you have to repeat for each component until you have finished.

4.5 Positive and negative

The electrolytic capacitor and LED have a way of identifying which is positive and which is negative.

4.5.1 Electrolytic capacitor

The positive is the side with no black paint and the negative is the side with black paint.

positivo1_compressed
Fig 29. Electrolytic capacitor
4.5.2 LED

The positive is the side with the flat side of the T.

positivo2_compressed
Fig 30. LED 1206

Here is my PCB already soldered.

weld7_compressed
Fig 31. PCB soldered

6. Results

Here is how it looks the pcb with the servos attached.

test1_compressed
Fig 31. Heroshot

Here is the code used for testing the PCB functionality.


                from machine import Pin, PWM
                import time
                import sys
                import uselect

                SERVO1_PIN = 6    # USAR GPIO
                SERVO2_PIN = 7    
                SERVO3_PIN = 5    
                LED_PIN    = 3   
                BTN_PIN    = 4    

                # Parámetros de los Servos
                SERVO_MIN_US = 500
                SERVO_MAX_US = 2500
                SERVO_HZ = 50
                PERIOD_US = 1_000_000 // SERVO_HZ

                servo1 = PWM(Pin(SERVO1_PIN), freq=SERVO_HZ)
                servo2 = PWM(Pin(SERVO2_PIN), freq=SERVO_HZ)
                servo3 = PWM(Pin(SERVO3_PIN), freq=SERVO_HZ)

                led = Pin(LED_PIN, Pin.OUT)
                boton = Pin(BTN_PIN, Pin.IN, Pin.PULL_UP)

                # Configuración de lectura de terminal (sin bloqueo)
                spoll = uselect.poll()
                spoll.register(sys.stdin, uselect.POLLIN)

                def mover_servo(servo, angulo):
                    us = int(500 + (angulo * 2000 / 180))
                    duty = (us * 65535) // 20000
                    servo.duty_u16(duty)

                # Variables de estado
                last_btn_state = 1
                print("Sistema listo, formato: ID, angulo")

                while True:
                    btn_val = boton.value()
                    if btn_val == 0 and last_btn_state == 1:
                        led.value(not led.value())
                        time.sleep_ms(50)
                    last_btn_state = btn_val
                    
                    if spoll.poll(0):
                        raw_data = sys.stdin.readline().strip()
                        try:
                            partes = raw_data.split(',')
                            if len(partes) == 2:
                                idx = int(partes[0])
                                ang = int(partes[1])
                                
                                if 0 <= ang <= 180:
                                    if idx == 1:
                                        mover_servo(servo1, ang)
                                    elif idx == 2:
                                        mover_servo(servo2, ang)
                                    elif idx == 3:
                                        mover_servo(servo3, ang)
                                    print(f"S{idx} -> {ang}")
                        except:
                            pass

                    time.sleep_us(100)
                

Here are the both tests, the servos and the led with the button.

Vid 02. Testing the PCB

7. Files created

Click on the "Download ZIP" to download all the files I made for this week assignment

Download ZIP