Articles Hierarchy

Articles Home » Arduino Projects » ARDUINO uPCS


actually the work did not stop here, i just took a sidestep and exported one PID control with minimum functionality to run it in a UNO/Leonardo/ProMicro.
And connect it by USB to a Raspberry PI ( optional also a win7 PC ) and
feed data to a google spreadsheet as "historic datacollection"
As next step i make a operation program ( by python ) what adds faceplate, current trend and tuning for the PID control here

now we are back:
until now the operation of the uPCS was limited to the terminal window on the USB link to the arduino ( DUE / MEGA ) via the menu, now i want use the RPI with the mentioned python programs.
First i need to change in uPCS the arduino code similar, with the compiler switch for the operation menu manual / RPI.
and introduce the short CSV line reporting and tuning.
but there are always problems, in uPCS we have different loop points with different point types
and we have a 'new' feature, the alarming, what not follows my actual datastream from PID control
so the first connection ( DUE <--> RPI ) is some coding away.
most of it is just formatting the output from DUE to RPI ( if compiler switch is unset )
but i found a logical error in the existing communication,
Operation: "R" ",1,PCT,,RSP,MODE,,"
Tuning: "T" ",1,PID,....."
get Tuning "t" this can not work, arduino has to know it has to send actual tuning of WHAT point it only works now in UNO because there is only one point.
next error is about the startup, as the Leonardo does not init when connect / open serial from python i did not notice until now work with DUE ( programming port ) that the initial setpoint write from the init file ( first action, even before any ser. read ) does not work. DUE needs a 1sec delay to be ready for "R".... but possibly only when you connect DUE to a running PC and start service manually. when RPI and DUE are powered up same time it could work even without???

next step, as we have DBI 1,2,5,6,8,9 in uPCS prepared ( of 1 .. 9 conti jobs ) with 1,2 PID loops, 5,6 IND loops and 8,9 DCP loops,
i can not expect to transport each single reported line ( with added timestring ) in a one line file to the operation and being read from there in time.
now i use a string array ( 0 .. 9 ) and store all PCT infos from arduino in line 1 .. 9 and optional PID reporting to line 0
and that i write to the FROMARDUINO.csv file every time a new PCT or PID line arrives.
Now the operation can read that now 10 line file and has all actual data with timestring ( each).

for the operation that has many consequences, it works and still starts with PID faceplate of loop DBI 1, what now not makes sense any more.
we need to start with a process picture now what contains dynamic elements of all loops ( mini faceplates ) with link to open the faceplate,
and there we need 3 type, PID prototype we have, IND and DCP point type must make new.