Siphon Regulator 1.0
Nanosattelite attitude determination and control system.
Loading...
Searching...
No Matches
loop_fcn_def.h
Go to the documentation of this file.
1/*
2 * Loop functions library
3 * (c) Antonin_Putala 2026
4 *
5 * Developed using STM32CubeIDE
6 * Tested on BluePill board and STM32F103C8T6, 32 MHz.
7 */
8
20#ifndef INC_LOOP_FCN_DEF_H_
21#define INC_LOOP_FCN_DEF_H_
22
23/* Defines ------------------------------------------------*/
25#define ANGLE_TOL 5
26
27/* Constant for stop pulse calculation - slope, left valve. */
28#define STOP_CONST_LEFT (1000.0f/7.808f)
29
30/* Constant for stop pulse calculation - slope, right valve. */
31#define STOP_CONST_RIGHT (1000.0f/11.7f)
32
33/* Constant for stop pulse calculation - offset, left valve. */
34#define STOP_CONST_OFF_LEFT 1.552f
35
36/* Constant for stop pulse calculation - offset, right valve. */
37#define STOP_CONST_OFF_RIGHT 0.047f
38
40#define GYR_TOL 1.0f
41
43#define PULSE_IGNORE 50
44
45/* Static functions declaration ---------------------------*/
46/* Function prototypes ------------------------------------*/
50static void valve_close(void);
51
71static void regul_stop(uint32_t * p_reg, uint32_t * p_ticks);
72
93static void regul_return(uint32_t * p_reg, uint32_t * p_ticks, float set_pos);
94
96#endif /* INC_LOOP_FCN_DEF_H_ */
static void valve_close(void)
Closes all valves.
static void regul_stop(uint32_t *p_reg, uint32_t *p_ticks)
It provides the stopping pulse.
static void regul_return(uint32_t *p_reg, uint32_t *p_ticks, float set_pos)
It initiates the return to the stable orientation.