thotro / arduino-dw1000

A library that offers functionality to use Decawave's DW1000 chips/modules with Arduino.
Apache License 2.0
516 stars 288 forks source link

extending the range of the dwm1000 #245

Open r-schouten opened 6 years ago

r-schouten commented 6 years ago

The dwm1000 modules only works within a range of 10 meters. That is very short because the dwm1000 product brief and the dw1000 datasheet says that it will work far over 100 meter outside and 20-50 meters inside a building.

i've tried to change the channel and the mode of the dwm1000, but it doesn't make the range longer.

does anyone know a solution?

kuek commented 6 years ago

hi, it depends on many many factors. its hard to answer this remotely. as I don't know your hardware, neither your firmware, nor your chip settings. a general answer: if the RF signal is not well you will have low range only... and this may also depend on hardware around the chip.

kuek

r-schouten commented 6 years ago

hi,

i've found a solution that make the range a lot bigger, we have reached a range of 200m on open terrain and 30 meters inside a building.

the signal transmit strength is configurable in the dw1000 chip according to the dw1000 user manual "7.2.31 Register file: 0x1E –Transmit Power Control". in the dw1000.cpp file this transmit strength caliblation is calibrated for every channel. this calibration is not right. i've set the transmit strength so high as possible. I don't understand why we need this calibration.

so I've replaced

if(_channel == CHANNEL_1 || _channel == CHANNEL_2) {
        if(_pulseFrequency == TX_PULSE_FREQ_16MHZ) {
            if(_smartPower) {
                writeValueToBytes(txpower, 0x15355575L, LEN_TX_POWER);
            } else {
                writeValueToBytes(txpower, 0x75757575L, LEN_TX_POWER);
            }
        } else if(_pulseFrequency == TX_PULSE_FREQ_64MHZ) {
            if(_smartPower) {
                writeValueToBytes(txpower, 0x07274767L, LEN_TX_POWER);
            } else {
                writeValueToBytes(txpower, 0x67676767L, LEN_TX_POWER);
            }
        } else {
            // TODO proper error/warning handling
        }
    } else if(_channel == CHANNEL_3) {
        if(_pulseFrequency == TX_PULSE_FREQ_16MHZ) {
            if(_smartPower) {
                writeValueToBytes(txpower, 0x0F2F4F6FL, LEN_TX_POWER);
            } else {
                writeValueToBytes(txpower, 0x6F6F6F6FL, LEN_TX_POWER);
            }
        } else if(_pulseFrequency == TX_PULSE_FREQ_64MHZ) {
            if(_smartPower) {
                writeValueToBytes(txpower, 0x2B4B6B8BL, LEN_TX_POWER);
            } else {
                writeValueToBytes(txpower, 0x8B8B8B8BL, LEN_TX_POWER);
            }
        } else {
            // TODO proper error/warning handling
        }
    } else if(_channel == CHANNEL_4) {
        if(_pulseFrequency == TX_PULSE_FREQ_16MHZ) {
            if(_smartPower) {
                writeValueToBytes(txpower, 0x1F1F3F5FL, LEN_TX_POWER);
            } else {
                writeValueToBytes(txpower, 0x5F5F5F5FL, LEN_TX_POWER);
            }
        } else if(_pulseFrequency == TX_PULSE_FREQ_64MHZ) {
            if(_smartPower) {
                writeValueToBytes(txpower, 0x3A5A7A9AL, LEN_TX_POWER);
            } else {
                writeValueToBytes(txpower, 0x9A9A9A9AL, LEN_TX_POWER);
            }
        } else {
            // TODO proper error/warning handling
        }
    } else if(_channel == CHANNEL_5) {
        if(_pulseFrequency == TX_PULSE_FREQ_16MHZ) {
            if(_smartPower) {
                writeValueToBytes(txpower, 0x0E082848L, LEN_TX_POWER);
            } else {
                writeValueToBytes(txpower, 0x48484848L, LEN_TX_POWER);
            }
        } else if(_pulseFrequency == TX_PULSE_FREQ_64MHZ) {
            if(_smartPower) {
                writeValueToBytes(txpower, 0x25456585L, LEN_TX_POWER);
            } else {
                writeValueToBytes(txpower, 0x85858585L, LEN_TX_POWER);
            }
        } else {
            // TODO proper error/warning handling
        }
    } else if(_channel == CHANNEL_7) {
        if(_pulseFrequency == TX_PULSE_FREQ_16MHZ) {
            if(_smartPower) {
                writeValueToBytes(txpower, 0x32527292L, LEN_TX_POWER);
            } else {
                writeValueToBytes(txpower, 0x92929292L, LEN_TX_POWER);
            }
        } else if(_pulseFrequency == TX_PULSE_FREQ_64MHZ) {
            if(_smartPower) {
                writeValueToBytes(txpower, 0x5171B1D1L, LEN_TX_POWER);
            } else {
                writeValueToBytes(txpower, 0xD1D1D1D1L, LEN_TX_POWER);
            }
        } else {
            // TODO proper error/warning handling
        }
    } else {
        // TODO proper error/warning handling
    }

