Metadata-Version: 2.4
Name: digital_casting_system
Version: 0.1.5
Summary: A digital control package for Digital Control System
Project-URL: Changelog, https://github.com/USI-FMAA/digital_casting_system/blob/master/CHANGELOG.md
Project-URL: Documentation, https://usi-fmaa.github.io/digital_casting_system/
Project-URL: Homepage, https://usi-fmaa.github.io/digital_casting_system/
Project-URL: Issues, https://github.com/USI-FMAA/digital_casting_system/issues
Project-URL: Repository, https://github.com/USI-FMAA/digital_casting_system
Author-email: Wei-Ting Chen <chenwei@arch.ethz.ch>
License: MIT License
        
        
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: AUTHORS.md
License-File: LICENSE
Keywords: automation,concrete,digital casting,manufacturing,robotics
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Requires-Dist: attrs>=17.4
Requires-Dist: compas<=2.9.0
Requires-Dist: matplotlib>=3.8.4
Requires-Dist: numpy>=1.26
Requires-Dist: pandas>=2.2.0
Requires-Dist: pyads>=3.3.9
Requires-Dist: pydantic>=2.10.6
Requires-Dist: ruff>=0.8.2
Provides-Extra: dev
Requires-Dist: build>=1.3.0; extra == 'dev'
Requires-Dist: bump-my-version; extra == 'dev'
Requires-Dist: hatchling>=1.27.0; extra == 'dev'
Requires-Dist: invoke>=0.14; extra == 'dev'
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: pytest-cov; extra == 'dev'
Requires-Dist: pytest-mock>=3.14.1; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Requires-Dist: setuptools>=75.8.0; extra == 'dev'
Requires-Dist: twine; extra == 'dev'
Requires-Dist: wheel>=0.45.1; extra == 'dev'
Provides-Extra: docs
Requires-Dist: markdown; extra == 'docs'
Requires-Dist: markdown-exec; extra == 'docs'
Requires-Dist: mkdocs; extra == 'docs'
Requires-Dist: mkdocs-autorefs; extra == 'docs'
Requires-Dist: mkdocs-gen-files; extra == 'docs'
Requires-Dist: mkdocs-include-markdown-plugin; extra == 'docs'
Requires-Dist: mkdocs-literate-nav; extra == 'docs'
Requires-Dist: mkdocs-macros-plugin; extra == 'docs'
Requires-Dist: mkdocs-material>=9.1.15; extra == 'docs'
Requires-Dist: mkdocstrings-python; extra == 'docs'
Requires-Dist: pymdown-extensions>=10.14.3; extra == 'docs'
Provides-Extra: robot
Description-Content-Type: text/markdown

# **Digital Casting System**

<!------link:---------->
[Windows 10]: https://www.microsoft.com/en-us/windows/
[Ubuntu 22.04]: https://ubuntu.com/download/desktop
[TwinCAT 3]: https://www.beckhoff.com/en-en/products/automation/twincat/?pk_campaign=AdWords-AdWordsSearch-TwinCAT_EN&pk_kwd=twincat&gclid=Cj0KCQjw9ZGYBhCEARIsAEUXITW5dmPmQ2629HIuFY7wfbSR70pi5uY2lkYziNmfKYczm1_YsK4hhPsaApjyEALw_wcB
[Anaconda 3]: https://www.anaconda.com/
[Docker]: https://www.docker.com/
[ABB RobotStudio]: https://new.abb.com/products/robotics/robotstudio
[Rhino and Grasshopper]: https://www.rhino3d.com/download


<!-- PROJECT SHIELDS -->

