Compare commits

...

25 commits

Author SHA1 Message Date
ebadedc7da
Merge pull request #1 from vofy/dev
Pull bachelor theses changes to master
2025-06-02 14:24:02 +02:00
ec7bfcf08c Update to bachelor thesis, migrate cad files to https://github.com/fekt-scara/cad 2025-06-02 14:22:09 +02:00
41b37604a0 Updates 2025-06-01 19:51:31 +02:00
0c0c67217d Update 2025-05-20 21:48:40 +02:00
0664681a29 Parts finalization 2025-05-15 03:22:07 +02:00
9ab734483e Update 2025-05-06 18:01:22 +02:00
42015da11f Update 2025-05-06 01:42:15 +02:00
4456a2cb44 Update 2025-05-03 04:29:38 +02:00
9f7612de4c Update 2025-04-29 11:21:34 +02:00
fe0c877a54 Vygenerované nové 3mf soubory 2025-04-16 05:20:45 +02:00
4e6be3b914 Hromada úprav 2025-04-16 05:20:11 +02:00
a87f1297c5 HMmmmm 2025-04-13 23:33:44 +02:00
cb92965dd3 Modifications 2025-04-04 13:23:06 +02:00
26e8173170 Modifications 2025-04-01 13:14:10 +02:00
d838a5b177 Regenerate 3mf files 2025-03-30 18:01:14 +02:00
3a55de476e Fix chamfers 2025-03-30 18:00:02 +02:00
f73e2892d9 Modify 3mf generation script and generate new 3mf files 2025-03-30 17:36:05 +02:00
4b0a171624 Modify 3mf generation script 2025-03-30 17:32:02 +02:00
82c706350b Regenerate 3mf files 2025-03-30 17:28:21 +02:00
8354cb5182 Repair naming 2025-03-30 17:26:53 +02:00
e0452426fa Add commit hash to generated files 2025-03-30 17:15:51 +02:00
0834add188 Re-genearate 3mf files 2025-03-30 17:04:39 +02:00
47a02220e3 Adjusted part clearance and other modifications 2025-03-30 17:02:51 +02:00
636fad8ab4 Modifications 2025-03-29 16:53:52 +01:00
835677d4a3 Frame dimensions change 2025-03-02 17:58:29 +01:00
69 changed files with 12 additions and 164 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -1,68 +0,0 @@
#!/usr/bin/freecadcmd
import os
import FreeCAD as App # type: ignore
import Mesh # type: ignore
# Define the project root directory
project_root = os.path.abspath(
os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir)
)
# Define the directories for CAD files and 3MF export files
printed_cad_dir = os.path.join(project_root, "cad", "printed")
printed_3mf_dir = os.path.join(project_root, "3mf")
# Create the 3mf directory if it doesn't exist
os.makedirs(printed_3mf_dir, exist_ok=True)
# List to keep track of files that failed to export
failed_files = []
# Traverse the printed CAD directory and its subdirectories
for root, dirs, files in os.walk(printed_cad_dir):
for file in files:
if file.endswith(".FCStd"):
# Absolute path of the CAD file
file_path = os.path.join(root, file)
App.Console.PrintMessage(f"\nProcessing {file_path}\n")
# Open the FreeCAD document
doc = App.openDocument(file_path)
App.setActiveDocument(doc.Name)
App.ActiveDocument.recompute()
# Iterate over all objects in the document
for obj in doc.Objects:
# Check if the object is Std_Part
if obj.TypeId == "App::Part":
# Construct the output path for the 3MF file using the label
output_path = os.path.join(
printed_3mf_dir,
os.path.relpath(root, printed_cad_dir),
f"{obj.Label}.3mf",
)
# Create the output directory if it doesn't already exist
os.makedirs(os.path.dirname(output_path), exist_ok=True)
try:
# Export the part to a 3MF file
Mesh.export([obj], output_path)
App.Console.PrintMessage(
f"Exported {obj.Label} to {output_path}\n"
)
except Exception as e:
App.Console.PrintError(f"Error exporting {obj.Label}: {e}\n")
failed_files.append(file_path)
# Close the FreeCAD document
App.closeDocument(doc.Name)
# Print the result of the export process
if failed_files:
App.Console.PrintError("\nThe following files failed to export:\n")
for file in failed_files:
App.Console.PrintError(f" - {file}\n")
else:
App.Console.PrintMessage("\nAll files have been exported successfully.\n")

View file

@ -1,74 +0,0 @@
#!/usr/bin/freecadcmd
import os
import FreeCAD as App # type: ignore
import FreeCADGui as Gui # type: ignore
# Define the project root directory
project_root = os.path.abspath(
os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir)
)
# Define the CAD directory
cad_dir = os.path.join(project_root, "cad")
# Define the output directory
output_dir = os.path.join(project_root, "tex", "images", "2_prakticka_cast")
# Ensure the output directory exists
os.makedirs(output_dir, exist_ok=True)
# Iterate over all files in the CAD directory (excluding nested directories)
for file in os.listdir(cad_dir):
if file.endswith(".FCStd"):
file_path = os.path.join(cad_dir, file)
App.Console.PrintMessage(f"\nProcessing {file_path}\n")
# Open the FreeCAD document
doc = App.open(file_path)
App.setActiveDocument(doc.Name)
App.ActiveDocument.recompute()
# Check if the document contains any assemblies (App::Part)
has_assembly = any(
hasattr(obj, "Type") and obj.Type == "Assembly" for obj in doc.Objects
)
if has_assembly:
# Gui.showMainWindow()
# Set visibility to true for all objects in the assembly and hide all objects outside of the assembly
for obj in doc.Objects:
if hasattr(obj, "Type") and obj.Type == "Assembly":
for sub_obj in obj.OutList:
if sub_obj.ViewObject is not None:
sub_obj.ViewObject.Visibility = True
else:
if obj.ViewObject is not None:
obj.ViewObject.Visibility = False
for view in [
"ViewIsometric",
"ViewFront",
"ViewTop",
"ViewRight",
"ViewRear",
"ViewBottom",
"ViewLeft",
]:
Gui.ActiveDocument.sendMsgToViews(view)
output_path = os.path.join(
output_dir, f'{file.replace(".FCStd", "")}_{view}.png'
)
Gui.ActiveDocument.ActiveView.saveImage(
output_path, 1920, 1080, "Transparent"
)
App.Console.PrintMessage(f"Exported {view} view to {output_path}\n")
else:
App.Console.PrintMessage(
f"No assembly found in {file_path}, skipping image generation.\n"
)
# Close the FreeCAD document
App.closeDocument(doc.Name)

