Alt Hold with hacked $25 IR laser distance measurer

Post Reply
brewski
Posts: 483
Joined: Tue Apr 29, 2014 12:04 am
Location: Cleveland Qld Australia

Alt Hold with hacked $25 IR laser distance measurer

Post 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?

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

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

Post 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.

brewski
Posts: 483
Joined: Tue Apr 29, 2014 12:04 am
Location: Cleveland Qld Australia

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

Post 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?

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

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

Post by copterrichie »

Personally, I don't think it will fare any better than the existing ultrasonic devices.

brewski
Posts: 483
Joined: Tue Apr 29, 2014 12:04 am
Location: Cleveland Qld Australia

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

Post 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

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

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

Post by copterrichie »

Yea, it was temping for sure but I have enough stuff sitting about. Be interested in hearing about your results. ;)

kenl
Posts: 17
Joined: Tue Jun 17, 2014 1:03 pm

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

Post 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.

brewski
Posts: 483
Joined: Tue Apr 29, 2014 12:04 am
Location: Cleveland Qld Australia

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

Post 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?

kenl
Posts: 17
Joined: Tue Jun 17, 2014 1:03 pm

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

Post 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!

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

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

Post 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.

brewski
Posts: 483
Joined: Tue Apr 29, 2014 12:04 am
Location: Cleveland Qld Australia

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

Post by brewski »

Bummer

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

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

Post by PatrikE »


brewski
Posts: 483
Joined: Tue Apr 29, 2014 12:04 am
Location: Cleveland Qld Australia

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

Post 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?

User avatar
Plüschi
Posts: 433
Joined: Thu Feb 21, 2013 6:09 am

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

Post 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.

brewski
Posts: 483
Joined: Tue Apr 29, 2014 12:04 am
Location: Cleveland Qld Australia

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

Post 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

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

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

Post 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.

handsomejackuk
Posts: 97
Joined: Mon Sep 08, 2014 12:25 am

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

Post by handsomejackuk »

watching this topic looks interesting

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

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

Post 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.

User avatar
Plüschi
Posts: 433
Joined: Thu Feb 21, 2013 6:09 am

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

Post 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.

brewski
Posts: 483
Joined: Tue Apr 29, 2014 12:04 am
Location: Cleveland Qld Australia

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

Post 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

User avatar
Plüschi
Posts: 433
Joined: Thu Feb 21, 2013 6:09 am

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

Post 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 :)

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

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

Post 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.

brewski
Posts: 483
Joined: Tue Apr 29, 2014 12:04 am
Location: Cleveland Qld Australia

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

Post 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.

User avatar
Plüschi
Posts: 433
Joined: Thu Feb 21, 2013 6:09 am

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

Post 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.

fvk1960@gmail
Posts: 3
Joined: Wed May 13, 2015 12:38 pm

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

Post 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.

Post Reply