PID library

My question is regarding the PID library, and the PID front end (processing) both written by Brett Beauregard.

Great pid library. Interfaces with the processing gui beautifully for controlling the PID.

One PROBLEM

In the gui, in manual mode, when information is sent to the arduino, the mode unintentionally changes from manual to automatic. Which can have some unintended effects.

Im pretty new, I'm impressed with what I've done so far but I cant figure this one out.

Anybody know where to find the solution?

Cheers

Is Processing sending the command to change mode or is the Arduino doing it regardless ?

Its important to include the code of your sketch for software issues.

MarkT:
Its important to include the code of your sketch for software issues.

its the sketch that is included with the PID front end library that was written. this action occurs even with the original code regardless of what i write

UKHeliBob:
Is Processing sending the command to change mode or is the Arduino doing it regardless ?

i think its processing? but maybe Im missing something the processing sketch is called PID_Front-endv3

PID_front_end_sample.ino (5.18 KB)

i think its processing? but maybe Im missing something the processing sketch is called PID_Front-endv3

It is going to be difficult to provide help unless we know
Sorry, but the name of the Processing sketch is of no help

From the Arduino sketch

void SerialReceive()
{

  // read the bytes sent from Processing
  int index=0;
  byte Auto_Man = -1;
  byte Direct_Reverse = -1;
  while(Serial.available()&&index<26)
  {
    if(index==0) Auto_Man = Serial.read();

It looks like Processing is sending the auto/manual flag

Later in the code I see

    if(Auto_Man==0)                       // * only change the output if we are in 
    {                                     //   manual mode.  otherwise we'll get an
      Output=double(foo.asFloat[2]);      //   output blip, then the controller will 
    }                                     //   overwrite.

If you want the Arduino to stay in manual mode permanently then set Auto_Man to zero whatever is received from Processing, otherwise you will need help with the Processing code

UKHeliBob:
It is going to be difficult to provide help unless we know
Sorry, but the name of the Processing sketch is of no help

From the Arduino sketch

void SerialReceive()

{

// read the bytes sent from Processing
 int index=0;
 byte Auto_Man = -1;
 byte Direct_Reverse = -1;
 while(Serial.available()&&index<26)
 {
   if(index==0) Auto_Man = Serial.read();



It looks like Processing is sending the auto/manual flag

Later in the code I see


if(Auto_Man==0)                       // * only change the output if we are in
   {                                     //   manual mode.  otherwise we’ll get an
     Output=double(foo.asFloat[2]);      //   output blip, then the controller will
   }                                     //   overwrite.




If you want the Arduino to stay in manual mode permanently then set Auto_Man to zero whatever is received from Processing, otherwise you will need help with the Processing code

okay ive attached the processing code, ive tried a number of combinations of things to get the status to stay but I am really quite novice

PID_FrontEnd_v03.pde (15.8 KB)

Try this as an experiment

void SerialReceive()
{

  // read the bytes sent from Processing
  int index=0;
  byte Auto_Man = -1;
  byte Direct_Reverse = -1;
  while(Serial.available()&&index<26)
  {
    if(index==0) Auto_Man = Serial.read();
    Auto_Man = 0;  //ignore input and force manual mode

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.