Ohmbrewer / rhizome

Firmware for the Rhizome
Apache License 2.0
0 stars 0 forks source link

Add Timers to control PID update intervals #42

Open azyth opened 9 years ago

azyth commented 9 years ago

utilize the new software timers package to increase PID accuracy .
https://docs.particle.io/reference/firmware/photon/#software-timers

kyleoliveira commented 8 years ago

We should be able to either implement this or close the Issue if we don't want to attempt it. Take a look at the periodic update timer for an example of how to set up the appropriate pointer object.

@azyth what do you want to do?

azyth commented 8 years ago

I am not sure, I think fro now we are ok as it is, but eventually we will want to integrate a different timing method. is the periodic update timer part of the firmware package under the link above? or is it something separate. oh do you mean like #88 ?

kyleoliveira commented 8 years ago

It's implemented as an instance of one of the provided Timer class, yes. It's just managed by the Rhizome class instance rather than a particular Equipment instance.

azyth commented 8 years ago

I think that would be a worthwhile change. since we are currently not measuring how long our intervals are even, if i recall correctly.

kyleoliveira commented 8 years ago

Ok, so to verify, we still want to add a Timer to each Thermostat (or each PID?) that will trigger the sampling or whatever for the PID to decide if it needs to change? Would we be able to implement that as a global Timer (within the Rhizome class) that triggers each PID in the Sprouts list? I realize it would be less accurate but I think there's a 10-instance limit on how many Timers you can instantiate. (Realistically, we only support ~3 Thermostats/PID's per Rhizome anyhow, admittedly. We'd probably want to put a check in there to make a hard limit of how many you can add to be safe.)

azyth commented 8 years ago

I think for it to be worthwhile there needs to be a timer for each PID instance. where exactly it is kept dosnt matter, but each one should be able to keep track of its own cycle. The reason we didnt do this before was due to conflicting access to timers I think, as well as I think that the timers needed to be declared in the .ino file and I was having a hard time passing them or declaring them elsewhere.

kyleoliveira commented 8 years ago

Ok, yeah, that's what I was thinking after typing all that. :grinning: As you can tell from #88, that's no longer an issue. I believe we'll want to keep the Timer in the PID class. We should also add a hard limit of 9 Sprouts with PID's within them (just Thermostat and RIMS for now).

azyth commented 8 years ago

sounds good. want to adjust the issue? or create a new one with the specifics?

kyleoliveira commented 8 years ago

Changed the title, but other than that I think we can keep this issue going as-is.