in this simple line of code writeValueToBytes(txpower, 0x1F1F1F1FL, LEN_TX_POWER);

edit: warning, read the comments in this post carefully! the max power of the dwm1000 can be higher than the regulatory limits of your country!

az-z commented 6 years ago

Looks awesome. Maybe a patch?

On Dec 6, 2017 07:22, "r-schouten" notifications@github.com wrote:

hi,

i've found a solution that make the range a lot bigger, we have reached a range of 200m on open terrain and 30 meters inside a building.

the signal transmit strength is configurable in the dw1000 chip according to the dw1000 user manual "7.2.31 Register file: 0x1E –Transmit Power Control". in the dw1000.cpp file this transmit strength caliblation is calibrated for every channel. this calibration is not right. i've set the transmit strength so high as possible. I don't understand why we need this calibration.

so I've replaced if(_channel == CHANNEL_1 || _channel == CHANNEL_2) { if(_pulseFrequency == TX_PULSE_FREQ_16MHZ) { if(_smartPower) { writeValueToBytes(txpower, 0x15355575L, LEN_TX_POWER); } else { writeValueToBytes(txpower, 0x75757575L, LEN_TX_POWER); } } else if(_pulseFrequency == TX_PULSE_FREQ_64MHZ) { if(_smartPower) { writeValueToBytes(txpower, 0x07274767L, LEN_TX_POWER); } else { writeValueToBytes(txpower, 0x67676767L, LEN_TX_POWER); } } else { // TODO proper error/warning handling } } else if(_channel == CHANNEL_3) { if(_pulseFrequency == TX_PULSE_FREQ_16MHZ) { if(_smartPower) { writeValueToBytes(txpower, 0x0F2F4F6FL, LEN_TX_POWER); } else { writeValueToBytes(txpower, 0x6F6F6F6FL, LEN_TX_POWER); } } else if(_pulseFrequency == TX_PULSE_FREQ_64MHZ) { if(_smartPower) { writeValueToBytes(txpower, 0x2B4B6B8BL, LEN_TX_POWER); } else { writeValueToBytes(txpower, 0x8B8B8B8BL, LEN_TX_POWER); } } else { // TODO proper error/warning handling } } else if(_channel == CHANNEL_4) { if(_pulseFrequency == TX_PULSE_FREQ_16MHZ) { if(_smartPower) { writeValueToBytes(txpower, 0x1F1F3F5FL, LEN_TX_POWER); } else { writeValueToBytes(txpower, 0x5F5F5F5FL, LEN_TX_POWER); } } else if(_pulseFrequency == TX_PULSE_FREQ_64MHZ) { if(_smartPower) { writeValueToBytes(txpower, 0x3A5A7A9AL, LEN_TX_POWER); } else { writeValueToBytes(txpower, 0x9A9A9A9AL, LEN_TX_POWER); } } else { // TODO proper error/warning handling } } else if(_channel == CHANNEL_5) { if(_pulseFrequency == TX_PULSE_FREQ_16MHZ) { if(_smartPower) { writeValueToBytes(txpower, 0x0E082848L, LEN_TX_POWER); } else { writeValueToBytes(txpower, 0x48484848L, LEN_TX_POWER); } } else if(_pulseFrequency == TX_PULSE_FREQ_64MHZ) { if(_smartPower) { writeValueToBytes(txpower, 0x25456585L, LEN_TX_POWER); } else { writeValueToBytes(txpower, 0x85858585L, LEN_TX_POWER); } } else { // TODO proper error/warning handling } } else if(_channel == CHANNEL_7) { if(_pulseFrequency == TX_PULSE_FREQ_16MHZ) { if(_smartPower) { writeValueToBytes(txpower, 0x32527292L, LEN_TX_POWER); } else { writeValueToBytes(txpower, 0x92929292L, LEN_TX_POWER); } } else if(_pulseFrequency == TX_PULSE_FREQ_64MHZ) { if(_smartPower) { writeValueToBytes(txpower, 0x5171B1D1L, LEN_TX_POWER); } else { writeValueToBytes(txpower, 0xD1D1D1D1L, LEN_TX_POWER); } } else { // TODO proper error/warning handling } } else { // TODO proper error/warning handling } in this simple line of code writeValueToBytes(txpower, 0x1F1F1F1FL, LEN_TX_POWER);

I hope that this helps for everyone that need a longer range! and I want to know why this calibration is made.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/thotro/arduino-dw1000/issues/245#issuecomment-349623784, or mute the thread https://github.com/notifications/unsubscribe-auth/AExz3axjnCwTsD62vdah8ve2s1-BsJc5ks5s9ocTgaJpZM4Qs9Lm .

