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

Can't Find The Origin For Units #18

Open
backXslash opened this issue Jun 22, 2016 · 11 comments
Open

Can't Find The Origin For Units #18

backXslash opened this issue Jun 22, 2016 · 11 comments

Comments

@backXslash
Copy link

I'm trying to tweak a few things in the UI, and just cannot find where the values for certain variables originate.

Honestly, I'd just like to change the displayed units to Fahrenheit being as I'm a backwards American, and change the input of time units to minutes rather than seconds.

The data logging for long runs does seem to be causing a slight issue, but I'm running picoReflow on an RPi 3 so that seems to help.

I'm using picoReflow as a burnout oven controller in my jewelry studio, so the runs tend to be long as all hell, but the number of temperature points is relatively small.

As an example, starting at room temperature, ramp to 1400 degrees fahrenheit over the course of 4 hours, hold at 1400 for an hour, drop to 1100 over the course of an hour, then hold at 1100 indefinitely.

Also, if it's in any way possible, I'd like to implement some kind of command execution at certain points. Basically just run a curl command when it enters its final holding pattern so that PushBullet can ping my phone and let me know it's time to pour some gold.

@chron0
Copy link
Member

chron0 commented Jun 22, 2016

Hmmkay, yeahhhh, Fahrenheit... Why don't we all meet in the middle? Since most of us have to learn english as a second language to have global communication and collaboration ability, I don't think it's too much to ask for to agree on the metric system as the basis reference/tool system for the future, simply to make co-operation more streamlined and efficient.

Having said that, I can fully appreciate your needs, being it flexible units, more freedom on the timeline so cater to either very short or like in your case very long-term jobs, where minutes, hours or even days would be more appropriate than seconds, or just the timestamp instead, to see it in comparison to our naturally perceived flow of time. Also, having the ability to let the system react to certain system states and fire triggers based on user-definable thresholds which can be connected to any kind of action.

Unfortunately, picoReflow is kind of old and although we were putting much love and the best of our ability into it, we didn't have the scope that it may become more than just a reflow oven controller. All of these issues are addressed in picoReflow's way more modular, hackable and much more maintainable successor: https://github.com/apollo-ng/governess/

It's currently under heavy development again but it's taking some time, because the required level of modularity and flexibility is way less trivial than initially expected. At this point it's not even at a fully functional PoC state but I'm working hard on it and hope that someone else might join to get it released faster.

As a quick and dirty solution, you could hack around in

if(state=="RUNNING")
and multiply the results which come from the websocket with the factor for F. And of course the data for the graph would need that kind of hand-massage as well. This would fix it for the interface but not on the console, otherwise you would have to redo the math in python and base it on F. Both "solutions" suck imho.

The picoReflow codebase is no fun to maintain and too monolithic, that's why I'm putting my resources into governess to remedy these mistakes because I can clearly see a lot of demand of people from all over with all kinds of use cases, hacking away on modular DIY appliances.

By the way, do you happen to have a picture of your setup or could you take one? I always love to show what people do with our stuff on: https://apollo.open-resource.org/mission:resources:picoreflow?&#picoreflow-in-the-wild

Thanks for the Feedback about the RPi 3, that's good to know, similar improvements were observed on the Odroid C1/XU4 or basically any newer generation quad/octo core ARM. They give a huge boost in system elasticity and multi-task latency.

@backXslash
Copy link
Author

As far as the need for Fahrenheit, I really do apologize, it wasn't my choice. Oddly enough, I'd much rather be ABLE to work in Celsius, but it's just not how units are taught here, and it doesn't work in my brain.

I'm happy enough to hack on the python and JS sources, or even help with the Governess stuff if I can, I just can't seem to track down where in the source those number originate.

The max31855.py library provides a function called to_f which returns the temperature value in degree fahrenheit. I can't seem to find the origin in the source for where picoReflow actually polls the max chip for a value. If I could I could just drop in the to_f function either with or instead of the celsius call and boom, there's that done.

The other thing I can't find is where picoReflow has decided its time units will be seconds rather than minutes or hours. It imports time as part of its initial setup, and of course various time functions are referenced throughout the source, but I can't seem to pin down which of them is responsible for storing the actual time value retrieved from a given JSON profile. I'm thinking that the time library works in seconds natively, and I just need to add a conversion factor and then enter my units in the GUI in minutes rather than seconds.

As for firing off command execution, I figured I could just append that call to the call that displays the "run complete" message. I was honestly hoping for a bit of clarification on which variables stored which values is all.

If I can help with Governess though... what needs doing?

@chron0
Copy link
Member

chron0 commented Jun 23, 2016

Sorry for the lack of precision, I'm not any kind of genius and it was so long ago that I'd have to dig into the old codebase just as well. Good idea to to check the lib, I haven't thought of that.

How about https://github.com/apollo-ng/picoReflow/blob/master/lib/max31855.py#L11

def __init__(self, cs_pin, clock_pin, data_pin, units = "c", board = GPIO.BCM):

Maybe just as simple as:

def __init__(self, cs_pin, clock_pin, data_pin, units = "f", board = GPIO.BCM):

As for governess, yes, any help would be greatly appreciated, I'm trying to finish some more docs to have a common reference of the models and workflows to make collaboration easier and waste less time on transferring ideas/concepts. From that I'll try to structure the bulk of it into smaller tasks/work-packages, needed to complete the 1.0.0 milestone:

