51uwb.cn

 找回密码
 立即注册
查看: 1447|回复: 2
打印 上一主题 下一主题

BP50 一标签多基站

[复制链接]

8

主题

29

帖子

72

积分

注册会员

Rank: 2

积分
72
跳转到指定楼层
楼主
发表于 2023-5-17 16:48:27 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
目前有1个标签6个基站,想要实现每个基站都能向电脑传送距离数据
按照下面这段代码增加  Send_Dis_To_Anthor2、Send_Dis_To_Anthor3、Send_Dis_To_Anthor4、、、、
发现  回传数据的速度  会随着 回传数据基站的数量  增多而变得越来越慢
请问想要实现以上功能怎么修改代码?
回复

使用道具 举报

35

主题

1119

帖子

4805

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
4805
沙发
发表于 2023-5-17 17:25:56 | 只看该作者
你发现的状况符合预期,肯定是数据量越大越慢。而且每个基站都自己传串口数据出去,占用大量的时间,导致UWB测距的时间占用比降低

你已经实现了,为何说怎么修改代码?
回复

使用道具 举报

12

主题

32

帖子

106

积分

注册会员

Rank: 2

积分
106
板凳
发表于 昨天 21:27 | 只看该作者
蓝点无限 发表于 2023-5-17 17:25
你发现的状况符合预期,肯定是数据量越大越慢。而且每个基站都自己传串口数据出去,占用大量的时间,导致UW ...

你好,想问一下我的6基站,根据原来的代码增加到6基站发送通信,然后通过增加延迟所有基站都可以成功发送和接受,但是屏幕没有输出距离,貌似卡在了                /* Increment frame sequence number after transmission of the poll message (modulo 256). */
                if (status_reg & SYS_STATUS_RXFCG)
                {
                    /* Clear good/fail RX frame event in the DW1000 status register. */
                    dwt_write32bitreg(SYS_STATUS_ID, SYS_STATUS_RXFCG | SYS_STATUS_TXFRS);
                    /* A frame has been received, read it into the local buffer. */
                    frame_len = dwt_read32bitreg(RX_FINFO_ID) & RX_FINFO_RXFLEN_MASK;
                    if (frame_len <= RX_BUF_LEN)
                    {
                        dwt_readrxdata(rx_buffer, frame_len, 0);
                    }

                    if(rx_buffer[ALL_MSG_TAG_IDX] != TAG_ID)
                        continue;
                    rx_buffer[ALL_MSG_TAG_IDX] = 0;

                    /*As the sequence number field of the frame is not relevant, it is cleared to simplify the validation of the frame. */
                    rx_buffer[ALL_MSG_SN_IDX] = 0;
                                                                                OLED_ShowString(0,2,"ok");
                    if (memcmp(rx_buffer, distance_msg, ALL_MSG_COMMON_LEN) == 0)
                    {
                        // final_distance = rx_buffer[10] + (float)rx_buffer[11]/100;
                        Anthordistance[rx_buffer[12]] +=(rx_buffer[10]*1000 + rx_buffer[11]*10);
                        Anthordistance_count[rx_buffer[12]] ++;
                                                                                        OLED_ShowString(0,4,"buff");
                        {
                            int Anchor_Index = 0;
                            while(Anchor_Index < ANCHOR_MAX_NUM)
                            {
                                                                                                                                OLED_ShowString(0,0," 444");
                                if(Anthordistance_count[Anchor_Index] >=ANCHOR_REFRESH_COUNT )
                                {
                                    distance_mange();
                                                                                                                                        OLED_ShowString(0,6,"   51UWB Node");
                                    Anchor_Index = 0;
                                    //clear all
                                    while(Anchor_Index < ANCHOR_MAX_NUM)
                                    {
                                        Anthordistance_count[Anchor_Index] = 0;
                                        Anthordistance[Anchor_Index] = 0;
                                        Anchor_Index++;
                                    }
                                    break;
                                }
                                Anchor_Index++;
                            }
                        }
                    }
                }这里,延迟是这样#define UUS_TO_DWT_TIME 65536

/* Delay between frames, in UWB microseconds. See NOTE 4 below. */
/* This is the delay from Frame RX timestamp to TX reply timestamp used for calculating/setting the DW1000's delayed TX function. This includes the
* frame length of approximately 2.46 ms with above configuration. */
#define POLL_RX_TO_RESP_TX_DLY_UUS 3000 //
/* This is the delay from the end of the frame transmission to the enable of the receiver, as programmed for the DW1000's wait for response feature. */
#define RESP_TX_TO_FINAL_RX_DLY_UUS 500 //500
/* Receive final timeout. See NOTE 5 below. */
#define FINAL_RX_TIMEOUT_UUS 3300 //3300


/* Delay between frames, in UWB microseconds. See NOTE 4 below. */
/* This is the delay from the end of the frame transmission to the enable of the receiver, as programmed for the DW1000's wait for response feature. */
#define POLL_TX_TO_RESP_RX_DLY_UUS 150//150
/* This is the delay from Frame RX timestamp to TX reply timestamp used for calculating/setting the DW1000's delayed TX function. This includes the
* frame length of approximately 2.66 ms with above configuration. */
#define RESP_RX_TO_FINAL_TX_DLY_UUS 3500 //2700 will fail
/* Receive response timeout. See NOTE 5 below. */
#define RESP_RX_TIMEOUT_UUS 2700  //2700
想问一下怎么改呢
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

bphero Inc.  

GMT+8, 2025-4-13 20:53 , Processed in 0.012015 second(s), 6 queries , File On.

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc. Template By 【未来科技】【 www.wekei.cn 】

快速回复 返回顶部 返回列表