Binary file not shown.

Binary file not shown.

View file

@ -9,8 +9,8 @@
%english-slovak, % originální jazyk je angličtina, překlad je slovensky
%
%%% Z následujících voleb typu práce lze použít pouze jednu
semestral, % semestrální práce (výchozí)
%bachelor, % bakalářská práce
%semestral, % semestrální práce (výchozí)
bachelor, % bakalářská práce
%master, % diplomová práce
%treatise, % pojednání o disertační práci
%doctoral, % disertační práce

Binary file not shown.

View file

@ -47,7 +47,7 @@ Po obvodu skříně jsou upevněny další části tiskárny. Jednou z~nich je d
\section{Tisk}
Nastavení sliceru vychází z~nastavení doporučení projektu Voron. Jedná se tedy následující nastavení:
Nastavení sliceru vychází z~nastavení doporučeného projektu Voron. Jedná se tedy následující nastavení:
\begin{itemize}
\item Výška vrstvy: \textbf{0,2mm}
@ -60,9 +60,9 @@ Nastavení sliceru vychází z~nastavení doporučení projektu Voron. Jedná se
Doporučenými materiály pro tisk jsou: \textbf{ASA}, ABS nebo PETG.
\section{Implementace kinematiky SCARA do Klippy}
\section{Implementace kinematiky SCARA do Klipperu}
% cSpell:disable-next-line
Klippy je část firmwaru Klipper, která běží na počítači uvnitř 3D tiskárny, ke kterému je připojena řídící deska. Kód je napsán převážně v~jazyce Python, přičemž některé funkce jsou implementovány v~jazyce C. Volání těchto funkcí je realizováno použitím rozhraní CFFI (C Foreign Function Interface). Klippy slouží k~interpreataci výrobních instrukcí -- GCode, které jsou přeloženy na volání iterních metod. Tyto volání jsou odesílány po sběrnici USB do řídící desky, která například generuje pulzy pro krokové motory nebo spíná topná tělesa.~\cite{klipper_code_overview}
Klipper je část firmwaru Klipper, která běží na počítači uvnitř 3D tiskárny, ke kterému je připojena řídící deska. Kód je napsán převážně v~jazyce Python, přičemž některé funkce jsou implementovány v~jazyce C. Volání těchto funkcí je realizováno použitím rozhraní CFFI (C Foreign Function Interface). Klippy slouží k~interpreataci výrobních instrukcí -- GCode, které jsou přeloženy na volání iterních metod. Tyto volání jsou odesílány po sběrnici USB do řídící desky, která například generuje pulzy pro krokové motory nebo spíná topná tělesa.~\cite{klipper_code_overview}
\subsection{Přímá a~inverzní kinematika}
Kinematické transformace se používají k~převodu natočení kloubů na souřadnice koncového bodu (přímá transformace) a~naopak (inverzní transformace). Pro výpočet transformace je třeba znát délky ramen \(L_1\) a~\(L_2\), offsety ramen \(x_{offset}\) a~\(y_{offset}\) a~Elbow Crosstalk Ratio (ECR).
@ -133,7 +133,13 @@ Dalším krokem je výpočet vzdálenosti od počátku.
hypot = \sqrt{x^2 + y^2}
\end{equation}
Dále se vypočítají úhly ramen \(\phi_S\) (shoulder) a~\(\phi_E\) (elbow).
Dále se vypočítají úhly ramen \(\phi_E\) (elbow) a~\(\phi_S\) (shoulder).
\begin{equation}
\phi_E = arccos \left( \frac { x^2 + y^2 + L_1^2 + L_2^2 } { 2 \cdot L_1 \cdot L_2 } \right) [\si{\radian}]
\end{equation}
kde \(L_1\) a~\(L_2\) jsou délky ramen.
\begin{equation}
% cSpell:disable-next-line
@ -142,22 +148,6 @@ Dále se vypočítají úhly ramen \(\phi_S\) (shoulder) a~\(\phi_E\) (elbow).
kde \(L_1\) a~\(L_2\) jsou délky ramen.
\begin{equation}
\phi_E = \frac { \phi_S } { ECR } + arccos \left( \frac { x^2 + y^2 + L_1^2 + L_2^2 } { 2 \cdot L_1 \cdot L_2 } \right) [\si{\radian}]
\end{equation}
kde \(ECR\) je Elbow Crosstalk Ratio, \(L_1\) a~\(L_2\) jsou délky ramen.
Následně stačí převést úhel v~radiánech na stupně.
\begin{equation}
\Phi_S = \phi_S \cdot \frac { 180 } { \pi } [\si{\degree}]
\end{equation}
\begin{equation}
\Phi_E = \phi_E \cdot \frac { 180 } { \pi } [\si{\degree}]
\end{equation}
% \section{Konfigurace tiskárny}
% \section{Kalibrace tiskárny}