This tell at least a few things about your machine not very detailed but tells a little bit.
I will try to explain the sequence of steps that your machine is doing.
certain steps might be wrong because you told just a tiny little bit about the process, though I asked for a very detailed description
The software-tecnique of a statemachine mimics a PLC.
state-machine means you are in certain modes of operation:
- machine ready to start waiting for button-press to start
- applying air-pressure for the piston to go down
- waiting for the piston to arrive at lower position
- switching on air-cooling
- holding piston down with air-cooling on for a certain time
if pressuring-time is over - switch off air-cooling, switch off air-pressure to piston
In parallel to this read in the position of two potentiometers to adjust time and temperature.
A state-machine allows to avoid using delay() which does what its name says: delaying. The function delay() delays everything. Even the reaction on a button-press.
A state-machine in combination with non-blocking timing keeps your control responsive all the time. Even in the situation of keeping a certain mode like "hold pressure"
Curious to learn about how this works?
Here is a tutorial about non-blocking timing
Example-code for timing based on millis() easier to understand through the use of example-numbers / avoiding delay()
and here is a tutorial about how state-machines work
best regards Stefan