Начало и конец управляющего тока УМП регулируются
This commit is contained in:
@@ -102,6 +102,8 @@ Log_to_mem(modbus[0x1D]);
|
||||
void Load_runner()
|
||||
{
|
||||
static unsigned int count_dac=0, count_load=0, x=1;
|
||||
static unsigned int preStart=0;
|
||||
static float dac_go,dac_stop;
|
||||
float sinus=0;
|
||||
int kod;
|
||||
|
||||
@@ -128,12 +130,23 @@ void Load_runner()
|
||||
{
|
||||
if(cUMPstart)
|
||||
{
|
||||
if(!preStart)
|
||||
{
|
||||
dac_go=DAC_go-4;
|
||||
dac_stop=DAC_stop-4;
|
||||
if(dac_go<0) dac_go=0;
|
||||
if(dac_go>5) dac_go=5;
|
||||
if(dac_stop>16) dac_go=16;
|
||||
if(dac_stop<=dac_go) dac_stop=dac_go+1;
|
||||
}
|
||||
|
||||
if(count_load > (time_dac/2))count_load++;
|
||||
|
||||
if(++count_load > time_dac) count_load = time_dac;
|
||||
|
||||
// sinus = ((float)(DAC_stop - DAC_go) / 16.0 * count_load) + ((float)(DAC_go - 4.0) / 16.0 * time_dac);
|
||||
sinus = (10.0 / 16.0 * count_load) + (2.0 / 16.0 * time_dac);
|
||||
sinus = ((dac_stop - dac_go) / 16.0 * count_load) + (dac_go / 16.0 * time_dac);
|
||||
|
||||
// sinus = (10.0 / 16.0 * count_load) + (2.0 / 16.0 * time_dac);
|
||||
}
|
||||
else
|
||||
{ count_load = 0;
|
||||
@@ -141,6 +154,8 @@ void Load_runner()
|
||||
x = (x+1)&0x3FF;
|
||||
}
|
||||
|
||||
preStart = cUMPstart;
|
||||
|
||||
if(!x || cInitDac)
|
||||
{
|
||||
Init_DAC(); x=1; cInitDac=0;
|
||||
|
||||
Reference in New Issue
Block a user