Page 1 of 1

Alt Hold with hacked $25 IR laser distance measurer

Posted: Thu Dec 04, 2014 1:36 am
by brewski
Just saw this online http://www.drgrab.com.au/products/digit ... uring-tape measures up to 60ft. If this can be hacked to output to MW FC it would give accurate Alt Hold up to 60ft and then Baro could be used at greater heights. With accurate measurement of height this would provide terrain following way above what ultrasonics can do. Anyone tried something similar?

Re: Alt Hold with hacked $25 IR laser distance measurer

Posted: Thu Dec 04, 2014 2:57 am
by copterrichie
Well, you can get the same one from ebay for 12 bucks. http://www.ebay.com/itm/Ultrasonic-Tape ... 5404f5eb10

And this ad states, it is ultrasonic distance measuring meter.

Re: Alt Hold with hacked $25 IR laser distance measurer

Posted: Thu Dec 04, 2014 3:17 am
by brewski
copterrichie wrote:Well, you can get the same one from ebay for 12 bucks. http://www.ebay.com/itm/Ultrasonic-Tape ... 5404f5eb10

And this ad states, it is ultrasonic distance measuring meter.


But $14 postage so same. Have you or do you know anyone who has looked at using one as altimeter?

Re: Alt Hold with hacked $25 IR laser distance measurer

Posted: Thu Dec 04, 2014 3:33 am
by copterrichie
Personally, I don't think it will fare any better than the existing ultrasonic devices.

Re: Alt Hold with hacked $25 IR laser distance measurer

Posted: Thu Dec 04, 2014 4:15 am
by brewski
copterrichie wrote:Personally, I don't think it will fare any better than the existing ultrasonic devices.


For the price I'm tempted to buy one. I'm an electronics engineer so reverse engineering comes with the skill set :D

Re: Alt Hold with hacked $25 IR laser distance measurer

Posted: Thu Dec 04, 2014 4:17 am
by copterrichie
Yea, it was temping for sure but I have enough stuff sitting about. Be interested in hearing about your results. ;)

Re: Alt Hold with hacked $25 IR laser distance measurer

Posted: Thu Dec 04, 2014 7:56 am
by kenl
I use laser measuring equipment for my work, all be them a little more expensive.

They can be quite fussy about the material that they measure from a hard flat surface is best, I haven't tried to measure off grass but I doubt it would work.

It would be great if it though.

Re: Alt Hold with hacked $25 IR laser distance measurer

Posted: Thu Dec 04, 2014 9:17 am
by brewski
kenl wrote:I use laser measuring equipment for my work, all be them a little more expensive.

They can be quite fussy about the material that they measure from a hard flat surface is best, I haven't tried to measure off grass but I doubt it would work.

It would be great if it though.


Any chance you could do some tests with grass, dirt etc as target maybe from a two story building or higher?

Re: Alt Hold with hacked $25 IR laser distance measurer

Posted: Thu Dec 04, 2014 11:07 am
by kenl
I just went out and did a test run to grass etc, much to my surprise it gave great results. I had never tried before, but often have trouble with surfaces on a building site and more over the target you can buy are reflectors = opposite of sand & Grass. (my excuse for being negative to start with)

