From f34eb8b900e18594d03e2b9c856ab267b8422dd6 Mon Sep 17 00:00:00 2001 From: Razvalyaev Date: Fri, 16 May 2025 08:23:01 +0300 Subject: [PATCH] =?UTF-8?q?=D1=82=D0=B5=D1=81=D1=82=20zero=20cross=20detec?= =?UTF-8?q?ted?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- matlab_stm_emulate | 2 +- mcu_project/upp/Core/upp/upp.c | 25 +++++++++++++------------ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/matlab_stm_emulate b/matlab_stm_emulate index 08719ff..ea8bdbc 160000 --- a/matlab_stm_emulate +++ b/matlab_stm_emulate @@ -1 +1 @@ -Subproject commit 08719ffc055e27b3b22a9c37742add86ece43ea4 +Subproject commit ea8bdbc185777a1321e8dedcfb76bfeb7f74b94c diff --git a/mcu_project/upp/Core/upp/upp.c b/mcu_project/upp/Core/upp/upp.c index 39cf054..9d61be4 100644 --- a/mcu_project/upp/Core/upp/upp.c +++ b/mcu_project/upp/Core/upp/upp.c @@ -10,27 +10,28 @@ void upp_main(void) upp_phase_routine(&phase_B); upp_phase_routine(&phase_C); - upp_phase_control(&phase_A); - upp_phase_control(&phase_B); - upp_phase_control(&phase_C); +// upp_phase_control(&phase_A); +// upp_phase_control(&phase_B); +// upp_phase_control(&phase_C); } void upp_phase_control(Phase_t *phase) { - if(is_zero_cross(&phase->zc_detector)) - { - tiristor_start_angle_delay(&phase->ctrl); - - if (phase->ctrl.f.TiristorIsEnable) - tiristor_disable(&phase->ctrl); - } + tiristor_angle_control(&phase->ctrl); + tiristor_control(&phase->ctrl); } void upp_phase_routine(Phase_t *phase) { - tiristor_angle_control(&phase->ctrl); - tiristor_control(&phase->ctrl); zero_cross_update(&phase->zc_detector); + if(is_zero_cross(&phase->zc_detector)) + { + phase->ctrl.gpiox->ODR ^= phase->ctrl.gpio_pin; +// tiristor_start_angle_delay(&phase->ctrl); + +// if (phase->ctrl.f.TiristorIsEnable) +// tiristor_disable(&phase->ctrl); + } } void upp_init(void)