Close

The preset bug

A project log for Standing desk remote control

Control multiple desks over wifi

lion-mclionheadlion mclionhead 09/16/2022 at 19:050 Comments

The full height bug & the dial were the 2 mane issues.  The solution was to remember the last button pressed.  If it was a preset, it waits a while to detect a confirmation of a saved preset.  If confirmation of a saved preset is detected, it gives up.  If it detects a height packet, it waits for the height to equal full height.  If it doesn't get full height in a certain time, it gives up.  If it gets it, it waits a while after the full height packet, then it presses the up arrow for a while.  Any button press exits the height workaround.  The key need is framing the status packets.  There is a 14ms gap between packets.

The maximum height being reported by the preset or up arrow is 0x01e8.  Pressing up doesn't change it even though it moves up slightly.  The receiver does a >= comparison to detect maximum height.  It might change if the desk is reset, in which case a better firmware updater is required.  Maximum height on the piano can't be the full height of the desk or it'll rip out the raspberry pi's, so that never received the upgrade.

Noted during the many testing runs, strange sounds in the desk motors seemed to go away on their own.  Maybe stuff was thrown around during the move.

The dial got many printouts with various magnet spacings.  The key need is to maximize the dynamic range of the sensed flux.  The sensor has to be the lowest possible gain or enough distance from the magnets to not saturate.  The magnets have to be as close together as possible so there isn't a dead band in the middle.  

The mane problem is the sensor running on 3V even though it was rated for 4.5-5V.  When powered by 2 AA's, the sensor went from .5 to 2.5V.  It's not likely to last long on 2 AA's.  The magnets had to be 110 degrees apart so the sensor wouldn't cover the center of the magnets & get saturated.

The halfway points between the center voltages weren't the best division points.  The halfway point between the bottom of the higher voltage & the top of the lower voltage was the best division point.  It took fidgeting with the control to find out  the full voltage ranges due to mechanical vagaries.  The bottom 2 voltages were real close together because the sensor was clipping at some lower flux than the top voltage.  Managed to get the desk selection reliable enough to live with.

New front panel with button standoffs didn't make any obvious difference in the button panel stiffness.

There was a slight change in the detents to make them click more assertively.  The sides of the notches had to get steeper.  Better hall effect sensors would be on the next shopping list, but generally it's at a point of diminishing returns.  A boost converter + voltage divider or a digital hall effect sensor might work.  The analog ones are all 4V.

Because the protocol is based on a repeating code instead of a single code followed by repeat tokens, you can wave the transmitter at it to simulate button tapping or you can hold down a button until it gets within range instead of constantly tapping.  Combined with the clicky buttons, it's the way IR would be if nothing had to make money.

The mane problem is it requires the IR receiver to be fast enough to handle a very high baud rate by IR standards.  There are IRDA standards for higher baud rates, but they might require more expensive receivers or shorter range.

Discussions