The instrument I am using is a Leica Disto D5 so its a bit higher end but the same tech I would guess ( I've been wrong before :D )

The highest vertical I could find (over retaining wall next door) was around 4.5m and it gave consistent results from the same position I did some angular measurements and easily got 13 - 15 m.

This would be a fantastic inclusion if you can get it to work!!

Go Brewski!

Re: Alt Hold with hacked $25 IR laser distance measurer

Posted: Thu Dec 04, 2014 1:07 pm
by copterrichie
However, the named device in the OP is not laser but ultrasonic. It has a laser pointer to aid in aiming the device at a target.

Re: Alt Hold with hacked $25 IR laser distance measurer

Posted: Thu Dec 04, 2014 8:12 pm
by brewski
Bummer

Re: Alt Hold with hacked $25 IR laser distance measurer

Posted: Thu Dec 04, 2014 11:00 pm
by PatrikE

Re: Alt Hold with hacked $25 IR laser distance measurer

Posted: Thu Dec 04, 2014 11:27 pm
by brewski
PatrikE wrote:Here is a laser version
http://www.ebay.com/itm/40M-131ft-1575i ... 0336&rt=nc


$36 is pretty reasonable for laser based unit that has 40m range. I know several APM users have experimented with laser rangefinders using $75 module that can interface to APM. Do you know anyone who has experimented with laser rangefinders with MW. Could the MW code controlling ultrasonic (transmit, listen for return & calculate distance) be adapted to work?

Re: Alt Hold with hacked $25 IR laser distance measurer

Posted: Fri Dec 05, 2014 5:23 am
by Plüschi
$36 is damn cheap. Sure this is laser and not ultrasonic? WTF they dont ship to CH?

My laser range finder did cost nearly $120 and can find distances up to 600m (tested) when the target is bright color. However measuring rate is quite low, it takes 3 sec for a measurement, and you need a steady hand.

@brewsky
Speed of light is 300'000'000m/s. Sound is 340m/s. Even with very optimized code it would be difficult to get a resolution better than 72m out of a 16mhz arduino (2 clock cycles).

I think mwii sonar does only work with i2c devices but has no trig-echo functionality (not sure about that). Wouldnt be difficult to add anyway.

Re: Alt Hold with hacked $25 IR laser distance measurer

Posted: Fri Dec 05, 2014 8:37 am
by brewski
Plüschi wrote:$36 is damn cheap. Sure this is laser and not ultrasonic? WTF they dont ship to CH?

My laser range finder did cost nearly $120 and can find distances up to 600m (tested) when the target is bright color. However measuring rate is quite low, it takes 3 sec for a measurement, and you need a steady hand.

@brewsky
Speed of light is 300'000'000m/s. Sound is 340m/s. Even with very optimized code it would be difficult to get a resolution better than 72m out of a 16mhz arduino (2 clock cycles).

I think mwii sonar does only work with i2c devices but has no trig-echo functionality (not sure about that). Wouldnt be difficult to add anyway.


How are the guys with APM2.5 (which is just Atmega2560 @ 16Mhz) doing it & getting good results from what I have read http://diydrones.com/profiles/blogs/lid ... and-terrai & already in 3DR store https://store.3drobotics.com/products/lidar-lite for $79

Re: Alt Hold with hacked $25 IR laser distance measurer

Posted: Fri Dec 05, 2014 12:54 pm
by PatrikE
brewski wrote:How are the guys with APM2.5 (which is just Atmega2560 @ 16Mhz) doing it & getting good results from what I have read http://diydrones.com/profiles/blogs/lid ... and-terrai & already in 3DR store https://store.3drobotics.com/products/lidar-lite for $79


store.3drobotics.com wrote:"Using standard I2C communications protocols,"

They probably use a CPU on chip that speak I2C.
Witch means it can be included in MWii with correct library.

Re: Alt Hold with hacked $25 IR laser distance measurer

Posted: Fri Dec 05, 2014 2:06 pm
by handsomejackuk
watching this topic looks interesting

Re: Alt Hold with hacked $25 IR laser distance measurer

Posted: Fri Dec 05, 2014 2:20 pm
by copterrichie
brewski wrote:How are the guys with APM2.5 (which is just Atmega2560 @ 16Mhz) doing it & getting good results from what I have read http://diydrones.com/profiles/blogs/lid ... and-terrai & already in 3DR store https://store.3drobotics.com/products/lidar-lite for $79


The above sensor is not laser, it is optical, works similar to an optical mouse.

Re: Alt Hold with hacked $25 IR laser distance measurer

Posted: Fri Dec 05, 2014 5:33 pm
by Plüschi
brewski wrote:How are the guys with APM2.5 (which is just Atmega2560 @ 16Mhz) doing it & getting good results from what I have read


You were asking for

brewski wrote:transmit, listen for return & calculate distance


a thing APM does not and can not do.

As patricke said APM asks a dedicated rangefinder processor for the distance over I2C, they dont do the measuring themself.

@copterrichie Intresting. A different sensor. I bet the linked ebay rangefinder is a similar concept.

Re: Alt Hold with hacked $25 IR laser distance measurer

Posted: Fri Dec 05, 2014 9:46 pm
by brewski
Plüschi wrote:
brewski wrote:How are the guys with APM2.5 (which is just Atmega2560 @ 16Mhz) doing it & getting good results from what I have read


You were asking for

brewski wrote:transmit, listen for return & calculate distance


a thing APM does not and can not do.

As patricke said APM asks a dedicated rangefinder processor for the distance over I2C, they dont do the measuring themself.

@copterrichie Intresting. A different sensor. I bet the linked ebay rangefinder is a similar concept.


I was detailing how ultrasonic functions but as you say it would be impossible task for am 8 bit processor @ 16Mhz to do. The 3DR laser rangefinder is obviously processing onboard & it should be possible to integrate with MW to provide accurate Alt Hold & terrain tracking. Would be fantastic for FPV :D

Re: Alt Hold with hacked $25 IR laser distance measurer

Posted: Sat Dec 06, 2014 9:55 pm
by Plüschi
I think adding new althold sensors doesent make much sense if the althold algo doesent improve. I was never able to get decent althold out of mwii.

It IS difficult to cope with a high-delay pid loop, but as DJI and APM shows it is possible with todays baro sensors. Also, changing "throttle angle correction" from 1-cos to 1/cos might help with althold. 1-cos is simply ... wrong :)

