Compare commits
2 Commits
withoutGUI
...
steps_for_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bfcd696ccd | ||
|
|
f34eb8b900 |
Submodule matlab_stm_emulate updated: 08719ffc05...a92cd95eeb
@@ -49,17 +49,23 @@ void tiristor_angle_control(TiristorControl_t *ctrl)
|
|||||||
|
|
||||||
if ((uint16_t)((uint16_t)TIMER->CNT - ctrl->angle.start_delay_us) > ctrl->angle.delay_us)
|
if ((uint16_t)((uint16_t)TIMER->CNT - ctrl->angle.start_delay_us) > ctrl->angle.delay_us)
|
||||||
{
|
{
|
||||||
|
#ifndef DISABLE_TIRISTOR_READY
|
||||||
if(ctrl->f.TiristorDone == 0)
|
if(ctrl->f.TiristorDone == 0)
|
||||||
{
|
{
|
||||||
ctrl->f.EnableTiristor = 1;
|
ctrl->f.EnableTiristor = 1;
|
||||||
ctrl->f.TiristorDone = 1;
|
ctrl->f.TiristorDone = 1;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
ctrl->f.EnableTiristor = 1;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void tiristor_start_angle_delay(TiristorControl_t *ctrl)
|
void tiristor_start_angle_delay(TiristorControl_t *ctrl)
|
||||||
{
|
{
|
||||||
|
#ifndef DISABLE_TIRISTOR_READY
|
||||||
ctrl->f.TiristorDone = 0;
|
ctrl->f.TiristorDone = 0;
|
||||||
|
#endif
|
||||||
ctrl->angle.start_delay_us = TIMER->CNT;
|
ctrl->angle.start_delay_us = TIMER->CNT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,10 +88,10 @@ void tiristor_init(TiristorControl_t *ctrl, GPIO_TypeDef *gpiox, uint32_t gpio_p
|
|||||||
ctrl->gpiox = gpiox;
|
ctrl->gpiox = gpiox;
|
||||||
ctrl->gpio_pin = gpio_pin;
|
ctrl->gpio_pin = gpio_pin;
|
||||||
ctrl->angle.delay_max_us = 8000;
|
ctrl->angle.delay_max_us = 8000;
|
||||||
ctrl->angle.delay_min_us = 100;
|
ctrl->angle.delay_min_us = 500;
|
||||||
ctrl->angle.delay_us = 7000;
|
ctrl->angle.delay_us = 8000;
|
||||||
ctrl->angle.delay_step_us = 500;
|
ctrl->angle.delay_step_us = 800;
|
||||||
ctrl->angle.sample_time_ms = 100;
|
ctrl->angle.sample_time_ms = 20;
|
||||||
ctrl->open_time = 1;
|
ctrl->open_time = 1;
|
||||||
TIMER->CR1 |= TIM_CR1_CEN;
|
TIMER->CR1 |= TIM_CR1_CEN;
|
||||||
}
|
}
|
||||||
@@ -10,12 +10,15 @@
|
|||||||
|
|
||||||
|
|
||||||
#define TIMER TIM2
|
#define TIMER TIM2
|
||||||
|
#define DISABLE_TIRISTOR_READY
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
unsigned EnableTiristor:1;
|
unsigned EnableTiristor:1;
|
||||||
unsigned TiristorIsEnable:1;
|
unsigned TiristorIsEnable:1;
|
||||||
|
#ifndef DISABLE_TIRISTOR_READY
|
||||||
unsigned TiristorDone:1;
|
unsigned TiristorDone:1;
|
||||||
|
#endif
|
||||||
}TiristorControlFlags;
|
}TiristorControlFlags;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user