AoA sensor first prototype

I don’t see anybody selling an angle-of-attack sensor for FPV RC aircraft, so I’m making my own.

Here’s the first (quite crude) prototype:

AoA sensor prototype

It’s nothing more than a hall effect sensor inside a hollow tube (the black plastic spacer) with a magnet glued onto it. It’s held by the red plastic block with a hole drilled thru it.

The other end of the tube has a crude weathervane attached (the counterweight needs more work).

It seems to work reasonably well:

I’d feed the output into an ADC on a PIC.

The whole thing is too loosey-goosey for flight – this was just a prototype to see if the idea works.

Now I’m trying to figure out how to make a flightworthy version. Maybe this would be a good first 3D printer project?

Idea: In perpetuity web hosting

When people die their web sites usually go down after a year or two, when nobody pays the hosting and/or domain fees, or due to uncorrected technical problems.

This is a problem a company could solve.

For example, my friend Sasha Chislenko died 16 years ago. One bit of luck (in an ultimately unlucky life) was that a group of his friends got together and decided to preserve his web page for eternity – or at least until those friends die off or forget about it.

On the other hand Chuck Moore, the inventor of the Forth programming language, had a personal website at http://colorforth.com that hosted lots of interesting historical and technical material. I don’t know if Chuck is alive or dead (I hope he’s OK!), but his website went down sometime in the last 6 months.

For the subset of humanity that maintain personal websites and blogs, those sites represent an intellectual legacy – I think most of them would like to think that while they may die, their ideas and intellectual contributions will live on, to some degree, on their web site.

Certainly I would.

Of course, the Wayback Machine already attempts to preserve the past web, (and that’s great and worthwhile), but it’s not as good as keeping the original site going. The Wayback Machine doesn’t serve links to the old site, doesn’t preserve the final version (just the last randomly sampled version before the site goes down), and doesn’t serve certain file types, large files, or execute server-side code as the original site did.

Nor is the Wayback Machine well indexed by search engines (for now anyway).

So – a service that does this for a fee would seem to be a viable business.

Like a cemetery or university, in-perpetuity maintenance could be funded by a conservatively managed endowment (a lump sum invested, with the interest/earnings used to pay fees) plus some insurance.

Given that web site maintenance is pretty cheap, this would be quite affordable, I think. Even cheaper if it can be funded by (essentially) a whole-life insurance policy (for younger people).

The main effort would be setting up a suitable legal structure – a technically-minded lawyer could probably do it. I think you’d want some kind of trust and trustees, who manage a central endowment fund (pooled for all customers) and hire technicians to do the work.

Yes, you have my permission to use this idea. My usual terms apply.

Idea: Virtual treadmill

…maybe that’s not a good name.

The idea is a treadmill-like device that allows you to go in any direction, just just forwards.

Ideally, it would let you go up/down, left/right, forward/back. And more.

A few weeks ago I playing with an Oculus Rift demo where you “pick up” and move around cubes with a hand/finger position sensing glove.

I remarked that the cubes were awfully light – must be made of aerogel or something.

Which I guess says the illusion of reality was pretty good.

That got me thinking about what a real VR environment might feel like.

The first obvious thing that’s missing is the ability to walk around naturally.

A treadmill-like platform that can move in 2 axes (instead of 1 like the usual treadmill, or 1 plus angle) would be nice, but I couldn’t think of a way to make it work mechanically.

THE IDEA

But what you could do is make a pair of servo-driven harnesses, one for each foot. They’d be attached to boots that you’d put your feet in.

Within a limited volume (as much space as a foot can reach from a single position), each harness would be able to move the boot (and resist movement) thru 6 degrees of freedom:

  • X, Y, Z
  • Pitch, roll, yaw

It would be able to resist movement to simulate friction, climbing, etc., and to move at various speeds to simulate walking, running, sliding, etc. Each of the 6 degrees of freedom would be controlled by a servomotor and connected by linkages (pretty straightforward mechanically; requires competence but not invention).

