LEGO NXT - Datalog ability - adjustments of external mode or other solutions?
1 回表示 (過去 30 日間)
古いコメントを表示
My question is related to the datalog ability with external mode turned on. What is the sampling rate for the recieved data in the simulink scope? And is there any way to influence this rate?
My problem is that i have a highly dynamic system and i need a high sampling rate for the sensor input signals. With external mode enabled task overruns are very likely to occur, but disabling the external mode is not a solution for me.
The best solution would be if there was any offline datalog solution. So you can save the data on the nxt brick and retrieve it afterwards. I know that the original firmware supports this, but i couldn't find any solution in simulink or even in the api the used firmware offers. Is there any way to implement this?
The other approach i would like to try is to decrease the "communication rate" between simulink and the nxt brick. This would be also satisfying as i only need to get an idea of what is going on. If the sensor values are drifting away i.e. And therfore the time sampling rate does not have to be as high as for the computing algorithm running on the brick. Is there any way to control this?
0 件のコメント
採用された回答
Guy Rouleau
2013 年 2 月 1 日
Here are a few info that might help you based on my experience:
- Typically, external mode is a lower priority process. If you model has a fast sample time, external mode values will be dropped and sent "only when there is time". In my experience, if I go 4ms for a model, I begin to loose a lot of points, but I don't see overrun on the target.
- I do not know if any way to store data on the brick with the Simulink NXT support package.
- External Mode will send data at the rate of the Sink block. If you use a scope, you use the Decimation or sample time property of the scope to control that.
- As for alternate approach, I like to use the Bluetooth blocks. Those are designed to communicate between bricks, but with a bit of work it is possible to receive the packets on the host. This is significantly more lightweight than external mode and will not drop packets.
2 件のコメント
Guy Rouleau
2013 年 2 月 15 日
Here are a few options to get the data in MATLAB:
- With MATLAB, you can use basic fopen/fread/fclose to open the serial port and get the data.
- The Instrument Control Toolbox has functions to interface directly the bluetooth connection. I personally never used those, but I heard they can work.
- If you dig through the files in the following MATLAB Central submission, you will find example MATLAB scripts and mex-file that you can use to directly the bluetooth. I have used those extensively with the Simulink support package for Lego NXT.
その他の回答 (1 件)
Dominik
2013 年 2 月 19 日
6 件のコメント
Shivanand
2013 年 11 月 7 日
Hello Alex,
I am also working with VU-LRT, I have installed program on NXT the data is also displayed on Matlab but i couldnt save this data. When i added more blocks like Timer, Scope it gives errors as enlisted by you. Please tell me if you get any answer to resolve this issue.
-Shiv
Shivanand
2013 年 11 月 7 日
Hello Rouleau,
I could recieve packets on my PC connected to NXT using USB Blocks.
The packets are displayed on matlab screen.
I want to store the data recieved for different sampling time to check wheather the data recieved is complete or it has some lapses.
How should i do that?
Please help me.
-Shiv
参考
カテゴリ
Help Center および File Exchange で MATLAB Support Package for LEGO MINDSTORMS EV3 Hardware についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!