rhyst / linak-controller

A Python script to control Linak standing desks.
MIT License
350 stars 51 forks source link

Slow down the motor by itself at the end avoiding shaking of the desk #25

Closed arekm closed 2 years ago

arekm commented 2 years ago

My problem is that my heavy monitor shakes a lot when movement stops. It isn't soft stop unfortunately.

I'm reading description and

If no move command is recieved in that second then the motor slows down towards the end and then stops.
If you send a move command late, then there will some stuttering as the desk may have already started
to slow the motors. You can stop the motion part way through by sending a stop command though
it sometimes does not respond immediately. 

so I assume that it can be done in a way where motor slows down itself softly, with proper moving commands timing.

This is feature request about implementing such soft stop if possible.

Thanks!

rhyst commented 2 years ago

As far as I'm aware there is not a way to control the acceleration of the desk movement.

Using the official android app or the physical buttons does not seem to result in any smoother movement which is why I don't think this is possible.

arekm commented 2 years ago

So that "the motor slows down" (if stopping feeding move commands) is not true?

I mean if that true and knowing speed and that one move command is causing about 1s movement (that I guess depends on desk load, too but could be measured and stored anyway) it could be calculated when to feed last move command, right? Only if motor slows down and does that in reasonable way.

rhyst commented 2 years ago

The desk reports its speed on one of the characteristics so it is measurably true that the desk takes some finite time to decelerate. That is what I mean by "slows down".

The description of the stuttering is about continuing movement rather than stopping. If you do not send move commands frequently enough then the desk will decelerate before receiving the next move command so if you want the movement to continue smoothly then you must send frequent move commands.

The deceleration of the desk is not controllable as far as I'm aware. If you stop sending move commands it will decelerate and stop at a particular rate. If you send a stop command it will decelerate and stop at a particular rate. There are no commands (that I know of) to control the deceleration.

arekm commented 2 years ago

Ok. One more question - is deceleration by not feeding move commands different (noticeably softer) from when stop command is issued? If not then indeed my request currently cannot be done.

(asking because was not being able to get idasen-controller communicate with my desk on macos, so can't test it right now. Have to do it on linux... where it just worked)

arekm commented 2 years ago

Looking around internet and:

generic access 00001800-0000-1000-8000-00805f9b34fb device information 0000180a-0000-1000-8000-00805f9b34fb control 99fa0001-338a-1024-8a49-009c0215f78a dpg 99fa0010-338a-1024-8a49-009c0215f78a reference output 99fa0020-338a-1024-8a49-009c0215f78a (not for desks) reference_input 99fa0030-338a-1024-8a49-009c0215f78a

dpg has custom speed commands values 216 up to 223 with arguments I guess the same as reading returns (limited to 2^15-1) Reading returns max speed up, down, accel up, down, stop accel.

rhyst commented 2 years ago

Where are you getting that information? It's interesting but the UUIDs do not match with the ones I have for the Idasen desk. I think in different products not all characteristics are implemented.

arekm commented 2 years ago

sdk for desks (and beds)

rhyst commented 2 years ago

Do you have a link? I can only find news articles about it.

arekm commented 2 years ago

Seems dpg is another controller than used in idasen.

https://www.linak.com/products/controls/dpg/ https://www.btod.com/blog/ikea-idasen-desk-review/ (comments there where people are replacing idasen controller with dpg)

rhyst commented 2 years ago

Ah, yeh this is what I suspected. I do not think the Idasen controller actually supports many of the commands/characteristics.