Skip to content

Commit 37d7cac

Browse files
committed
main (merge): merge develop branch into main
2 parents d31a880 + 3275f44 commit 37d7cac

File tree

233 files changed

+142807
-3
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

233 files changed

+142807
-3
lines changed

README.md

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,37 @@
1-
# project template
1+
# dynamics lab
22

3-
This project is `under development` and the `main` branch will remain empty until `v1.0.0` is ready for release. All development should be done on branches off of `develop`. See [PROJECT.md](PROJECT.md) for details.
3+
Dynamics experiment to investigate resonance of a mass-beam system. Free decay or driven oscillations can be measured. Frequency of driven oscillation can be controlled using a stepper motor and the uStepper s32 driver board.
44

5+
Initial prototype designed as part of an undergraduate student project in the School of Engineering, University of Edinburgh. That design was modified and implemented in this remote laboratory for the Structural Mechanics and Dynamics 3 course in the same department. The experiments are on public display in the School of Engineering:
56

7+
<div>
8+
<img src="./img/dynamics-single-exp.jpeg" alt="single experiment" height="450"/>
9+
<img src="./img/atrium-install.jpeg" alt="atrium install" height="450"/>
10+
</div>
11+
12+
If you are interested in adopting or designing a new remote laboratory based on this, or any, practable remote lab then please visit [www.practable.io](http://www.practable.io)
13+
14+
15+
16+
# Contents
17+
18+
Details of the hardware, firmware and UI can be found in the following directories:
19+
20+
- [fw](./fw/README.md)
21+
- [hw](./hw/README.md)
22+
- [ui](./ui/README.md)
23+
- [sbc](./sbc/README.md)
24+
25+
# Activities
26+
27+
- Free decay in a mass-spring system
28+
- Damping ratio of free decay
29+
- Resonance curve for driven oscillations
30+
- Phase lag between driver and oscillator
31+
32+
## Version History
33+
34+
| Date | Version | Update notes |
35+
| ------| ------------- | ------------- |
36+
| September 2025 | v1.0 | Initial production release of dynamics lab |
637

1.1 MB
Binary file not shown.

docs/Product_sheet_S32.pdf

3.55 MB
Binary file not shown.
1.67 MB
Binary file not shown.

docs/STM32F401XB.PDF

2.01 MB
Binary file not shown.
Binary file not shown.

fw/README.md

Lines changed: 103 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,103 @@
1-
# firmware
1+
# Dynamics Lab Firmware
2+
3+
Please Note: This firmware relies on a MODIFIED version of the uStepperS32 library, please uninstall any version installed from the Arduino library manager and install [this](https://github.com/ImogenWren/uStepperS32) version available at [https://github.com/ImogenWren/uStepperS32](https://github.com/ImogenWren/uStepperS32)
4+
5+
## Current Version
6+
-> [dynamics-lab-firmware-V1.0.0](https://github.com/practable/dynamics-lab/tree/fw-dev/fw/dynamics_lab_firmware_V1_x_x)
7+
8+
## Calibration Procedure: Setting home position (V1.0.0 - Beta Firmware)
9+
#### Setting Secret
10+
_Secret must be set before calibration data can be entered. Once set, a finite number (20) of calibrations are permitted. To calibrate after this point, secret must be reset using `Resetting Secret` procedure_
11+
- Enter new 8-character secret using command `{"set":"secret","to":"XXXXXXXX"}`
12+
- Once set this is persistant and will require re-programming firmware to reset
13+
<br><br>
14+
15+
_All following steps should be carried out during runtime without powering off in between. If steps are missed and status is unknown, or system has run out of calibration memory, please see section `Resetting Secret`_
16+
17+
#### Finding Home Position & Calibration Offset figure
18+
- `{"set":"cal","to":"0"} ` to remove any existing offset
19+
- Use `{"set":goto","to":"X"}` (int -> goto angle) and `{"set":"move","to":"X"}` (float -> move angle) to position weighted blade in the 12 o'clock or 0 degree position
20+
- Note down `"pos(raw)"` value from Serial JSON stream. Retain this value as it will be required later.
21+
- `{"set":"cal","to":"{pos(raw)}"} ` to apply offset.
22+
<br>
23+
24+
#### Testing Calibration
25+
- Use `{"set":goto","to":"180"}` to position weighted blade away from home position.
26+
- Test homing function with `{"set":"home"}`. Weighted blade should return to the home position
27+
- If nessissary run complete experiment to check for any deviation from nominal data set.
28+
- Repeat untill happy with system calibration
29+
- When happy with calibration, move on to `Saving Calibration Data to Persistant Memory`
30+
- <br>
31+
32+
#### Saving Calibration Data to Persistant Memory
33+
- use command ` {"set":"setcal","to":"0 - 32k", "auth":"XXXXXXXX"}` using the integer value previously noted down, and the secret entered into persistant memory in the first step. This will error if authorisation secret is incorrect, or the system has run out of available calibrations
34+
- Use command ` {"set":"getcal"} ` to check contents of persistant memory
35+
<br>
36+
37+
##### Possible Errors
38+
- If error `signature did not match` secret may not have been entered
39+
<br>
40+
41+
#### Resetting Secret
42+
- To reset secret firmware file must be modified.
43+
- In file `secretObject.h` find line `#define PROGRAM_SIGNATURE 0xXXXXXXXX`
44+
- This value is arbitary and simply validates the data stored in persistant memory with the currently installed firmware.
45+
- Change this value and re-Upload firmware.
46+
- On boot-up, system will not recognise previous signature and will allow entry of a new secret (though calibration data may still be visible having been recalled from persistant memory -> this will be overwritten when new secret is added)
47+
<br><br>
48+
49+
_Verbose Command Structure_
50+
```
51+
{"set":"hz","to": -20 to 20} -> Set Motor Speed in Hz
52+
{"set":"rpm","to": -200 to 200} -> Set Motor Speed in RPM
53+
{"set":"home"} -> Move Motor to home pos
54+
{"set":"cal","to":0-32768} -> Set the home position offset calibration
55+
{"set":"free"} -> Set freewheel brake mode
56+
{"set":"brake"} -> Set coolbrake brake mode
57+
{"set":"goto","to": -360 to 360} -> Goto Angle (int val)
58+
{"set":"move","to": -360 to 360} -> Move Angle (float val)
59+
{"set":"sample","to": 1 to 200} -> Set Samplerate in Hz (dflt: 200)
60+
{"set":"print","to": 1 to 50} -> Set Print Rate in Hz (dflt: 50)
61+
{"set":"stream"} -> Start Data Streaming
62+
{"set":"endst"} -> End Data Streaming
63+
{"set":"snap"} -> Take Data Snapshot
64+
{"set":"time","to": 1 to 250000 } -> Set Time for Data Snapshot (mS)
65+
{"set":"ping"} -> Ping Servo
66+
{"set":"offset","to":-32k to 32k} -> DEPRECIATED
67+
{"set":"secret","to":"XXXXXXXX"} -> Set 8 character secret
68+
{"set":"setcal","to":"0 - 32k", "auth":"XXXXXXXX"} -> Set calibration offset to memory
69+
{"set":"getcal"} -> Load calibration from memory
70+
{"set":"demo"} -> Run Demo Mode (interrupted by any other command)
71+
{"set":"help"} -> Print Commands to Serial Monitor
72+
73+
74+
```
75+
76+
77+
_Succinct Command Structure_
78+
```
79+
{"hz": -20 to 20} -> Set Motor Speed in Hz
80+
{"rpm": -200 to 200} -> Set Motor Speed in RPM
81+
{"home":0}* -> Move Motor to home pos
82+
{"cal":0-32768} -> Set the home position offset calibration
83+
{"free":0}* -> Set freewheel brake mode
84+
{"brake":0}* -> Set coolbrake brake mode
85+
{"goto": -360 to 360} -> Goto Angle (int val)
86+
{"move", -360 to 360} -> Move Angle (float val)
87+
{"sample": 1 to 200} -> Set Samplerate in Hz (dflt: 200)
88+
{"print": 1 to 50} -> Set Print Rate in Hz (dflt: 50)
89+
{"stream":0}* -> Start Data Streaming
90+
{"endst":0}* -> End Data Streaming
91+
{"snap":0}* -> Take Data Snapshot
92+
{"time": 1 - 250000 } -> Set Time for Data Snapshot (mS)
93+
{"ping":0}* -> Ping Servo
94+
{"offset":-32k to 32k} -> DEPRECIATED
95+
{"secret":"XXXXXXXX"} -> Set 8 character secret
96+
{"setcal":"0 - 32k", "auth":"XXXXXXXX"} -> Set calibration offset to memory
97+
{"getcal":0}* -> Load calibration from memory
98+
{"demo":0}* -> Run Demo Mode (interrupted by any other command)
99+
{"help":0}* -> Print Commands to Serial Monitor
100+
101+
* For single commands data value is ignored but required for valid JSON string
102+
```
103+

0 commit comments

Comments
 (0)