https://github.com/apollo-ng/governess/issues

@AndyRawson
Copy link
Contributor

AndyRawson commented Jun 24, 2016

@backXslash I have been working on most of these things for a pottery kiln setup for myself the last few days. I have not done extensive testing on this yet but so far my modifications have been working well.
https://github.com/AndyRawson/picoReflow/tree/time_and_temp

  • Can now change the kwh rate and currency type from the config file
  • Can now change the temperature scale from Celsius to Fahrenheit
  • Can now change the slope display from C/F per second to per minute or per hour
  • Can now change the input for each target time from seconds to minutes or hours
  • Added an icon for the Door open/close status
  • Changed the time left display to hours:minutes:seconds
  • Changed the graph to auto scale to the profile
  • New options added to the config file
kwh_rate        = 0.117  # Rate in currency_type to calculate cost to run job
currency_type   = "$"   # Currency Symbol to show when calculating cost to run job
temp_scale          = "f" # c = Celsius | f = Fahrenheit - Temperature unit to use
time_scale_slope    = "h" # s = Seconds | m = Minutes | h = Hours - Slope displayed in temp_scale per time_scale_slope
time_scale_profile  = "m" # s = Seconds | m = Minutes | h = Hours - Enter and view target time in time_scale_profile

I don't have the kiln setup yet but I do have a toaster oven I have been testing with and so far so good. The temperature changes from C to F change the thermocouple reporting and then just use the profiles as is. The time changes still leave the profiles as seconds and just modify the display. So far this has been working well enough for my use. Let me know if you have any problems and we can go from there.

Thank you so much for creating this @chron0, it was pretty much exactly what I was looking for for this kiln project. I can't wait for governess and it looks like a great start so far. I would like to offer to help with it where I can.

@chron0
Copy link
Member

chron0 commented Jun 28, 2016

Awesome, thanks for extending picoreflow with these features. Would you care to send a PR? I'm pretty sure there are more people out there who would love to have these features as well. Maybe @backXslash could give us a thumbs up - if its working as expected, as a minimal second test.

Although I'm currently dug deep into progressing governess again (hence the delay), it's still not ready to do anything productive yet and I'd rather get it "more right" this time than just rush to a quick release. As long as that is the case, picoreflow is out there and has still value because it actually can help others to bootstrap their own DIY appliances with a more or less ready to use open-source solution.

@AndyRawson, also, as I always request, do you happen to have some images/pictures of your kiln setup we could share on https://apollo.open-resource.org/mission:resources:picoreflow#picoreflow-in-the-wild ? I find it always very helpful when I evaluate projects just to see what others have made with it and even better, how :)

@AndyRawson as for help with governess, please, by all means, I'd be delighted not to be working on this one alone. There's still plenty to be done. I hope I didn't do the worst job with the new structure, stack selection and the beginnings of a full system model so that other devs may find their way much more easy into it, to make collaboration more effective and stress free. For a more real-time conversation, you can join us on IRC https://apollo.open-resource.org/contact:start#internet-relay-chat-irc

I've started to document a couple of my ideas/reasons/realities in code and documents but I'll try to be even more verbose and put more effort into early docs, here's my view how to build it to be flexible enough and easy maintainable to build almost anything that needs governing/controlling/triggering/monitoring:

https://github.com/apollo-ng/governess/blob/master/doc/architecture.svg

@AndyRawson
Copy link
Contributor

@chron0 Thanks, I need to clean up my fork (I think I made git mad) but then I will send a PR. Doesn't look like @backXslash has checked out the changes yet but maybe they will get a chance to soon if they are still working on their project.

I am still refitting the kiln and building the project but I will certainly send pictures when it is done. I am just using an old toaster oven for testing right now.

I have looked over governess a little but unfortunately I am a programmer only when needed so it is much easier for me to look at existing things and modify them than to plan and build new ones. I will certainly help where I can but I fear my help may be limited.

Thanks again.

@backXslash
Copy link
Author

Holy crap! I've been SUPER busy with a few things, and just got a chance to see all this.

@AndyRawson -

  1. I'll check your branch out over the weekend or early next week
  2. I'll stress test the CRAP out of it as soon as I can, and give you feedback
  3. Can I blow you?

@chron0
Copy link
Member

chron0 commented Jul 12, 2016

It's merged into picoReflow master now as well, thanks to @AndyRawson. Unfortunately I'm the same kind of programmer, hence the slow speed :) But slow progress is progress non the less.

@chron0
Copy link
Member

chron0 commented Jul 12, 2016

If you guys want I can try to make a little screencast where governess is currently at, about the features, the structure and models and safety considerations along with the new interface so that we all can have a better understanding of where it's currently heading, what I may have overlooked or am otherwise limited by the scope of my own needs and considerations.

@AndyRawson
Copy link
Contributor

@chron0 thanks for merging that in. I am going to make some more changes for the kiln use and we can see if they make sense to add in.

A screencast would be great to get us up to speed with where things are with governess and what needs to be done next. I may be able to find a section I can help with at that point.

@chron0
Copy link
Member

chron0 commented Jul 17, 2016

meh, the system is still throwing me undogdeable curve balls (I'm now not only officially homeless but also without any usable bank account) so I'm swamped with trying to get a new account and had to prep a lot of useless shit instead of working on governess or making the screencast :/ I'll try next week.

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

No branches or pull requests

3 participants