As silly as this may be… I just recently started playing with Arduino and am currently trying to set the sketch up to turn the PID function off until the User sends a new Setpoint higher than 300 and less than 800.
the goal is to try to use Fahrenheit even though I’m fairly familiar with Celsius.
i would also be ok with the Setpoint being 0 when the PID is “OFF” as it will very rarely actually be powered down.
the Code below is what currently have. Once I can change the Setpoint I can manage the rest I believe.
I should have mentioned that the arduino is controlling a SSR on pin 8 and getting a readout from a MAX6675 Thermocouple. The Thermocouple is reading a heating element, which is heated by the SSR
I’ve been slowly pouring over it and learning how everything functions as I go along. but at the moment i think i need to implement the start character as well then parse it?
enkitheotter:
I've been slowly pouring over it and learning how everything functions as I go along. but at the moment i think i need to implement the start character as well then parse it?
It is much easier to help if you use the examples unchanged because then I don't have to try to figure out if you have broken something.
It is not essential to use a start-character. It does make things more reliable but it will make things a little less convenient for a human entering data at the keyboard.
I can set my Setpoint now. but i can visibly change it while bool Power = true
the only other issue I’m having at the moment is the temp is reading out live. It was working in the same spot as before. it reads the temp once when the arduino starts the code then reads the same over and over
enkitheotter:
the only other issue I'm having at the moment is the temp is reading out live.
I don't understand that and I can't make sense of your code because you have {} braces all over the place. Use the AutoFormat tool to lay your code out consistently for easy reading. It also makes code easier to read if you always use pairs of {} with IF and ELSE even when not strictly necessary.
I got the Serial Code working. also Auto formatted for easier reading.
As of now my PID code is having issues. The temperature is running away well past the Setpoint.
when i disconnect the AC from it the temp drop drastically(about 200-300F).
enkitheotter:
sorry i meant the temp isn't reading out live.
I got the Serial Code working. also Auto formatted for easier reading.
As of now my PID code is having issues. The temperature is running away well past the Setpoint.
when i disconnect the AC from it the temp drop drastically(about 200-300F).
You are still assuming we know all about your project. What has AC got to do with it? Write a proper explanation so we know what you know
enkitheotter:
I should have mentioned that the arduino is controlling a SSR on pin 8 and getting a readout from a MAX6675 Thermocouple. The Thermocouple is reading a heating element, which is heated by the SSR
I have actually already explained the project as seen above.
The 110V 25A SSR is controlled by the “RelayPin” (currently Pin 8. I’ve defined the “RelayPin” before Setup.) and lets Power flow to the heating element( in this case a Hotrunner).
The MAX6675 board is connected to 5 CLK, 6 DO, 7 CS. It also reads the Heating Elements temp.
The temperature is running away then stabilizing which is fine. pretty sure its supposed to do that?
The goal is for the user to input a new Setpoint = 0 or Setpoint >=300 && Setpoint <= 800
so setpoint has a value of 0 or somewhere between 300-800F
0 would be off in this case.
The PIDs goal in this case is to control the SSR based on the temperature readout from the MAX6675.
If the temp that is read is too high turn off the SSR
If the Temp that is read is too low turn on the SSR.
the PID is checking about every 100ms based from the library
enkitheotter:
the PID is checking about every 100ms based from the library
What is being heated?
How many degrees will the temperature change in 100 millisecs?
Let's take things step by step ...
If you "hard code" different setpoint values in your program does it work properly? If not then that needs to be fixed before you worry about Serial input.
If it does work with hard-coded values then it is a simple matter to update the value of the variable using input from Serial.