Closed dxdc closed 2 years ago
@slavikme After some reflection, I realized I'm really overthinking this :)
I studied my blinds a bit more... here's what I can tell (and would be curious to your analysis also). I'm wondering if the uptime/downtime is actually too simplistic and an imprecise way to deal with the cause.
For me, the speed of the blinds (once moving) appears to be constant regardless of the direction of the blinds.
If this is true for you as well, this leaves us with the two edge cases -- blinds at the top, and blinds at the bottom.
A lot of this depends on how the vertical limit is set for the blinds, both at the top and bottom. At the top, additional motor turn will not result in very much vertical rise in the blinds - just compression of the material. At the bottom, additional motor turn will just lower more material to the floor.
So, the problem is that what we're calibrating as "0%" or "100%" is really more like "-5%" or "103%" for example. So, I'm thinking about something like this:
A
: to raise from 0% to 10% (use motor noise, not just movement)B
: to raise from 10% to 90%C
: to raise from 90% to 100% (use motor noise, not just movement)motionTime
= B
/ 0.8extraTimeFrom0to1
= A
- (B
/ 4)extraTimeFrom100to99
= C
- (B
/ 4)Then, we can apply these extra delays at the edges. Let me know how this compares with your observations!
Btw, another way to confirm if this is correct for you:
motionTime
to a constant value (both up and down)response_lag
will need to be set properly as well for this to work accurately.The other parameter that could be important, btw, is a different motor delay blinds going up vs. down due to the difference in acceleration. I'm not sure how significant this would be though, depends on the overall weight of the blinds. This would be more in line with what I presented in the top of this issue since the mass will vary depending on the height of the blinds.
Inspired by this discussion https://github.com/dxdc/homebridge-blinds/pull/41 I'm taking a stab at a physics-based equation for determining blind movement.
This YouTube seems like a good first start: https://www.youtube.com/watch?v=UJF_34TSAwQ
Initial results seem promising, if the physics interpretation are correct, although it doesn't account for gravity and I'm not quite sure how to do that yet.
Download file
Background
It's based on the following parameters:
I'm attaching a draft Excel sheet here, which is set up for both Imperial and Si units.
How to Use
To use it, first input the following parameters. I estimated them in this case.
Then, review the data table/graph below.
Finally, to perform a specific calculation, just input the starting and ending %.