Shop OBEX P1 Docs P2 Docs Learn Events
Thoughts on Prop suitability for something like this... — Parallax Forums

Thoughts on Prop suitability for something like this...

markmark Posts: 252
edited 2015-05-30 22:56 in Propeller 1
http://www.hizook.com/blog/2015/05/17/valves-lighthouse-tracking-system-may-be-big-news-robotics


I've been interested in this position/orientation tracking system since Valve first announced it, but the technical details had been pretty hard to come by. After I read the blog, I couldn't help that the first thought after "Neat!" was to wonder if the prop could handle the workload. I suspect that for the most part it could, but it might have a problem with the modulated signalling operating in the MHz range. I'm thinking the counters could help here, but would it be necessary to assign one to each photodiode?

I'm curious what hardware they're using. I can't think of any uC, at least on the front end, that would be suitable except perhaps the xmos chips. Other than that, probably an FPGA?

Any thoughts?

Comments

  • evanhevanh Posts: 15,919
    edited 2015-05-23 17:28
    I've not tried to learn the details but this technique, for spacial scanning at least, is certainly not new. The average supermarket checkout scanner started doing this in the mid-1980s. It just wasn't being used for it's spacial information.

    EDIT: Actually, a 2D version of the technique would be the old optical mice that used a gridded mouse pad.

    EDIT: EDIT: Hehe, Doh! Not reading enough before commenting. That's not a reader! The Lighthouse is only a transmitter. Cool, I like it.

    It's just like two of the cheap *** hobbyist servo signals. The reader only has to WAITPEQ for a single digital input so using a Cog would breeze in. Just use CNT values. It's all sequential with large wait times so that Cog can do any maths as well.
  • kwinnkwinn Posts: 8,697
    edited 2015-05-23 19:22
    [QUOTE=mark
  • markmark Posts: 252
    edited 2015-05-23 19:47
    The modulation is used to distinguish between multiple transmitters (the VR setup will come with two transmitters) as well as noise from other IR sources (sunlight, etc), though it might also do it for X and Y scans. Therefore it would require more than a simple filter.

    @evanh

    Yep, it consists of the lighthouse transmitters which are simple synced IR led and XY laser scanners, and the receivers which consist of an array of photosensors with a processor used to calculate the amount of time it took for the exposed sensors to be hit with the X and Y beams after they received the led sync pulse. Based on known values such as the laser line scan rate, it can fairly easily determine position and orientation. It really is slick. Here's a video of what appears to be a prototype tx in action:

    https://www.youtube.com/watch?v=5yuUZV7cgd8
  • Duane DegnDuane Degn Posts: 10,588
    edited 2015-05-23 20:51
    This sort of precise timing application is a great match for the Propeller. Since a cog can be dedicated to just monitoring incoming flashes you don't have to worry about the main program's overhead interfering with the precise timing. IMO, the Prop is very suitable for something like this. . .
  • kwinnkwinn Posts: 8,697
    edited 2015-05-24 07:00
    [QUOTE=mark
  • kwinnkwinn Posts: 8,697
    edited 2015-05-24 07:14
    After a little more thought I am wondering if demodulating the signal with counters would need more than one or two counters. The multiple diodes look like they are only there to make sure the beam can be seen regardless of the robot's orientation, so the signals could be summed before being processed. Seems like it might be possible to do it all with one cog.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2015-05-24 07:41
    Looking at DIYing the hardware, it seems that a 'spinning laser' may be fashioned by having a laser diode (of the CD/DVD type) pointed straight at a 45 degree mirror that is mounted to a motor. This is the old standard police car 'bubble gum machine' red light configuration. Of course, you might prefer to use a brushless CD motor with built-in hall effect sensors to get a very tight control of rotational speed. But cost should not be too much of a factor.
  • kwinnkwinn Posts: 8,697
    edited 2015-05-24 08:27
    Loopy, the whole idea is so simple yet so elegant. My first thought was "what a great idea", followed by "why didn't I think of that", and then "how come it took so long to come up with it".

    The hardware for this is so simple it can easily be built by hobbyists.

    A single motor driving two mechanically linked mirrors, two ir laser diodes, and an ir led for the synch signal is basically all you need. The motor speed does not even need to be all that high or precise. Measure the time between synch flashes and calculate the x and y location based on the time of the laser pulses in relation to that.
  • markmark Posts: 252
    edited 2015-05-24 15:05
    @kwinn

    Of course you would want the photodetectors to match the wavelength of the tx laser/diodes as closely as possible. That helps reduce potential interference sources but not all. That's part of the reason why the tx also needs to be modulated - otherwise we can get interference from all the various unwanted sources that emit at that wavelength. The other reason, which I mentioned earlier was that in order to get full 360 degree coverage, two transmitters are needed - one facing the other. Each is modulated differently so that the receiver can distinguish which source it's picking up, which is particularly important when part of the RX is detecting the light from one source, and the other part from another source. How these are modulated (simple fixed frequency?) has yet to be revealed. Valve is interested in making this a royalty-free standard, so hopefully we'll find out all the details soon.

    "After a little more thought I am wondering if demodulating the signal with counters would need more than one or two counters. The multiple diodes look like they are only there to make sure the beam can be seen regardless of the robot's orientation, so the signals could be summed before being processed. Seems like it might be possible to do it all with one cog."

    The multiple photodiodes arranged in a specific pattern are likely very important to determine orientation. One tx might work if the receiver has an array of sensors offering 360 degree coverage, but for certain designs, this isn't practical, so two transmitters are needed to get full coverage and limit problems due to occlusion. Here's an image of the current prototype HMD:

    http://i.kinja-img.com/gawker-media/image/upload/t_original/1149099751047904872.jpg

    There's no sensors on the back of the devices mounted to the strap, so this is why it needs at least 2 transmitters. Even if it did just use one tx, I don't see how it would be possible to use just a counter or two without making a lot of assumptions. Perhaps if a pin goes high, a counter can be assigned to it and then read and cleared and then wait for another pin to get assigned to. I never got very familiar with counters, so I don't know how quickly this could be done. And of course, this is assuming that it's a simple fixed frequency modulation and that the rx needs more photodiodes than the number of available counters. The other option is to just use multiple Props :)

    I think the rotation rate needs to be reasonably precise. This hardware is capable of measuring 6DoF to sub-mm accuracy at 100Hz in a typical sized room in a house! So an accurate laser scan rate plays an important part in that. Shouldn't be too difficult, though. Precision brushless motors are common enough in consumer products such as laser disc and hard drives. I suppose they could do as you say and increase tolerances by relying on sync pulses to indicate the actual rotation rate, but at the cost of a "frame" of latency. Not sure if they do that though.
  • rabaggettrabaggett Posts: 96
    edited 2015-05-25 04:39
    Hmmm,

    100 HZ sample rate requires 6000 rpm! Balancing a 45 degree mirror for this speed is not trivial. maybe a multi-faceted mirror, 5 facets would take that down to 1200 rpm, but with only 72 degrees of coverage. All doable, but not so easy.

    100 hz sweep at 10 feet passes a .1" photodiode in .1/(10*12*2*pi)=.000133 seconds at one hz, that's ,00000133 seconds at 100 hz. If you wanted to see at least 5 cycles of the modulated carrier, it would need to be at least 5*(1/.00000133)=3.7 MHZ. Making a good filter at this frequency can be a little tricky, but again, doable.

    With an 80 MHZ granularity in timing, , that is, .000000012 second, and we know from above that 1/10" is .00000133 seconds, Propeller could theoretically give .00000133/.000000012 = .0104" resolution at 10'. WOW! When do you start!
  • kwinnkwinn Posts: 8,697
    edited 2015-05-25 08:53
    @ mark
  • kwinnkwinn Posts: 8,697
    edited 2015-05-25 09:05
    rabaggett wrote: »
    Hmmm,

    100 HZ sample rate requires 6000 rpm! Balancing a 45 degree mirror for this speed is not trivial. maybe a multi-faceted mirror, 5 facets would take that down to 1200 rpm, but with only 72 degrees of coverage. All doable, but not so easy.

    100 hz sweep at 10 feet passes a .1" photodiode in .1/(10*12*2*pi)=.000133 seconds at one hz, that's ,00000133 seconds at 100 hz. If you wanted to see at least 5 cycles of the modulated carrier, it would need to be at least 5*(1/.00000133)=3.7 MHZ. Making a good filter at this frequency can be a little tricky, but again, doable.

    With an 80 MHZ granularity in timing, , that is, .000000012 second, and we know from above that 1/10" is .00000133 seconds, Propeller could theoretically give .00000133/.000000012 = .0104" resolution at 10'. WOW! When do you start!

    I think you may be getting carried away and making this more difficult than it has to be. First thing to consider is how fast your robot can move. Then take in to account how far it can travel before needing an updated position. Now recalculate everything.
  • rabaggettrabaggett Posts: 96
    edited 2015-05-25 13:41
    kwinn wrote: »
    I think you may be getting carried away and making this more difficult than it has to be. First thing to consider is how fast your robot can move. Then take in to account how far it can travel before needing an updated position. Now recalculate everything.

    Agreed, This level of performance is waaay overkill most of the time, I was focused on giving a real answer to the original question, which framed the parameters for the calculations. Even at this mega overkill rate we get about 1/100" resolution at 10' out of the prop, possibly without even invoking the counters!

    Personally, I would keep the high sample rate and implement a Kalman filter, or at least keep a rolling average to smooth out the jitter inherent in this kind of measurement.
  • markmark Posts: 252
    edited 2015-05-25 15:32
    rabaggett wrote: »
    Hmmm,

    100 HZ sample rate requires 6000 rpm! Balancing a 45 degree mirror for this speed is not trivial. maybe a multi-faceted mirror, 5 facets would take that down to 1200 rpm, but with only 72 degrees of coverage. All doable, but not so easy.

    100 hz sweep at 10 feet passes a .1" photodiode in .1/(10*12*2*pi)=.000133 seconds at one hz, that's ,00000133 seconds at 100 hz. If you wanted to see at least 5 cycles of the modulated carrier, it would need to be at least 5*(1/.00000133)=3.7 MHZ. Making a good filter at this frequency can be a little tricky, but again, doable.

    With an 80 MHZ granularity in timing, , that is, .000000012 second, and we know from above that 1/10" is .00000133 seconds, Propeller could theoretically give .00000133/.000000012 = .0104" resolution at 10'. WOW! When do you start!

    Thanks for the figures.

    Looking at the video I linked to above, there seems to be some kind of disc-shaped optics attached to the front of the motors which wouldn't have such extreme balancing requirements as a bulky mirror.

    How do we get 80MHz in timing granularity? Using a pin wait instructions? I suppose we would detect a modulated signal at that rate in software but it ties up a cog to process one photodiode. It would probably require come clever cog<->pin assignments if we're using more sensors than available cogs.

    @kwinn

    Of course the performance to the demo hardware might be a bit extreme for many uses, but I was specifically focusing on the type of hardware it was developed for (VR HMDs and related peripherals). Since I assumed that Valve is using a more complex (and expensive) circuit than the Propeller, I was wondering if the Prop would be suitable in their design at that level of performance. It seems like it could be a pretty big design win for Parallax if they could get their chips in that hardware.
  • rabaggettrabaggett Posts: 96
    edited 2015-05-26 17:01
    [QUOTE=mark
  • kwinnkwinn Posts: 8,697
    edited 2015-05-27 09:02
    rabaggett wrote: »
    Agreed, This level of performance is waaay overkill most of the time, I was focused on giving a real answer to the original question, which framed the parameters for the calculations. Even at this mega overkill rate we get about 1/100" resolution at 10' out of the prop, possibly without even invoking the counters!

    Personally, I would keep the high sample rate and implement a Kalman filter, or at least keep a rolling average to smooth out the jitter inherent in this kind of measurement.

    I don't see how the rpm would affect the position accuracy, but it does determine the update rate, which could be important. Since the speed and orientation of the robot is being measured continuously the next expected position could be calculated and used to eliminate spurious readings.
  • kwinnkwinn Posts: 8,697
    edited 2015-05-27 09:18
    For robots on a 2 dimensional surface I think this could be done with four diodes, three at the corners of an equilateral triangle and one in the center of the triangle. Only one of the four signals would need to be demodulated to verify it is the desired signal. The others would only need to capture the time (cnt) when the beam crosses the diode. The position would only be calculated if all the signals were within a window based on the demodulated signal.
  • rabaggettrabaggett Posts: 96
    edited 2015-05-27 09:29
    kwinn wrote: »
    I don't see how the rpm would affect the position accuracy, but it does determine the update rate, which could be important. Since the speed and orientation of the robot is being measured continuously the next expected position could be calculated and used to eliminate spurious readings.

    Slower rpm would equate to MORE accuracy, provided the rotation was constant

    I like your earlier statement about the ceiling mounted device. 3 receivers on the bot would easily give position and orientation if you give an omnidirectional IR blast to sync to the rotation. Just look for simultaneous pulse for all three sensors, then time from that. This way the transmitter could be dumb and require only power to operate. This could operate fairly slowly, and therefore be very easy to make. Predicting the next pulse/position is exactly how the Kalman filter works.
  • kwinnkwinn Posts: 8,697
    edited 2015-05-28 06:27
    I don't really have an application for something like this but I find the idea so fascinating I may just have to try and build a simple version of it. First thing on the list would be the laser to produce the scan line. Anyone have a source or idea for a laser that produces a wide angle narrow line like this needs?
  • macrobeakmacrobeak Posts: 354
    edited 2015-05-28 06:46
    Kwinn, I have been thinking the same. On ebay there are many line laser modules;
    http://www.ebay.com.au/itm/400781449348?_trksid=p2057872.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT
    Of course, horizontal spinning line lasers are widely used in the construction industry for levelling (this one has a vertical line as well);
    http://www.ebay.com.au/itm/Baumr-AG-Self-Leveling-Cross-Line-Laser-Level-Rotating-Rotary-Levelling-/130578601475?pt=LH_DefaultDomain_15&hash=item1e67175603
  • RS_JimRS_Jim Posts: 1,765
    edited 2015-05-28 07:09
    kwinn wrote: »
    I don't really have an application for something like this but I find the idea so fascinating I may just have to try and build a simple version of it. First thing on the list would be the laser to produce the scan line. Anyone have a source or idea for a laser that produces a wide angle narrow line like this needs?
    At one time I picked up some cheap line lasers that were for leveling artwork. Maybe something from a craft store or homie.
    Jim
  • kwinnkwinn Posts: 8,697
    edited 2015-05-28 10:46
    Thanks Jim, I'll drop in to Michaels craft store on the way home today.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2015-05-30 14:35
    Here is a source for precision right angle laser mirrors. Hope this helps someone
    http://www.edmundoptics.com.tw/optics/optical-mirrors/flat-mirrors/right-angle-mirrors/1930/
  • macrobeakmacrobeak Posts: 354
    edited 2015-05-30 20:34
    Here is a source for precision right angle laser mirrors. Hope this helps someone
    http://www.edmundoptics.com.tw/optics/optical-mirrors/flat-mirrors/right-angle-mirrors/1930/

    Erco,
    Help!
    Can you find us a cheap one of these (right angle mirror)!
  • kwinnkwinn Posts: 8,697
    edited 2015-05-30 20:52
    No luck at the craft or hobby stores. The internet is next.
  • markmark Posts: 252
    edited 2015-05-30 22:56
    how will you filter out all wavelengths other than the laser's? I suppose it'll be easier to handle a modulated source especially if you're going to operate at a lower scan rate.
Sign In or Register to comment.