Of course it would have limits, but I think you could use this to create a “pretty good” feeling of walking around, running, even jumping.

For example, suppose you want a VR environment that simulates lunar gravity (1/6th g).

You can’t change the force with which gravity pulls you toward the floor, but if you “jump” (a vigourous downforce on the boot), you’d measure the force of the jump and plot the jumper’s ballistic trajectory. While “in the air”, all resistance to movement (all 6 degrees) are turned off – so the user feels he can wiggle his feet around as if floating. When he “lands” there’s a sudden locking of the pitch/roll/yaw axes and a sharp jerk in the +Z direction (if he lands upright).

Main applications would be VR exploration, exercise games, FPS games, etc. If the experience feels right I think there could be a mass market for the things. In any case, there’s a small high-end market that could (and should) be pioneered first.

The next step is to make another pair for the hands, maybe even with actuators for each finger joint…

Yes, you have my permission to use this idea. My usual terms apply.

Idea: Intelligent lawn sprinkler

A friend is thinking about doing a startup – I promised to email him my occasional business ideas. I’m posting the rejects here. This is the first. My usual terms apply.

 


 

We recently had a landscaper redo our lawn. So we had a law full of dirt that had to be seeded with grass and then watered daily.

We setup 8 sprinklers – every 15 minutes I had to turn one off and the next on (lots of valves and splitters) because we didn’t have enough water pressure to run more than one at a time.

So –

From a single spot an intelligent sprinkler has pan and tilt servos and a nozzle that emits a single tight stream (the opposite of normal sprinklers). The servos drive the sprinkler in a raster pattern to cover any arbitrary shaped pattern of lawn evenly – water goes only where you want it, not where you don’t.

Because it emits one single high-pressure stream, the area it can reach is far larger than a conventional sprinkler.

It’s programmed when you turn on the water and “draw” the outline of the area you want covered by hand, moving the nozzle. After that it’ll keep that area watered as long as you want.

Also it has a timer, so it can run intermittently in any on/off pattern you like.

It’s powered by a little water turbine that drives a generator, which charges a battery.

Use Office 2003 in Windows 10

I’m getting to that age, I guess – becoming a stuck-in-the-mud. I’m still using Office 2003 because…reasons.

Anyway, it works fine in Windows 10 except that the File Open dialog boxes won’t follow shortcuts (.lnk files). It did in Windows 7, but now it doesn’t.

clippy

No, this isn’t Word 2003. But it captures the spirit.

This is not a huge problem except when you want to do “Compare and Merge Documents…”. Then it’s maddening.

Here’s a workaround:

Use Explorer to find the file you want to compare the current file to. Select the file and press Shift-RightClick. This will offer “Copy as path”. Pick that.

Then click on the file entry box, and do ctrl-V to paste the path in.

You’re welcome.

How to use Google Earth with a SpaceNavigator and a joystick – at the same time

I love Google Earth.

And the best way to run Google Earth is with a 3Dconnection SpaceNavigator. This is a 6-degree-of-freedom controller that lets you fly around in Google Earth effortlessly. (Supposedly it’s good for 3D CAD work too; I haven’t tried that.) Yes, it’s a little pricey but it’s worth every penny.

88590_scn2

(Tip: It works better if you glue it to your desk with some double-sided sticky tape. It’s weighted to prevent it from flying off the desk when you pull up, but the tape helps.)

To use Google Earth with the SpaceNavigator (once you’ve got that installed), in Google Earth just do Tools>Options…>Navigation>Non-mouse Controller>Enable Controller.

Unfortunately, if you also have a joystick – any joystick – attached to your Windows box, Google Earth will take input from both at once – which makes control impossible from the SpaceNavigator.

I used to deal with it by unplugging the joystick USB, or by disabling the joystick in Device Manager, but I found a better way.

Start up Google Earth. Get your joystick and adjust it carefully (including the throttle) so that there’s no motion at all in Google Earth. Then turn it off. (Or just leave it alone if your joystick doesn’t have a power switch.)

