4. Electronics Production¶
The is the topic for the fifth week, since the same topic of Week 3 and Week 4.
Overview¶
We’re learning how to fabricate our own PCBs (printed circuit board) this week. Creating the board with a very precise milling machine and learning how to solder teeny-tiny components on top of it.
Assignments¶
Our tasks for this week are:
Group assignment:
- characterize the design rules for your in-house PCB production process
Individual assignment:
- make and test a microcontroller development board.
- extra credit: personalize the board
- extra credit: make it with another process
Group Assignment¶
Click here to group work.
We use 晶研 CNC 数控雕刻机
Here is the product manual
Following shows what I’ve learnt from the group work:
Instructions for use of engraving machine¶
Processing process of engraving machine
Step 1: Fix the material to be processed on the machine with the corresponding fixture. Generally, thin plates are fixed with double-sided tape, 46 brand is fixed with a vise, and special-shaped workpieces are fixed with a special fixture.
Step 2: Clamp the tool to the spindle motor. When clamping the tool, it is necessary to pay attention to the specifications of the clamped tool to be consistent with the programming time, and the tool should be locked with a spindle wrench. After the tool is clamped, it is necessary to check whether the tool will deflect, otherwise it will lead to poor quality of the processed product and the occurrence of tool breakage during processing.
Step 3: Initialize the equipment. Open the control software Mach3 on the computer, turn on the power switch of the machine, and use the “Estop” button on the handwheel to cancel the alarm state.
Step 4: Use the handwheel to set the tool. Switch the machine to the handwheel control state, use the X, Y, 2 buttons on the handwheel to switch the corresponding axis, use the forward/reverse rotation of the hand pulse to control the forward/reverse movement of the machine on the current axis, use the “Speed” button on the handwheel to control the speed of movement, and move the center of the tool tip of the machine to the processing coordinate origin set during programming (for the convenience of tool setting, it is generally set at the four corners or center of the material during programming). For example, when programming, we set the origin at the lower left corner of the material, so we use the handwheel to align the center of the tool tip with the lower left corner of the material (the spindle should be turned on at 30% speed during tool setting to prevent the tool from breaking during tool setting. You can refer to the tool setting video in the U disk)
Step 5: Switch the machine to the computer control state and confirm the software If the “Emergency Reset” button in the lower left corner does not flash, click “X Clear”, “Y Clear”, “Z Clear”, “A Clear”, and click “Load G Code”. A pop-up window will appear to load the G code. Select “A11Files” as the file type and find the G code you generated and load it in. After loading, the corresponding simulation path will be displayed in the upper right corner of the software window (if no simulated path is generated, it means that the loaded G code is wrong or not recognized).
Step 6: After the program is read in, adjust the spindle speed to 80%~100% (the spindle speed is set according to the processing material), and then click “Cycle Start” and the machine will start processing. If you need to adjust the processing speed during processing, you can control it by pulling the bar in the feed bar.
Additional Notes for Global Evaluation - The characterization of the design rules of your machine¶
The characterization of the design rules of a machine is usually done by milling this file. Here is an example.
And we have two types of tools in our lab.
According to the group assignment requirements, we need to produce the following tool heads to test PCB circuit boards. Under the guidance of our teacher Salman, we used 1/64 for trace mill test; 1/32 for holes(drills) and edge.And we got these results:
Since we are using 1/32 bit for drilling and edge processing, we should use at least 16 mil trace width, these parameters will be used later when we work on the schematic with Kicad.
Names and functions of each component of the equipment¶
Common functions of the software¶
Common material processing parameters¶
Individual Assignment¶
To make and test a microcontroller development board.
Terminology - microcontroller development board¶
A microcontroller development board is a printed circuit board (PCB) with a microcontroller or microprocessor mounted on it, along with other hardware components.
I am going to make the Quentorres show in Neil’s class.
Click here to download the Quentorres all source file .
Note 1 - what is the difference between these 2 versions:¶
This is the chip patch:
This requires the use of 2.54*7.1H vertical female header (2.54*7.1H 立贴排母), name is Conn PinHeader1x03 P2.54mm Horizontal SMD.
Note 2 - What are these holes for?¶
Allows you to access the chip from the back of the board for later functional development.
Note 3 - Why do we sometimes need to tape the PCB?¶
Have you seen the metal dots on the chip? In case your hand shakes and the metal dots stick to other lines on board, causing a short circuit or wrong connection.
Let’s make a microcontroller development board!¶
Generate Gerber¶
Open the .kicad_pcb file, Kicad; KiCad Library;
File - Fabrication Outpus- Gerbers(.gbr)
Set Output directory - Generate Drill Files;
To generate trace file - click Plot;
Gerber to PNG:¶
Click HERE
Upload all files:
Click ‘Quick Setup ’ to generat Top trace file- drill file - cut file in order:
Download all files:
PNG to G-Code:¶
Visit mos ;
For Trace PNG to G-code¶
Upload png Trace File and set dpi as 1000.
Set ‘tip diameter’ as 0.4 mm and click ‘send calculated settings’
Click ‘calculate’
For drills PNG to G-code:¶
For edge cut PNG to G-code:¶
in case broken the tips of V-bits/ tapered bits, slow down the speed to 2mm/s:
Click ‘calculate’:
Done:
CNC Mill the Board !¶
I use 晶研 CNC 数控雕刻机
Here is the product manual
Fixturing (固定木板)¶
- Use tape to fix the board,in this way, the board can be drilled better, so does the copper wire.
- holds the board
Tools¶
V-bits¶
In my case, I use 20*0.2 bit for trace;
I use this for drills & edge cut:
It was supposed to look like this, but it is 0.8 mm drill.
Use Mach3Mill:¶
Press ‘Estop’ button to active/disable the Spindle; Use Handwheel/Hand Controller to control the position of the Spindle by adjusting X/Y/Z axis (horizontal / vertical/lifting)
CNC Machine Controller :
Here, the button to switch ‘Hand controller’ mode and ‘PC Control’ mode.
Import G-Code and Generate Toolpath¶
To mill trace - drill - outline in order.
-
Import G-code
-‘s3’ to create tool path:
-
Finish Milling !!!!
- Sand Paper to remove hairy part of the copper.
- Finish !!!
Use a multimeter to test the circuit board for short circuits¶
When the red and black test pens are connected, a “Di” sound is emitted, indicating that the circuit is connected.
Soldering components to the PCB¶
Note 4 - Direction of LED soldering on the circuit board¶
Other components are soldered according to this schematic:
Embedded Programming¶
For more details about Embedded Programming, please check Week 6 - Embedded Programming ; Test week6;
Embedded Code- Functions that I want to realize and its principle¶
Once the switch is pressed, D1 is activated (the level is pulled high), and the electrical signal is transmitted to the D1 pin. Then the MCU controls the operation of other components through the program written on the chip. In this example, I want to light up the 3 LEDs corresponding to the DO, D6, and D7 pins;
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(D1, INPUT);
pinMode(D0, OUTPUT);
pinMode(D6, OUTPUT);
pinMode(D7, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
int buttonState = digitalRead(D1);
if (buttonState == HIGH) {
// 如果按钮被按下,点亮所有LED
digitalWrite(D0, HIGH);
digitalWrite(D6, HIGH);
digitalWrite(D7, HIGH);
} else {
// 否则,熄灭所有LED
digitalWrite(D0, LOW);
digitalWrite(D6, LOW);
digitalWrite(D7, LOW);
} // wait for a second
}
-
Upload program to MCU board:
-
Test the Result :