kuek commented 6 years ago

well, "patch". hm. make sure you stay in the regulatory limits by your country, which are usually -41.3 dBm/MHz PSD. otherwise regulatory may pay you a visit... and this is usually not cheap. instead of increasing output power, make sure your recevier is more sensitive, your have high receiver gain, hardware is right. power is not always a solution, instead it will mostly cause harm and not fulfill regulations.

az-z commented 6 years ago

Good point. My oversight. Sorry.

On Dec 6, 2017 16:45, "kuek" notifications@github.com wrote:

well, "patch". hm. make sure you stay in the regulatory limits by your country, which are usually -41.3 dBm/MHz PSD. otherwise regulatory may pay you a visit... and this is usually not cheap. instead of increasing output power, make sure your recevier is more sensitive, your have high receiver gain, hardware is right. power is not always a solution, instead it will mostly cause harm and not fulfill regulations.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/thotro/arduino-dw1000/issues/245#issuecomment-349784851, or mute the thread https://github.com/notifications/unsubscribe-auth/AExz3efgNTh4Q2rLK8r74W0SRvIh0njWks5s9wrdgaJpZM4Qs9Lm .

r-schouten commented 6 years ago

i measured a signal strength of -67db, that is far away of -41.3db

r-schouten commented 6 years ago

the calibration used in the library is copied from table 18 and 19 of the dw1000 user guide. the dw1000 is the chip inside the dwm1000 module, I think the dwm1000 module have an other antenna than decawave have used to make this calibration.

if the maximum tx power is too high we should make an new calibration.

kuek commented 6 years ago

its -41.3 dBm/MHz. this is a power spectral density. -67 dBm TX EIRP. you stated 200m that you reached with that settings. lets consider at 3.5 GHz thats 93 dB loss, so your hardware has a sensitivity of -160dB. Clearly impossible!

-67 dBm (which you probably mean) with your power settings, then either you have measured wrong or your hardware is odd.

just a warning, if regulations catch you with this, make sure you have a good explanation.

r-schouten commented 6 years ago

is there a way we can make an new calibration, is there any way we can measure the real signal strength? this calibration was copied from the dw1000 user guide and not made for this specific antenna.

in the dwm1000 product brief i saw this "Excellent communications range of up to 300m thanks to coherent receiver techniques*", why would they say that if only a range of 10m is permitted?

r-schouten commented 6 years ago

i've think i've found the answer in the dwm1000 datasheet.

"To achieve best results when using the DWM1000 with Deca wave’s DecaRanging software , you will need to adjust the default transmit power value programmed into the DWM1000 by the software. This is because DecaRanging software is targeted at Decawave’s EVB1000 evaluation board which has a different RF path compared to the DWM1000. You should increase the transmit power by approximately 3 dB."

so, if we add 3dB to the calibration we use now that should be oke right?

kuek commented 6 years ago

No, if you want to make it correct you need to go to a calibrated emc Chamber and make the measurements. 3dB is double, but in terms of range increase its not much.

mao93cy commented 6 years ago

Hi, I want to set the PSD to -41.3dBm / MHz according to the regulation of my country. However, I am not sure how and where to set it. Can someone explain the meaning of the hex values in "writeValueToBytes"?

skadiexe commented 6 years ago

dw1000 user manual, 7.2.31.1-7.2.31.4: image

nxdefiant commented 6 years ago

With the default settings I get a maximum range of about ~4m for the dwm1000 modules, so I did a short test with gain=33.5dB.resulting resulting in a maximum range of ~10m outdoor. Looks like the advertised maximum range is a bit too exaggerated..

Anacron-sec commented 6 years ago

Me and @Sonic0 got the same results with the default settings, try to activate smart power and see if it gets better. We'll make an update as soon as possible.

nxdefiant commented 6 years ago

Already tested smartpower, gave me ~2m.

Btw can someone please explain me why "MODE_LONGDATA_FAST_LOWPOWER" sends with more power then "MODE_LONGDATA_RANGE_ACCURACY"?

MODE_LONGDATA_FAST_LOWPOWER sets PRF to 16MHz, on channel 5 the txpower is set to 16dB. MODE_LONGDATA_RANGE_ACCURACY sets PRF to 64MHz, on channel 5 the txpower is set to 8.5dB.

Anacron-sec commented 6 years ago

Check the 2nd comment to this issue. I think that's the thing you are looking for.

On Tue, Jul 31, 2018, 7:45 PM nxdefiant notifications@github.com wrote:

Already tested smartpower, gave me ~2m.

Btw can someone please explain me why "MODE_LONGDATA_FAST_LOWPOWER" sends with more power then "MODE_LONGDATA_RANGE_ACCURACY"?

