Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temperature control enhancement #62

Open
rloftinbiz opened this issue Jun 21, 2017 · 5 comments
Open

Temperature control enhancement #62

rloftinbiz opened this issue Jun 21, 2017 · 5 comments

Comments

@rloftinbiz
Copy link

Regarding controlling the heater to achieve consistent (non-wandering) temperatures.

Using PWM (pulse width modulation) is a practical and known method for controlling analog devices to vary outputs. Pulsing the heat (probably high only) on and off at varying rates (typically multiple time a second) can achieve stable heater output.

Setting up a calibration program to record stabilized PWM rates in a table for each temperature (ideally 1 degree increments ~150 to 550 or about 400 entries - a small table) would without needing a temperature sensor feedback loop create reliable and stable heater performance.

An added benefit is every SR700 would then have a calibrated table of PWM specs generated for that unique machine.

In use when a created profile indicates 373 degrees for 1 minute with a fan speed of 7, the software looks in its calibrated table and uses the PWM spec to create 373 degrees.

It appears that the processor speed and electronics of the SR700 would support PWM heater control.

Hopefully the principle is clear.
• Use PWM to control the heat output instead of temperature sensor feedback.
• Create table calibration values using the temperature sensor.
• Vary the PWM until a stable temperature is reached.
• Record the PWM data in the calibrations table and repeat for the next degree.
• Once calibrated, use the PWM table plus .json data to execute a profile’s requirements.

The result is an ability to dynamically control the SR700 heat without relying upon the temperature sensor. The sensor is then only used to read and display actual temperatures.

If with age or other reasons the requested temperature does not match the sensor reading, simply recalibrate and update the PWM table. It should be suggested that periodic cleaning, blowing out accumulated debris, and general inspection of the SR700 creates more consistent performance.

If I can answer any questions I am happy to do that.
Regards,
Richard

@dholl
Copy link

dholl commented Jun 30, 2017

Wouldn't the calibration table need to change depending upon how much coffee is being roasted? (Thermal load?) and perhaps even depend a little upon the size of the individual coffee beans if that can change airflow dynamics?)

It would be nifty to incorporate a little control systems math to auto-correct for these variables. Here's a tip-of-the-iceberg:
https://www.av8n.com/physics/feedback-controller.htm

Ah, and here's a deeper intro, leading into modern state-space methods:
https://epxx.co/artigos/stfeed_en.html

for accurate roasting profiles... ;)

@rloftinbiz
Copy link
Author

rloftinbiz commented Jun 30, 2017 via email

@dholl
Copy link

dholl commented Jun 30, 2017

@rloftinbiz
Copy link
Author

rloftinbiz commented Jul 1, 2017 via email

@int3ll3ct
Copy link
Collaborator

This is an interesting conversation. What I'll say is that the goal of the 'thermostat' mode of the freshroastsr700 driver was to do closed-loop PID control using the chamber temperature sensor as input. What is implemented in v0.2.3+ is as good as it's going to get without upgrading sr700 firmware itself, which is beyond the scope of this project (Openroast and freshroastsr700). Currently, the freshroastsr700 communications rate is 4 packets/sec (250 ms), and this is due to previous authors' empricial observations of roaster behavior - to them, communicating at rates faster than this caused issues of some sort. I do not have the details of this, nor have I personally tested the comm rate limits of the SR700. It's possible that we could run at 10 Hz or more for the comm rate, and thereby do a better job in PID, as well as with the software heater. But I'll leave that experimentation to someone else.

So I don't beleive that an empirical approach of open-loop control of the heater can be more effective than the current PID controller in freshroastsr700.

Also, just FYI, my understanding is that the SR700 firmware has some form of PID control for its Lo/Mid/Hi hardware heater - it seems to target 3 specific temperatures, and bit-bangs the heater element at a 10-20 Hz rate once it hits its particular target (I run my SR700 won a circuit with a fluorescent light bulb that changes intensity based on the heater being on or off at any given moment...). I implemented the heater_level feature to control the heater element from the PC side and give me better control over heat inputs. A faster USB update rate would do wonders for this heater_level software heater.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants