Servomatic.git
12 months agoAdd helpers.ino, fix Servomatic.h and fix a typo
Lukáš Jiřiště [Tue, 19 Nov 2024 14:29:30 +0000 (15:29 +0100)]
Add helpers.ino, fix Servomatic.h and fix a typo

12 months agoImplement interruptable_delay
Lukáš Jiřiště [Mon, 18 Nov 2024 14:36:16 +0000 (15:36 +0100)]
Implement interruptable_delay

This enables a fast interruption of the sequence (mainly the
wait_for_equilibrium method).

12 months agoChange pwm_pin to control_pin
Lukáš Jiřiště [Mon, 18 Nov 2024 10:03:13 +0000 (11:03 +0100)]
Change pwm_pin to control_pin

This is done because the Servo library does not use the PWM
functionality of the digital pins for the servo control. I thought it
does but it uses an inner timer for timing the pulses.

12 months agoRefactor open_barely out of Valve class to a child
Lukáš Jiřiště [Mon, 18 Nov 2024 09:59:08 +0000 (10:59 +0100)]
Refactor open_barely out of Valve class to a child

Because the open_barely method would only be used barely, I think it is
better to separate it.

12 months agoAdd .gitignore to ignore .compile files
Lukáš Jiřiště [Mon, 18 Nov 2024 09:23:27 +0000 (10:23 +0100)]
Add .gitignore to ignore .compile files

12 months agoAdd "barely opened" position to Valve class
Lukáš Jiřiště [Mon, 18 Nov 2024 09:08:26 +0000 (10:08 +0100)]
Add "barely opened" position to Valve class

When measuring solubility of gasses in liquids, opening of the valve and
the resulting movement of gas may upset the level of the liquid to the
point of blowing droplets somewhere, where they cause problems (mainly
weighing of the sample after measurement).
Opening the Valve barely to make equilibration of the pressures take
more time should prevent the violent gas flow.

12 months agoAdd monitor rules to Makefile
Lukáš Jiřiště [Mon, 18 Nov 2024 08:37:23 +0000 (09:37 +0100)]
Add monitor rules to Makefile

12 months agoReverse the role of p_e and a in optimization
Lukáš Jiřiště [Wed, 13 Nov 2024 11:01:51 +0000 (12:01 +0100)]
Reverse the role of p_e and a in optimization

The p_e can be calculated for a fixed a without logarithmization, so the
minimum should be the true minimum. Also some other minor changes to the
function around were made.

12 months agoUpdate schematics to "final" version
Lukáš Jiřiště [Wed, 13 Nov 2024 10:06:17 +0000 (11:06 +0100)]
Update schematics to "final" version

12 months agoInitialize m_time_start, add m_size increment
Lukáš Jiřiště [Tue, 12 Nov 2024 10:58:43 +0000 (11:58 +0100)]
Initialize m_time_start, add m_size increment

The m_time_start should be initialized, so that the time measurement
does not overflow sooner then 49 days after the start. Additionally the
m_time_start is reset in clear() method for the same reason.

The m_size was not adjusted upon creating a new measurement. This means
that no measurement but the last is was saved. This is now fixed.

12 months agoRename measure_until to wait_for_equilibrium
Lukáš Jiřiště [Tue, 12 Nov 2024 07:57:56 +0000 (08:57 +0100)]
Rename measure_until to wait_for_equilibrium

12 months agoCreate Measurement to track pressure over time
Lukáš Jiřiště [Mon, 11 Nov 2024 16:00:11 +0000 (17:00 +0100)]
Create Measurement to track pressure over time

This is an untested implementation. The new class should provide the
functionality necessary to conveniently control the cell.
Minor changes for compatibility and eventual testing in other files.

12 months agoName the pins to make it easier to understand
Lukáš Jiřiště [Mon, 11 Nov 2024 15:59:09 +0000 (16:59 +0100)]
Name the pins to make it easier to understand

12 months agoUpdate schematics
Lukáš Jiřiště [Tue, 5 Nov 2024 15:48:12 +0000 (16:48 +0100)]
Update schematics

Add commentary about pin function
and an on/off switch with indication LED.

12 months agoAdd Valve class, change Makefile and Servomatic.ino
Lukáš Jiřiště [Tue, 5 Nov 2024 14:22:14 +0000 (15:22 +0100)]
Add Valve class, change Makefile and Servomatic.ino

The main function needs to have init() before the declaration of first
Valve, because the Valve constructor needs the arduino initialized. One
cannot declare Valve before calling init().
Due to this and me liking variable declaration at the start of a
function, I've written the actual contents of main to a new function.

12 months agoRemove Makefile rules for .upload
Lukáš Jiřiště [Tue, 5 Nov 2024 09:11:23 +0000 (10:11 +0100)]
Remove Makefile rules for .upload

The .upload file is not doing much as it needs to be done every time the
compilation is done. And with the addition of another project, it does
not reflect, whether the arduino actually has the program uploaded.

12 months agoAdd servotest subproject
Lukáš Jiřiště [Tue, 5 Nov 2024 09:01:58 +0000 (10:01 +0100)]
Add servotest subproject

This small project aims to get the precise values for PWM of servos.
A potentiometer is used to control the servo signal through the arduino,
and the arduino reports the microseconds value to the serial output.

13 months agoMake the PressureSensor more flexible
Lukáš Jiřiště [Mon, 4 Nov 2024 14:16:37 +0000 (15:16 +0100)]
Make the PressureSensor more flexible

Add some parameter to PressureSensor to make using other sensors easier.

13 months agoAdd svg file with the schematics
Lukáš Jiřiště [Mon, 4 Nov 2024 11:21:37 +0000 (12:21 +0100)]
Add svg file with the schematics

This is not directly connected to the function of the code, but it is
useful for my colleagues, who will use this repo.

13 months agoChange Makefile to better track what to do
Lukáš Jiřiště [Wed, 23 Oct 2024 09:13:40 +0000 (11:13 +0200)]
Change Makefile to better track what to do

Normally the object files and executable are used for tracking but
arduino-cli does not generate any files inside the working directory.
The changes use dotfiles .compile and .upload to keep track of what
needs to be done.
In addition to the dotfiles compile and upload rules were added, that
force the action.

13 months agoSwitch from double to float
Lukáš Jiřiště [Wed, 23 Oct 2024 08:53:24 +0000 (10:53 +0200)]
Switch from double to float

Float has 24bit significant so it has plenty of precision for the 10bit
AD conversion and should take less space.

13 months agoImplement PressureSensor class and use it in main
Lukáš Jiřiště [Wed, 23 Oct 2024 08:43:22 +0000 (10:43 +0200)]
Implement PressureSensor class and use it in main

13 months agoFix Makefile dependencies
Lukáš Jiřiště [Wed, 23 Oct 2024 08:41:47 +0000 (10:41 +0200)]
Fix Makefile dependencies

13 months agoAdd a small test program for the UNO
Lukáš Jiřiště [Tue, 22 Oct 2024 08:28:33 +0000 (10:28 +0200)]
Add a small test program for the UNO

This program makes a LED (pin 4) switch state whenever pin 7 is
connected to ground (through button).

13 months agoAdd Makefile for building and uploading to UNO
Lukáš Jiřiště [Tue, 22 Oct 2024 08:27:16 +0000 (10:27 +0200)]
Add Makefile for building and uploading to UNO

The Makefile uses arduino-cli.