MODE_LONGDATA_FAST_LOWPOWER sets PRF to 16MHz, on channel 5 the txpower is set to 16dB. MODE_LONGDATA_RANGE_ACCURACY sets PRF to 64MHz, on channel 5 the txpower is set to 8.5dB.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/thotro/arduino-dw1000/issues/245#issuecomment-409308119, or mute the thread https://github.com/notifications/unsubscribe-auth/AWi_NgKxn7w34E5o_6f4KpMWN_JjOAyRks5uMJfRgaJpZM4Qs9Lm .

Sonic0 commented 6 years ago

@nxdefiant remember that SmartPower is useful when you use short messages(short preamble). See Application Note APS023 from Decawave.

nxdefiant commented 6 years ago

Strange with same settings I got 20m or more today. I haven't changed anything in the setup. The only thing that notably changed is the weather..

I'm testing with the Localino v1.3 modules btw.

sanjuruk commented 5 years ago

Hi, Change the Channel to Channel 2 from channel 5. Range increase dramatically. I could only get 10m maximum distance in MODE_LONGDATA_RANGE_ACCURACY mode. After changing the channel to 2, I could measure 50+m LOS in the same mode. No need to increase the Tx Power to 33.5 dB (0x1F1F1F1F). But if you use dwm1000, I recommend increasing all Tx powers by +3dB as mentioned in DWM1000-datasheet page 8, footnotes. Best, Sanju.

SATHYALAKSHMI123456 commented 5 years ago

can any one tell how to increase the dbm?

Sonic0 commented 5 years ago

@SATHYALAKSHMI123456 In this driver is not disponible a method to set manually the transmission power. You should write the registry directly or modify functions as in the beginning of this issue.

SATHYALAKSHMI123456 commented 5 years ago

can you tell me a some syntex

On Sun, Jun 23, 2019 at 7:19 PM Andrea Salvatori - IU6FZL < notifications@github.com> wrote:

@SATHYALAKSHMI123456 https://github.com/SATHYALAKSHMI123456 In this driver is not disponible a method to set manually the transmission power. You should write the registry directly or modify functions as in the beginning of this issue.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/thotro/arduino-dw1000/issues/245?email_source=notifications&email_token=AMMTFYR3WFJUCSR7ERIQFUTP355NDA5CNFSM4EFT2LTKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYK674I#issuecomment-504754161, or mute the thread https://github.com/notifications/unsubscribe-auth/AMMTFYXNFDPETZZW3A6UZODP355NDANCNFSM4EFT2LTA .

Sonic0 commented 5 years ago

can you tell me a some syntex

I recommend you to use a fork of this library, Arduino-sw1000-ng (search on GitHub but it is very different from this). There are two different public functions with witch you can set up the transmission power. You should read the user manual (a transmission power part) before using this setting.

SATHYALAKSHMI123456 commented 5 years ago

IF U HAVE A CODING FOR THIS PLEASE SEND ME .WE ARE OBTAIN 50MTRRS

On Mon, Jun 24, 2019 at 5:56 PM Andrea Salvatori - IU6FZL < notifications@github.com> wrote:

can you tell me a some syntex

I recommend you to use a fork of this library, Arduino-sw1000-ng (search on GitHub but it is very different from this). There are two different public functions with witch you can set up the transmission power. You should read the user manual (a transmission power part) before using this setting.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/thotro/arduino-dw1000/issues/245?email_source=notifications&email_token=AMMTFYTGJTI4DIPOSUMML23P4C4N5A5CNFSM4EFT2LTKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYMX74Q#issuecomment-504987634, or mute the thread https://github.com/notifications/unsubscribe-auth/AMMTFYT4J5J7TF5AH5MV533P4C4N5ANCNFSM4EFT2LTA .

Sonic0 commented 5 years ago

Please do not write in Uppercase. As in the third comment of this issue, I think you can call _writeValueToBytes(txpower, , LEN_TXPOWER); . See user manual to insert the desired value.

SATHYALAKSHMI123456 commented 5 years ago

ok sir.i cant understand please help me

On Tue, Jun 25, 2019 at 1:45 AM Andrea Salvatori - IU6FZL < notifications@github.com> wrote:

Please do not write in Uppercase. As in the third comment of this issue, I think you can call writeValueToBytes(txpower, , LEN_TX_POWER); . See user manual to insert the desired value.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/thotro/arduino-dw1000/issues/245?email_source=notifications&email_token=AMMTFYWMHIVOJPT6KI62CZTP4ETPDA5CNFSM4EFT2LTKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYOCWIQ#issuecomment-505162530, or mute the thread https://github.com/notifications/unsubscribe-auth/AMMTFYSCN35ENE5RXNNAMCLP4ETPDANCNFSM4EFT2LTA .