Hi everyone!
I have a problem as follows.In labview virtual device model created using a mathematical equation.This virtual device model is controlled by atmega with implemented PI controller. In labview I can change settings Kp and Ki. The settings are sent through RS232 to atmega with PI algoritm implemented.After calculating the error value is transmitted back to labview. The crux of the matter. After add and setting Ki project crashing (for example, generates graphs setpoint value = 0). The question is - there is in the code correct implementation setting Ki due to transfer it to rs232? I wonder how is the reception of the two values from the atmega, or you can send / receive one value after another, whether it should be set to some "flag, break in transmission" before reading the other variable (reveice Kp...stop..wait for Ki.. receive Ki...).
Translate of the names at diagram:
ilosc iteracji (how many iterations)
Wartosc zadana temperatury (setpoint final value temperature of the math model)
Czas probkowania (sampling time)
Sygnal (signal from Atmega PI after the calculation) - generates graphs setpoint value = 0 if I add Ki
atmega code fragment:
//---value received from labview Kp--------------- int Kp; Kp = (int)USART0_Receive(); USART0_Transmit(Kp); //---value received from labview Ki--------------- int Ki; Ki = (int)USART0_Receive(); USART0_Transmit(Ki);i int setpointvalue = (int)USART0_Receive();// value received from labview