![GitHub - License](https://img.shields.io/badge/License-MIT-blue.svg)
![Python Version](https://img.shields.io/badge/Python-3.10-blue)
![Conda Version](https://img.shields.io/badge/Anaconda-4.14.0-blue)
![UV Version](https://img.shields.io/badge/UV-0.6.0-blue)
![ABB Version](https://img.shields.io/badge/RobotStudio-2023/2024-blue)
![TwinCAT Version](https://img.shields.io/badge/TwinCAT-3.4-blue)
![Docker Version](https://img.shields.io/badge/Docker-23.0.3-blue)

<!-- PROJECT DESCRIPTION -->

**Digital Casting System (DCS)** is a Innosuisse project as well as a new novel approach for robotic casting system. it serves part of [Scaling up in Digital Casting of Concrete](https://www.research-collection.ethz.ch/entities/publication/c9547f49-8d9e-47fe-b8e5-88cad5239ea2). This package works to transition automated digital casting systems from the laboratory to the industry scale by
overcoming the challenges addressed by inline mixing. DCS involves identifying optimal values for comprehensive system
parameters, including processing and material characteristics, while carefully considering specific system requirements.

This package has three parts, which contain ```PLC controller``` for control components, ```DCS library``` for middleware, robotic control, and data handling; lastly, ```DCS application``` uses for real-time data recording and production simulation.


<!-- PROJECT REQUIREMENTS -->

## Requirements

Operating System and Software.

- [Windows 10]()* or [Ubuntu 22.04]()*
- [TwinCAT 3]() -- version 3.4
- [Docker]()  -- version

CAD/CAM software and simulation.

- [ABB RobotStudio]() -- version 2023/2024
- [Rhino and Grasshopper]() -- version 7


<!-- PROJECT Getting Started -->

## Usage
For further a tutorial, examples, and an API reference, please check out the online documentation HERE: [digtial_casting doc](https://usi-fmaa.github.io/digital_casting_system/)

Data visualization and real-time monitoring app
Please find the app [HERE](https://github.com/USI-FMAA/digital_casting_system_app).


<!-- PROJECT USAGE -->
## Real-time monitoring and data recording

### Use the package from Git
``` bash
# sync the library
uv sync

# run the main script (requires PLC hardware)
uv run scripts/main.py
```

## PLC Controller

Please find more information [HERE](https://github.com/USI-FMAA/digital_casting_system_controller.git) under **Connect with TwinCAT** section.

## Robotic control
### Real ABB robotic control

#### With robot support:

```bash
pip install digital-casting-system[robot] git+https://github.com/WeiTing1991/compas_rrc.git@main
```

```sh
# clean the stopped container
docker container prune

# compose up and connect with docker container
# Linux/WSL
docker-compose -f ./external_controllers/robot/docker_compas_rrc/real_controller/docker-compose.yml up
```

```pwsh
# windows
docker-compose -f .\external_controllers\robot\docker_compas_rrc\real_controller\docker-compose.yml up

uv run scripts/main_run_robot.py
```

### Simulation with ABB robot(with virtual controller)

```sh
docker
# clean the stopped container
docker container prune
# docker compose up

# Linux/WSL
docker-compose -f ./external_controllers/robot/docker_compas_rrc/real_controller/docker-compose.yml up
```

```pwsh
# windows
docker-compose -f .\external_controllers\robot\docker_compas_rrc\virtual_controller\docker-compose.yml up
```

### ABB RobotStudios Setup

Please find more information [here]()

### CAD/CAM software(Rhino and grasshopper)

Please find more information [here]()

### Concrete Controller

The sub-package `external_controllers` is a package that provides a set of driver to control the concrete casting machines.
More information can be found in [digital casting system controller](https://github.com/USI-FMAA/digital_casting_system_controller)


<!-- PROJECT DEVELOPMENT -->

## Development
### Clone the repository
```bash
git clone https://github.com/USI-FMAA/digital_casting_system.git
# Alternately
git clone --recurse-submodules https://github.com/USI-FMAA/digital_casting_system.git
```

```bash
# if the repository is already cloned
cd digital_casting_system
git submodule update --init --recursive
```


### Update the submodules

```bash
# Update the submoudles
git submodule update --remote --merge
git pull --recurse-submodules


# Alternately
git submodule init
cd external_controllers
git checkout master # checkout the lastest version
git pull

# Alternately way
git submodule foreach git pull origin master

```

### Setup the environment

With `UV` package manger (super fast package management build by rust)

#### Install UV
```bash
# On macOS and Linux.
curl -LsSf https://astral.sh/uv/install.sh | sh

# On Windows.
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

uv --version
```

#### Create virtual environment

UV
``` bash
uv venv --python 3.12
source .venv/bin/activate
uv pip install -e .
uv pip install -e '.[dev,doc]'

# optional
uv pip install '.[dev]' # install the development dependencies
uv pip install '.[docs]' # install the documentation dependencies


```

Alternately with Anaconda package manager
```sh
# Create the environment and activate it
conda create --prefix ./.env python=3.10

# Install dependencies
conda activate ./.env
pip install -r requirements.txt

# Install Compas framework
pip install compas
pip install git+git://github.com/WeiTing1991/compas_rrc.git@main
```

<!-- Misc -->

## Credits
Author: [Wei-Ting Chen](https://github.com/WeiTing1991)

This package created by [WeiTing Chen](https://github.com/WeiTing1991)
at [USI-FMAA](https://github.com/USI-FMAA) and [ETHZurich DFab](https://dfab.ch/)
