WEEK 08 Electronics Production
GROUP ASSIGNMENT:
FITCAM
I downloaded FLACAM software for the PCB CNC milling from https://bitbucket.org/jpcgt/flatcam/downloads/
My instructor Ricardo gave me this SVG line test.
In Flatcam just drag and drop the file and double click the geometry
I changed those values. You can hold the cursor over and it will give you explanations. Finally create a CNC job
From here we can see the traces and we can generate a G-CODE file
CANDLE
I downloaded from https://github.com/Denvi/Candle
-
check connection of your USB port with the machine
-
Drag and drop the g-code file and set up the probe test
-
I used arrows on the side to move the drill to my XY ZERO. I used a piece of paper to determine my Z ZERO (moving the frill down with very small step till the paper is squeezed tight between the plate and the drill but still possible to remove) ATTACH THE PROBE CLIP TO THE MILL AND PRESS PROBE
-
VERY IMPORTANT: REMOVE THE PROBE FROM THE ENDMILL!
-
I went to EDIT, and the I pressed SEND and unpressed the PAUSE button that is automatically ON after sending the file to the machine
-
After seeing the milling decided to ABORT the process because I didn’t like the result. I lover the Z 0.01mm down. I moved also XY to a new ZERO location and SEND it again
-
As you can see there were few tests (because I didn’t activate the heigh map and was trying to compensate with changing the Z depth and slowing down the feed rate)
-
It’s very important to activate the HEIGHMAP that is not automatically ON
CHANGING THE COPPER PLATE
I downloaded The GSENDER program to clean up and level up the CNC’s workspace https://github.com/Sienci-Labs/gsender/releases
The program is very intuitive. You need to be disconnected from other programs
Remove the old copper board
Apply the levelling milling bit
I put the CNC to a box to make less mess 🙂
Obviously some mistakes were done. As well as my surface was a bit tilted because of the guides that felt down (you can see horizontal lines on the MDF piece)
But after putting them back on and running the program again. Everything looks perfect. The hole wont bother me for now.
Time to put a new v-shaped end mill
In the meantime I practiced soldering on the old copper board
Attach double tape and place it on the CNC
Remember to solder the new copper board to the probe
BOARDHOUSE
To make a professional fancy boards you can visit https://jlcpcb.com/
Here’s a simulation:
INDIVIDUAL ASSIGMENT:
PCB PRODUCTION:
KICAD EXPORT
After designing the board in KiCad I exported the files. Firstly the paths and cut-out
You need to choose layers (copper lines and edge cut-out)
Next the drill holes
FITCAM PREPARATION
Drag and drop 3 files exported from KiCad. Select them all and move to the canter.
Select the fist one (double click) and choose CUTOUT TOOL
I choose those settings (holding cursor over the function, it gives explanation) and CREATED GEOMETRY
In the PROJECT TAB select the geometry (double click)
I choose those settings and GENERATE CNC JOB
Now I confirm that everything looks ok and SAVE G-CODE
Time to set up the paths. Double click the second file.
ISOLATION ROUTING and GENERATE GEOMETRY
I choose those settings and GENERATE CNC JOB
But there’s a problem, the drill won’t pass everywhere because of its thickness. I need to change the drawing.
Back to KiCad, save again, delete the old file, update the new one, place in the same spot and now it works good.
GENERATE the CNC JOB and after SAVE THE G-CODE
Time for the drill holes, back to the PROJECT TAB, double click Excellon file
Choose Drilling Tool
I change those settings and generated CNC JOB
Save the G-CODE
FINAL PROJECT:
That’s a great online G-CODE visualizer, for checking if everything is fine with the code before running it into the machine
CANDEL CUT OUT
For the circuit I followed the same steps as in the LINE TEST And for the cot-out I change the milling bit
Made a new Z ZERO with probe clip
Remove the PCB with spatula
Cleaned with alcohol
And started soldering
Unfortunately I destroyed some lines and needed to use cable. But after checking with multimeter there were some unwanted connections
So I needed to unsolder and make a new one
After few more tries and mistakes I finally got my boards
ZOOM OF MY SOLDERING AND PATHS
RUNNING PROGRAM:
CAT BUTTON PCB
I made again same circuit in Wokwi and edited my code from week 4 to show ON and OF in the serial monitor
PUSH BUTTON (pull up resistor)+ LED
// Define pin numbers for button and LED
const int button = D9; // Button pin (input)
const int led = D7; // LED pin (output)
void setup() {
// Start the serial communication at 115200 baud rate
Serial.begin(115200);
// Set the button pin as input (with external pull-up resistor)
pinMode(button, INPUT);
// Set the LED pin as output to control the LED state
pinMode(led, OUTPUT);
}
void loop() {
// Read the button state (HIGH = not pressed, LOW = pressed)
bool buttonState = digitalRead(button);
// Invert the button state to control the LED (LED on when button is pressed)
digitalWrite(led, !buttonState);
// Print the current state of the LED to the serial monitor (ON or OFF)
Serial.println(buttonState ? "OFF" : "ON");
// Small delay to debounce the button and avoid multiple reads in quick succession
delay(100);
}
SOS LED BLINK (by chat GPT)
const int led = D7;
void setup() {
Serial.begin(115200);
Serial.println("Ready");
pinMode(led, OUTPUT);
}
void loop() {
// SOS in Morse Code: "... --- ..."
// Three short blinks
for (int i = 0; i < 3; i++) {
blinkLED(200); // Short blink (200ms ON, 200ms OFF)
}
// Three long blinks
for (int i = 0; i < 3; i++) {
blinkLED(600); // Long blink (600ms ON, 200ms OFF)
}
// Three short blinks again
for (int i = 0; i < 3; i++) {
blinkLED(200); // Short blink (200ms ON, 200ms OFF)
}
delay(2000); // Pause before repeating SOS signal
}
void blinkLED(int duration) {
digitalWrite(led, HIGH);
delay(duration);
digitalWrite(led, LOW);
delay(200);
}
REWARD MACHINE PCB
I did the same for my Reward Machine PCB
PUSH BUTTON (pull down resistor) + LED
// Define pin numbers for button and LED
const int button = D9; // Button pin (input)
const int led = D6; // LED pin (output)
void setup() {
// Start serial communication at 115200 baud rate
Serial.begin(115200);
// Print "Ready" to the Serial Monitor to indicate setup is complete
Serial.println("Ready");
// Set the button pin as input (with pull-down resistor)
pinMode(button, INPUT);
// Set the LED pin as output to control the LED state
pinMode(led, OUTPUT);
// Start with the LED turned off
digitalWrite(led, LOW);
}
void loop() {
// Read the current state of the button
// Returns HIGH when the button is pressed, LOW when it is not pressed
bool buttonState = digitalRead(button);
// Set the LED state based on the button state
// The LED will turn on when the button is pressed (HIGH), off when not pressed (LOW)
digitalWrite(led, buttonState);
// Print the current state of the LED to the Serial Monitor
// Print "ON" if the button is pressed, "OFF" if it is not
Serial.println(buttonState ? "ON" : "OFF");
// Small delay to debounce the button and prevent multiple reads in quick succession
delay(100);
}
SOS LED BLINK
const int led = D6;
void setup() {
Serial.begin(115200);
Serial.println("Ready");
pinMode(led, OUTPUT);
}
void loop() {
// SOS in Morse Code: "... --- ..."
// Three short blinks (S)
for (int i = 0; i < 3; i++) {
blinkLED(200); // Short blink (200ms ON, 200ms OFF)
}
// Three long blinks (O)
for (int i = 0; i < 3; i++) {
blinkLED(600); // Long blink (600ms ON, 200ms OFF)
}
// Three short blinks (S)
for (int i = 0; i < 3; i++) {
blinkLED(200); // Short blink (200ms ON, 200ms OFF)
}
delay(2000); // Pause before repeating SOS signal
}
void blinkLED(int duration) {
digitalWrite(led, HIGH);
delay(duration);
digitalWrite(led, LOW);
delay(200);
}
FILES:
KICAD
REWARD MACHINE:
BUTTON:
FLATCAM
REWARD MACHINE:
BUTTON:
CHECKLIST:
Group assignment:
- Characterize the design rules for your in-house PCB production process: document feeds, speeds, plunge rate, depth of cut (traces and outline) and tooling.
- Document the workflow for sending a PCB to a boardhouse
- Document your work to the group work page and reflect on your individual page what you learned
Individual assignment:
- Make and test a microcontroller development board that you designed
Learning outcomes:
- Described the process of tool-path generation, milling, stuffing, de-bugging and programming
- Demonstrate correct workflows and identify areas for improvement if required
Have you answered these questions?
- Linked to the group assignment page
- Documented how you made the toolpath
- Documented how you made (milled, stuffed, soldered) the board
- Documented that your board is functional
- Explained any problems and how you fixed them
- Uploaded your source code
- Included a ‘hero shot’ of your board