Skip to content

Commit

Permalink
#2 Calibrate pulley teeth (#9)
Browse files Browse the repository at this point in the history
* restructure openclino

* Setup 2.0 dev and object

* classes functional

* testing AccelStepper

* test accelStepper, unit test spin_degs

* spin_degs calibrated, spin_continuous broken

* circuit design 1

* label circuit diagram

* Remove requirements

* docs and rename directories

* rename docs

* rm colab

* rm archive

* link docs

* add back RPM

* typos and errors

* convention
  • Loading branch information
wahabk authored Nov 29, 2024
1 parent a896367 commit f6659bb
Show file tree
Hide file tree
Showing 7 changed files with 211 additions and 242 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

# Version 0.2.0 29/11/2024

- Changed pulley diameters to pulley teeth
- Added `float epsilon` for calibrating substeps.
- Added circuit diagram.
- Updated documentation and README.md
- updated `spin_degs()` if statements and compensation.
- Added unit tests `calibrate_pulley_teeth()` and `test_spin_degs_multi()`.

# Version 0.1.0 22/11/2024

Initial release. Development till 22/11/2024.
22 changes: 4 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,20 @@ Open-source 3D clinostat. A clinostat is a small scale [microgravity simulator](

This is based on the European Space Agency's work, specifically on [Jack Van Loon's clinorotation work](https://doi.org/10.3389/fpls.2019.01577).

It is very difficult to access a 3D clinostat, there are some companies that sell it but can be prohibitively expensive for gravity research. OpenClino can be built for £100 using off the shelf parts. OpenClino can run in continuous clinorotation or as a Random Positioning Machine (RPM).

This is a side project for me and is very much work in progress.

OpenClino is designed to be simple, accessible, affordable, and **reliable**. It is designed to make use of 3D printing's strengths and requires *no machining* and minimum tools. To build OpenClino all non-printed parts are available off the shelf, mainly 3d printer stepper motors, belts, controllers, and skateboard bearings. All these parts are rated for thousands of hours of operation, and I have fully tested OpenClino to run for a minimum of 100 hrs without fault.
OpenClino is designed to be simple, accessible, affordable, and **reliable**. It is designed to make use of 3D printing's strengths and requires *no machining* and minimum tools. To build OpenClino all non-printed parts are available off the shelf, mainly 3d printer stepper motors, belts, controllers, and skateboard bearings. All these parts are rated for thousands of hours of operation, and I have fully tested OpenClino to run for a minimum of 100 hours.

## Documentation

<img src="docs/images/build_guide/0_exploded_view.jpg" alt="Clinostat build!" width="400"/>

I have provided:
- Docs in [`docs/1_.md/`](docs/1_documentation.md)

- Docs in [`docs/1_documentation.md/`](docs/1_documentation.md) including circuit diagram.
- Code in [`src/`](src/openclino.ino)
- 3D print files as .3MF in [`3d_files/`](3d_files/)
- Bill of materials in [`docs/2_BOM.md/`](docs/2_BOM.md/)
- Build guide in [`docs/3_build_guide.md/`](docs/3_build_guide.md/)

I will provide (TODO):

- code documentation.

- Code documentation in [`docs/4_code_documentation.md/`](docs/4_code_documentation.md/)

## Quick Usage

Expand All @@ -41,7 +34,6 @@ void loop() {

Or to run as a random positioning machine, this will run a random walk routine as specified in ESA's work:


```cpp
void loop() {
RPM();
Expand All @@ -50,12 +42,6 @@ void loop() {

Don't forget to set the output pins for you motor controllers!

## Collaboration

Please contact me on LinkedIn or raise an issue.

I would be happy to collaborate on this.

## Contributors

[Dan Dragomirescu @dragomda](https://github.com/dragomda)
54 changes: 18 additions & 36 deletions docs/1_documentation.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# OpenClino

It is very difficult to access a 3D clinostat, there are some companies that sell it but can be prohibitively expensive for gravity research. OpenClino can be built for £100 using off the shelf parts. OpenClino can run in continuous clinorotation or as a Random Positioning Machine (RPM).

This is a side project for me and is very much work in progress.

## Contents list

- [`Bill of Materials`](2_BOM.md)
Expand All @@ -9,45 +13,19 @@
- [Notation](#notation)
- [Code](#code)

## Design requirements

Clinostats are usually used in biology for plants, cell cultures, and small animals such as fish.

1. OpenClino shall be robust to failures to not harm the animals or samples.
2. Openclino must be simple, accessible, and affordable, requiring no machining.
3. OpenClino should operate in hot and humid environments such as incubators.
4. OpenClino should operate as a clinostat or RPM.

At the moment it is a work in progress.
I'm not an electrical engineer so this is 12v. Be careful with your electronics.
At the moment it functions as a clino but not a true RPM. The motors can't start a new direction or speed independently.
You can buy waterproof nema17s and have the electronics outside of the incubator if needed.

TODO material requirements

## Notation
TODO make a figure defining part names

Definitions:
motor_pulley
x_pulley
y_pulley
m2y pulley
y_turn
y_turn_pulley
y_guide
motor_mount
motor_enclosure
which is x and y
## Convention & Definitions

- X body is the external larger square.
- Y body is the internal smaller body.
- Motor pulleys attach to the motor.
- X/Y pulleys attach to the body.
- The "`m2y`" pulley is the one with 2 belts attached.
- The "`y_turn`" is the bearings bending the long y belt.
- The "`y_guide`" is the L shaped bracket holding the y pulley.

## Code

The code is work in progress, it requires the following:
- control multiple motors separately.
- acceleration.
- docs.
- Implementing the airbus algorithm for variable G.
[OpenClino Documentation.](4_code_documentation.md)

### Usage

Expand All @@ -61,7 +39,6 @@ void loop() {

Or to run as a random positioning machine, this will run a random walk routine as specified in ESA's work:


```cpp
void loop() {
RPM();
Expand All @@ -70,3 +47,8 @@ void loop() {

Don't forget to set the output pins for you motor controllers!

# Circuit design

This is a very simple arduino circuit with a button and 2 stepper motor controllers.

![Clinostat circuit.](images/openclino_circuit_diagram.png "Circuit diagram. Made with Cirkit Designer.")
70 changes: 70 additions & 0 deletions docs/4_code_documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# OpenClino Documentation

This document provides reference information about the functions used to control stepper motors in the Arduino project. Each function is described with its purpose, parameters, and behavior.

## Functions

### `void yClockwise(bool foo)`

Sets the direction of the Y-axis motor.

- **Parameters:**
- `foo` (bool): If `true`, sets the direction to clockwise; if `false`, sets it to counterclockwise.

---

### `void spin_continuous(float speedRPMX = 60, float speedRPMY = 60, int finalDelay = 100)`

Spins the X and Y motors continuously at specified speeds until a button is pressed.

- **Parameters:**
- `speedRPMX` (float, default = 60): Speed of the X-axis motor in RPM.
- `speedRPMY` (float, default = 60): Speed of the Y-axis motor in RPM.
- `finalDelay` (int, default = 100): Delay in milliseconds after stopping the motors.

---

### `void spin_degs(float degX, float degY, float speedX = 10, float speedY = 10, int finalDelay = 100)`

Spins the X and Y motors by specified degrees at specified speeds.

- **Parameters:**
- `degX` (float): Degrees to rotate the X-axis motor.
- `degY` (float): Degrees to rotate the Y-axis motor.
- `speedX` (float, default = 10): Speed of the X-axis motor in RPM.
- `speedY` (float, default = 10): Speed of the Y-axis motor in RPM.
- `finalDelay` (int, default = 100): Delay in milliseconds after stopping the motors.

---

### `void RPM()`

Placeholder function for future implementation.

---

### `void calibrate_pulley_teeth()`

Calibrates the pulley teeth by rotating the motors in specific patterns.

---

### `void test_spin_degs_multi()`

Tests the `spin_degs` function with multiple rotations.

---

### `void setup()`

Initializes the Arduino pins and serial communication, and prints a welcome message.

---

### `void loop()`

Main loop that reads the button state and performs actions based on the button press.

- **Behavior:**
- Turns off motors when the button is not pressed.
- When the button is pressed, it turns on the motors, lights up the built-in LED, and runs calibration and test functions.
Binary file added docs/images/openclino_circuit_diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit f6659bb

Please sign in to comment.