Close

Polar vs XY coordinates

A project log for Apartment ventilation system

The 25 year battle to get fresh air in tiny apartments

lion mclionheadlion mclionhead 09/21/2020 at 18:200 Comments

Controlling the nozzle in polar coordinates proved to be a real pain.  XY coordinates presented the problem of dead areas where an XY position corresponds to multiple polar positions or multiple XY positions correspond to a single polar position.  An idea emerged whereby dead areas could be avoided.  The key is the fact that the user only moves the nozzle 1 step in 1 direction at a time. 


For every polar position, we calculate either 4 or 8 adjacent polar positions by adding & subtracting 1 angle & 1 magnitude step.  Then, we manetain a master XY position which updates X if the user presses a horizontal arrow or updates Y if the user presses a vertical arrow while fixing Y if the user presses the horizontal arrow or fixing X if the user presses a vertical arrow.  It picks the next adjacent polar position based on what's closest to the fixed master axis while moving the variable master axis in the right direction.  If 2 polar positions have the same fixed master axis, pick the variable master axis which is closest.

The next problem was improving the encoders.  It turns out, they actually sense the rising & falling edges of the magnets instead of the magnet centers.  With braking enabled, they actually stop on the rising & falling edges.  The trick is to space the magnets 1 magnet apart & detect 2.5V crossings instead of 0V & 5V levels.  What they can't do is detect the centers of the magnets.  Sensing edges increases the accuracy to 8 steps per turn.  

Also, the boundary switches don't need to be polled anymore after it's initialized, which could increase the accuracy further.

The mane problem is the motors are still too fast & reprogramming the encoders would entail making new position tables by paw.  Reprogramming the encoders is just a bandaid for what really needs to be done.  It needs expensive 300:1 motors with built in encoders.  The more lions live with an F-35 air vent, the more reasonable the extra cost becomes.

https://www.adafruit.com/product/4641

Further random ideas:

remote control for the power.

Aquarium pump powered mister

LEDs for afterburner effect with the mister.  Mounted on the inside of the nozzle, they could make a straight flame.  The problem is the nozzle rotates, so the water pipe & any wiring would have to slip inside the nozzle.

Discussions