Re: Alt Hold with hacked $25 IR laser distance measurer

Posted: Sat Dec 06, 2014 11:17 pm
by copterrichie
Plüschi wrote:I think adding new althold sensors doesent make much sense if the althold algo doesent improve. I was never able to get decent althold out of mwii.

It IS difficult to cope with a high-delay pid loop, but as DJI and APM shows it is possible with todays baro sensors. Also, changing "throttle angle correction" from 1-cos to 1/cos might help with althold. 1-cos is simply ... wrong :)


Very unfortunately, I live in a very heavily populated area and can not do much testing however, I have to agree that altitude holding could be allot better using existing sensors. It almost seems possible the Acc-Z axis would suffice and using the baro as a reference only. In other words, sense any up and down motion with the Acc-Z. Knowing the rate of change, it should be easy to calculate the distant, then compare that change to the baro for validation.

Re: Alt Hold with hacked $25 IR laser distance measurer

Posted: Sun Dec 07, 2014 12:18 am
by brewski
Plüschi wrote:I think adding new althold sensors doesent make much sense if the althold algo doesent improve. I was never able to get decent althold out of mwii.

It IS difficult to cope with a high-delay pid loop, but as DJI and APM shows it is possible with todays baro sensors. Also, changing "throttle angle correction" from 1-cos to 1/cos might help with althold. 1-cos is simply ... wrong :)


Have you tried modifying alt hold code & trying it? If not you should. I'm sure many would be very interested.

Re: Alt Hold with hacked $25 IR laser distance measurer

Posted: Sun Dec 07, 2014 1:50 am
by Plüschi
copterrichie wrote:It almost seems possible the Acc-Z axis would suffice and using the baro as a reference only


I think the mwii implementation already does what you describe. But even a slight offset of ACC does sum up substantially.
Vel = intgrated ACC, Pos = integrated Vel. -> Pos = doubly integrated Acc. This runs away very very easily.

I think the main problem is not the measuring accz - baro fusion, but the PID. Code is full of constrain() and deadband which feels wrong and unpredictable. But i have failed to come up with something better. My wife hates my indoor flight tests, so i wait till monday.

brewski wrote:Have you tried modifying alt hold code & trying it? If not you should. I'm sure many would be very interested.


Tried yes, success no.

Re: Alt Hold with hacked $25 IR laser distance measurer

Posted: Sun May 17, 2015 5:15 pm
by fvk1960@gmail
Why not use sharp IR sensors. if you combine two types you can go from 10cm till 550cm.
It has analog output and works on 5volt.
Any higher seems useless because of obsticals like trees and buldings etc.