Skip to content

Commit

Permalink
moved demo scripts into demo folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Chr157i4n committed Nov 15, 2023
1 parent f154b43 commit 62ba7bd
Show file tree
Hide file tree
Showing 10 changed files with 9 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ If you test this on a breadboard, make sure to cut off the bottomside of the pin
## Tests
You can run the test files from the main directory with
```
python3 -m tests.test_script_01_uart_connection
python3 -m demo.test_script_01_uart_connection
```

#### [test_script_01_uart_connection.py](tests/test_script_01_uart_connection.py)
#### [test_script_01_uart_connection.py](demo/test_script_01_uart_connection.py)
This only communicates with the TMC driver over UART. It should set some settings in the driver and then outputs the settings.
When it outputs ```TMC2209: UART Communication Error```, you need to check the UART-connection.

#### [test_script_02_pin_connection.py](tests/test_script_02_pin_connection.py)
#### [test_script_02_pin_connection.py](demo/test_script_02_pin_connection.py)
This script enables the raspberry GPIO output for the dir, en and step pin and then checks the TMC driver register,
whether the driver sees them as HIGH or LOW. Because the enabled pin is activated for a short time, the motor current ouput
will be also activated in this script for a short time.
Expand All @@ -88,23 +88,23 @@ Pin STEP: OK
Pin EN: OK
if not, check the connection of the pin.

#### [test_script_03_basic_movement.py](tests/test_script_03_basic_movement.py)
#### [test_script_03_basic_movement.py](demo/test_script_03_basic_movement.py)
This script should move the motor 6 times, one revolution back and forth.

#### [test_script_04_stallguard.py](tests/test_script_04_stallguard.py)
#### [test_script_04_stallguard.py](demo/test_script_04_stallguard.py)
In this script the stallguard feature of the TMC2209 is beeing setup.
A funtion will be called, if the driver detects a stall. The function stops the current movement.
The motor will be moved 10 revolutions. If the movement is finished unhindered, the script outputs ```Movement finished successfully```.
If you block the motor with pliers or something similar, the the motor will stop and the script outputs ```StallGuard!``` and ```Movement was not completed```

#### [test_script_05_vactual.py](tests/test_script_05_vactual.py)
#### [test_script_05_vactual.py](demo/test_script_05_vactual.py)
VACTUAL allows moving the motor by UART control. It gives the motor velocity in +-(2^23)-1 [μsteps / t]

#### [test_script_06_multiple_drivers.py](tests/test_script_06_multiple_drivers.py)
#### [test_script_06_multiple_drivers.py](demo/test_script_06_multiple_drivers.py)
Multiple drivers can be addressed via UART by setting different addresses with the MS1 and MS2 pins.
Simultaneous movement of multiple motors can be done with threaded movement.

#### [test_script_07_threads.py](tests/test_script_07_threads.py)
#### [test_script_07_threads.py](demo/test_script_07_threads.py)
In this script, the movement of a stepper with threads is shown. This can be used to do other task while moving a motor, or to move several motors simultaneous.

\
Expand Down
1 change: 1 addition & 0 deletions demo/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#pylint: disable=invalid-name
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 62ba7bd

Please sign in to comment.