That’s it. Now Google Earth won’t see any input from the joystick, and the SpaceNavigator will work fine.

Improved W4ZCB Latching Continuity Tester

Here’s a very simple low-voltage, low-current latching continuity tester circuit. The probe voltage is only ~ 49 mV and probe current is 1/2 mA maximum, so it’s safe for testing almost any board without risk of damaging something.

It’s a slightly improved version of Harold Johnson, W4ZCB‘s circuit published some years ago. (Not sure when; I found it here.)Improved_W4ZCB_Contunity_Beeper

R1/R2 and R3/R4 are voltage dividers; comparator U1 (an LM2903) turns on the beeper if the resistance between the probe leads is less than about 25 ohms.

I added C2 to make it latching; otherwise it’s very scratchy. The LM2903 is a smaller part than the original LM339, and I changed R4 from the original 10k ohms to 47k, to drop the continuity threshold from about 50 ohms to 25.

I used a TMB12A05 buzzer for LS1; these are available on eBay for about 20 cents each (quantity 10). Any small buzzer that buzzes by itself (with an internal oscillator) will probably work.

D1 and R5 just provide a power-on LED; you can omit them.

It’ll run on anything from about 3 to 15 volts (with the probe voltage about 1/100 of that); most any small-signal PNP transistor can be used for Q1.

This was drawn with DipTrace, which I’m experimenting with. So far I like it a lot – the user interface is far more intuitive than Eagle.

Webcam with privacy shutter & mute

Another business idea – this time a simple one.

Today the BBC has an article about “webcam hijackers” who blackmail people (mostly young women) with remote access trojans that grab webcam video.

I don’t get it. Why do almost no webcams come with a physical privacy shutter – just a sliding piece of plastic?

The right way to do this is a knob that turns a cam and slides a shutter in front of the lens.

It should have four positions:

  • Off – shutter blocks lens, cam opens a switch that electrically disconnects the microphone
  • Audio only – shutter blocks lens, cam closes mic switch
  • Video only – shutter away from lens, cam opens mic switch
  • On – shutter away from lens, cam closes switch

How hard is that, really?

 

Hey: VCs often say that good ideas are a dime a dozen. Mine go even cheaper than that. If you use this idea to make money, I’d like 0.5%. Of the equity in your company, or the profits. Or something. If that’s too much (or too little), fine – whatever you think is fair. This is a request for a gift, or reward – it is not a legal obligation. You’re free to use this idea and pay me nothing. If you can live with yourself that way.

A platform for crowdsourcing rewards for good deeds

Here’s something the world needs – build it and get rich! (I’m too lazy.)

I really want somebody to finish porting OpenCV to Python 3. It’s an open-source project that isn’t getting enough effort to finish it.

I’m willing to offer money for it.

Not a huge amount – a few hundred dollars.

Somebody needs to build an online platform that will let me make an offer like that – finish the port, get my money.

Surely there are other people who share this goal – probably many of them are also willing to kick in something to make it happen.

The platform should allow me to set a goal with clearly-defined criteria for success, and then aggregate the rewards offered by everyone who signs on to the goal. Developers looking to make some money could pick a goal, accomplish it, and collect the reward.

Whoever sets up the platform (analogous to Kickstarter, Indiegogo, etc.) can charge a fee or small percentage of the rewards.

 

While you’re at it, the world also needs ways to reward people for other kinds of good deeds.

For example, florist Debbie Dills heroically tailed Charleston shooter Dylann Roof’s car until the police arrived to arrest him.

When I read a story like that, I should be able to click on the hero’s name and send him or her $1 or $5 as a reward, in appreciation of the heroism. I think millions of people would do that upon reading about a hero in a news story, if it was as easy as clicking on her name and entering the dollar amount.

That should be doable.

So, go do it. Please. You’ll make the world a better place by rewarding good deeds – it’s not only fair, it might make people behave better.

And if you’re the one to do it, it’s only fair that you charge something for setting up and running the system.

 

Hey: VCs often say that good ideas are a dime a dozen. Mine go even cheaper than that. If you use this idea to make money, I’d like 0.5%. Of the equity in your company, or the profits. Or something. If that’s too much (or too little), fine – whatever you think is fair. This is a request for a gift, or reward – it is not a legal obligation. You’re free to use this idea and pay me nothing. If you can live with yourself that way.

Remove all comments from C and C++ source code

At the moment I’m struggling with Microchip’s new “Harmony” framework for the PIC32. I don’t want to say bad things about it because (a) I haven’t used it enough to give a fair opinion and (b) I strongly suspect it’s a useful thing for some people, some of the time.

Harmony is extremely heavyweight. For example, the PDF documentation is 8769 pages long. That is not at all what I want – I want to work very close to the metal, and to personally control nearly every instruction executed on the thing, other than extremely basic things like <stdlib.h> and <math.h>.

Yet Microchip says they will be supporting only Harmony (and not their old “legacy” peripheral libraries) on their upcoming PIC32 parts with goodies like hardware floating point, which I’d like to use.

So I’m attempting to tease out the absolute minimum subset of Harmony needed to access register symbol names, etc., and do the rest myself.

My plan is to use Harmony to build an absolutely minimum configuration, then edit down the resulting source code to something manageable.

But I found that many of Microchip’s source files are > 99% comments, making it essentially impossible to read the code and see what it actually does. Often there will be 1 or 2 lines of code here and there separated by hundreds of lines of comments.

So I wrote the below Python script. Given a folder, it will walk thru every file and replace all the .c, .cpp, .h, and .hpp files with identical ones but with all comments removed.

I’ve only tested it on Windows, but I don’t see any reason why it shouldn’t work on Linux and Mac.

from __future__ import print_function
import sys, re, os

# for Python 2.7
# Use and modification permitted without limit; credit to NerdFever.com requested.

# thanks to zvoase at http://stackoverflow.com/questions/241327/python-snippet-to-remove-c-and-c-comments
# and Lawrence Johnston at http://stackoverflow.com/questions/1140958/whats-a-quick-one-liner-to-remove-empty-lines-from-a-python-string
def comment_remover(text):
    def replacer(match):
        s = match.group(0)
        if s.startswith('/'):
            return " " # note: a space and not an empty string
        else:
            return s
    pattern = re.compile(
        r'//.*?$|/\*.*?\*/|\'(?:\\.|[^\\\'])*\'|"(?:\\.|[^\\"])*"',
        re.DOTALL | re.MULTILINE
    )
    
    r1 = re.sub(pattern, replacer, text)
    
    return os.linesep.join([s for s in r1.splitlines() if s.strip()])


def NoComment(infile, outfile):
        
    root, ext = os.path.splitext(infile)
    
    valid = [".c", ".cpp", ".h", ".hpp"]
    
    if ext.lower() in valid:
           
        inf = open(infile, "r")

        dirty = inf.read()
        clean = comment_remover(dirty)

        inf.close()
        
        outf = open(outfile, "wb") # 'b' avoids 0d 0d 0a line endings in Windows
        outf.write(clean)
        outf.close()
        
        print("Comments removed:", infile, ">>>", outfile)
        
    else:

        print("Did nothing:     ", infile)

if __name__ == "__main__":
    
    if len(sys.argv) < 2:
        print("")

        print("C/C++ comment stripper v1.00 (c) 2015 Nerdfever.com")
    
        print("Syntax: nocomments path")

        sys.exit()
        
    root = sys.argv[1]
    
    for root, folders, fns in os.walk(root):

        for fn in fns:
    
            filePath = os.path.join(root, fn)
            NoComment(filePath, filePath)
    

To use it, put that in "nocomments.py", then do:

python nocomments.py foldername

Of course, make a backup of the original folder first.