image thumbnail

Rensselaer Arduino支金宝app持包库(Rasplib)

version 1.35 (11.1 MB) by Joshua Hurst
Simulink sensor and motor driver library for Arduino

144下载

更新17 Aug 2020

View Version History

GitHubview license on GitHub

A Simulink Arduino toolbox with blocks for: quadrature encoder, compass/magnetometer, barometer, temperature, accelerometer, gyroscope, ultrasonic, driver amplifier (DC motor driver), and simple serial communication and plotting tools.

Supported I2C Sensors: MPU6050, MPU9250, HMC5883, BMP180, BMP280, MS5611, BMI160 (commonly found on GY-521, GY-271, GY-91, GY-87), HC-SR04, VL53L0X

为LEGO NXT电机的基本硬件IO,步进响应和闭环控制提供了示例。

Download includes basic curriculum labs describing the following:
- Simulink Arduino Intro Blinking LED
- RASPlib Installation Instructions
- 模拟和编码器输入和PWM输出
- Gyroscope Reading and Calibrating
- Magnetometer - Making a Compass
- Serial Communication Basics
- Bluetooth Communication
- 直流电机步骤响应
- Realistic DC Motor Simulation
- Basic DC Motor Control
- Realistic PI Controller Simulation
- DC电机参数ID
- 用互补滤波器确定角度
- Basic Balancing Lab
- Ultrasonic Distance Sensor

Labs are draft labs. Please contact with suggestions or help before leaving negative feedback.

经过测试的Matlab版本2015A-2019A。金宝app支持Mega,Nano和Uno。未经修改,未经测试或预期工作。

We highly recommend 2015a 32 bit for the best user experience. It is the fastest for compile and connection times and it the most tested version.

Cite As

约书亚赫斯特(2020年)。Rensselaer Arduino支金宝app持包库(Rasplib)(https://github.com/hurstj01/RASPLib), GitHub. Retrieved.

评论和评级(71)

Joshua Hurst

支持2020A。金宝app如果您需要帮助其他问题,请发送电子邮件。Joshua.Hurst.rpi@gmail.com Josh.

varun lal.

这个lib可以使用较新版本的matlab(2020a)吗?

Joshua Hurst

Have you completed all the steps in Labs 1 and 1a included in the download? Please send me an email if you have and are still having trouble. joshua.hurst.rpi@gmail.com Josh

嗨约书亚, I have this model error Undefined variable "realtime" or class "realtime.internal.getArduinoIDERoot". could you help me?

Alexys Gonzalez

嘿,我需要Matlab 2014A版的图书馆,你能帮我吗?

Hung SoM

如果我想使用arduino的rasplib图书馆,该怎么办?请你帮助我好吗?

Hung SoM

Can you help me with this error? I have completed biul, but cannot run. Although my MPU6050 is connected

Error occurred while executing External Mode MEX-file 'ext_comm':
无法连接到目标。等待目标的连接响应时发生超时。超时的可能原因:
a) The target is not switched on.
b) The target is not connected to your host machine.
c) The application for the model is not running on the target. You might have clicked the Stop button. If the Run button is not dimmed, click it. Otherwise, click the Build button, which downloads and runs your application on the target.

Joshua Hurst

Hello! Send me an email and I will help you with the error. joshua.hurst.rpi@gmail.com Josh

Vladyslav Lenko

嗨,我的Ive下载了库,并在红色的Decontiune行中块与系统没有找到消息。:(

Joshua Hurst

It does, tit has been tested on 2019b and 2020a.

Does this work for Matlab 2019??

Joshua Hurst

I think there is a version of MATLAB where this is an issue: Send me an email with your version and I can try to figure this out: joshua.hurst.rpi@gmail.com

Dario3design

I have the same trouble:
###模型的构建过程:由于错误而下降的“demo_minsegmega_v3”。
Undefined variable "realtime" or class "realtime.internal.getArduinoIDERoot"
·使用HCSR04时才会发生

Dimas Silva.

hi Joshua, i have this model error Undefined variable "realtime" or class "realtime.internal.getArduinoIDERoot". could you help me? I have followed the installation instructions in README.txt and labs 1 and 1a.

Joshua Hurst

你好。这通常意味着您使用的是正常模式,或者只是在使用外部模式(通过Lab 1查看)中部署到硬件中的硬件。发送给我一封电子邮件,其中包含其他信息,我可以帮忙:Joshua.Hurst.rpi@gmail.com

hi mman, i need to use this sensor VL53L0X (a need the value of the mesure to make a control system in simulink) , i just instal this library, an use the block on simulink but the mesure that gives me is always 0. what can i do? can you help me

Rafi Banar Adi

Bruno Lima

没有解金宝搏官方网站决方案,我的家伙。在这个shitttttt上火

Joshua Hurst

Hello! Tentatively - Yes. I download and ran a couple demos and it went fine. I have not tested all the files yet, but I think it should be OK. Once I have tested more extensively I will update the file information, but for now it should be OK to try. Let me know if you have any issues! Josh

嗨约书亚, Is this library compatible with the 2019b version?

Joshua Hurst

Hello,

There are different Magnetic levitation kits that have been used. For our base controller design was with a coil with R=3.4 ohm, L=15mH. Most kits have coils with much larger resistance, but we were able to use the same controller design. You can easily measure the coil resistance, and this inductance value should get your controller close.

enrique hidalgo

你好Joshua,我是一个学生,他们正在进行如何在Maglev设备中设计和实施控制算法的项目。您知道线圈电感和电阻的值吗?我可以分析系统吗?谢谢。

Joshua Hurst

一定要按照安装说明README.txt and labs 1 and 1a . If you still need help send me an email at joshua.hurst.rpi@gmail.com

Angela Rendon

hi Joshua, i have this model error Undefined variable "realtime" or class "realtime.internal.getArduinoIDERoot". could you help me?

Daniel Renjewski

Quan Nguyen

嗨约书亚, I am struggling with VCNL4010 proximity sensor and PCA9548A multiplexer. Could you help me to build S-Function block to work on Simulink? Thank you so much.

Joshua Hurst

Hello and thanks! I have used this with many 9250's with the magnetometer working. Send me an email with additional information and some pictures of your setup and I can help out: joshua.hurst.rpi@gmail.com

Gabriel Giannini

首先我想to thank you for the amazing work.
I have been following all the labs and learning a lot from that.
只有一个问题,我注意到MPU9250的磁力计不起作用。它看起来像MPU9250.H和MPU9250.CPP的文件没有为磁力计配置。你打算做任何关于这个的更新吗?
谢谢。

Joshua Hurst

Have you looked at the labs in this download? There is a lab for parameter ID, some modeling, and a balance lab.

对于其他错误,您可以向Joshua.hurst.rpi@gmail.com发送电子邮件,我会帮助您

ayong郑

您好〜我正在做Minseg项目,其中使用M1v4,电路板是MPU6050。我想问一下,你知道Minseg网站上的倒立摆机器人Minseg的非线性模型是正确的吗?还知道你喜欢机器人和其他东西的参数等参数?另一个严重的问题是当我使用演示M1v4中的Simulink块时,每次使用PIN码时都金宝app会出现一个错误,这是连接的丢失。你能帮助我解决这些问题吗?非常感谢你!

Joshua Hurst

此库仅使用Mega,Nano和Uno进行测试。由于您必须修改到期图书馆和引脚的代码。我已更新了这些信息的描述。谢谢!

hichem belhadj chikh

i work with arduino due and i need to read postion from encoder ,which bloc of encoder i choose .

Daniel Doscher

Joshua Hurst

Home Matlab目录是Matlab默认开始的位置。在Windows机器中,它将是如下:C:\ Users \ Hurstj \ Documents \ Matlab MATLAB在其搜索路径中包含此目录,如果启动,则将库中的必要目录添加到其搜索路径。README.TXT和LABS 1和1A返回安装RASPLIB之前所需的组件的安装。您可能缺少Simulink的Arduino支持包。金宝app金宝app我不熟悉Mac上的安装,因此如果这些步骤不起作用,您可能希望达到MathWorks技术支持。金宝app

hasan223

我正在尝试在Mac上安装这个包。在我解救文件夹并复制Rasplib和startup.m文件之后,我在哪里粘贴它?我尝试了多个目录,但我无法访问与此支持包关联的Simulink块。金宝app金宝app如何在Mac上找到主目录?
非常感谢!

Joshua Hurst

Sure:

Use this command at the MATLAB command line to find out where arduino files are installed:
[~, hardwaredir] = codertarget.arduinobase.internal.getArduinoIDERoot('hardware')

then navigate to 'arduino\avr\cores\arduino' and you should find Tone.cpp in there.

例如:
C:\ProgramData\MATLAB\SupportPackages\R2017b\3P.instrset\arduinoide.instrset\arduino-1.8.1\hardware\arduino\avr\cores\arduino\Tone.cpp

编辑tone.cpp:搜索我的文件的“#ifdef udd_timer2”,我的文件位于亚麻布537上,并将这行修改为“#ifdef devermer_timer2_disable”(只需附加到行的结尾)

Which will prevent it from running the code defining timer 2 interrupt since 'USE_TIMER2_disable' is never defined.

Note: this will affect any code that uses timer 2! so modify at your own risk!

dgmcik

胡安安德鲁斯马丁

嗨约书亚

'- Added functionality to 3 ultrasonic sensors. Code works by modifying Tone.cpp to not use Timer 2 ISR so ultrasonic library can be used'

Can you elaborate on how exactly to do this? where is this tone.cpp file located? how to modify it?

谢谢。Regards.
胡安A.

Joshua Hurst

I2C sensors need 4 wires, power, ground, SCL, and SDA.

John Kempf

Joshua Hurst,我将在MPU-6050上使用您的支持包运行加速度计和陀螺金宝app仪传感器。我似乎无法找到在我的Mega 2560接线的任何指令。我知道当然是电压源和地面,我猜SCL和SDA引脚会转到Arduino上的SCL和SDA通信引脚,但是是否需要使用其他连接来完成工作?谢谢!

TNagy

Joshua Hurst

- Added support for ultrasonic sensor up to 2018a
- 添加了3个超声波传感器的功能。代码通过修改tone.cpp来不使用定时器2 ISR,因此可以使用超声波库

Mohd Azri Abd Mutalib

Joshua Hurst, i`m using your support package to run Ultrasonic Distance Sensor. what if i`m using 2 unit of it? if i`m not mistaken, that support package only support for one unit. please help..

Joshua Hurst

2018a now supported, in addition:

- added support for BMI160 Gyroscope Accelerometer (BMI160 seems to be more robust to noise than MPU6050)
- added serial plot for multiple channels (useful for boards without external mode like nano)

Joshua Hurst

I have fixed this for 2018a, but had not had the time to test it extensively yet. If you would like to test this release before it posted send me an email: joshua.hurst.rpi@gmail.com and I will help you.

Elric Thomas

Hello,
这个工具箱与Matlab 2015A和我的Arduino设备一起工作,这非常有用。自2018年3月以来,我的同事团队希望为其他目的安装和使用Matlab 2018 A(Simscape)。
当我尝试使用Matlab 2018安装包时,没有问题,但是当我想使用它时,加速度计,晴雨表和MPU 9250块显示“未找到”红色。当我尝试使用此块时,我在诊断查看器中遇到此错误:“SOMPU9250中Setupimpl的错误定义不正确。Setupimpl最多可以具有0个输入,因为步骤域定义0个输入(除系统对象)。“
Can you help me ?
谢谢。

chawki mey

Hello,
I have a matlab 2017a and I work with arduino. When I try to run the simulink in external mode, I receive the error message "### Unable to generate all binary outputs
可以帮我?

Kri Ratta

Zakarya Motea.

Joshua Hurst

This error is usually a result of: 1.) not installing the Arduino Support package 2.) not installing a compiler properly 3.) not installing the RASPLib folder and the startup.m file in the correct location. All the steps are outlined in labs 1 Simulink Arduino installation PDF and 1a RASPLib installation PDF. If you have followed the steps in labs 1 and 1a PDFs and still have this error please send me an email joshua.hurst.rpi@gmail.com and I will help you.

约翰斯特克克

Hi,
When try to run this in external mode I get the error message "### Failed to generate all binary outputs." The error message says it's looking for something called "stream.h". Any idea why that would be?
谢谢

Zakarya Motea.

谢谢。邮件已发送。

Joshua Hurst

给我发一封电子邮件:Joshua.hurst.rpi@gmail.com,我会帮助你

Zakarya Motea.

嗨Joshua Hurst.

why when I use Gyro block in the same Simulink model with Accelero block or Barometer block the plot of Gyro become undesirable. but when i use it alone it is ok as explained in the tutorial.

Saeed Ahmed

麦克风

Joshua Hurst

BMP180 is supported. The image file was old. The image file has been updated.

Saeed Ahmed

why BMP180 block is not shown in the library?

Joshua Hurst

给我发一封电子邮件:Joshua.hurst.rpi@gmail.com,我会帮助你

vladimir so

At the end of running everything in simulink external mode I get this error:

### Failed to generate all binary outputs.

What could be happening, thanks for your answers.

Jacob Blaustein

Joshua Hurst

The ultrasonic sensor is not supported by default after 2015b since the compilation libraries for Arduino changed. There is a workaround you can try. If you open the file "soHCSR04Sonar.m" you will see some instructions that will exclude Tone.cpp from the build path allowing compilation of the current block.

dgmcik

Ivan Dominguez

Hi! I have tried ultrasonic distance sensor in Simulink and it is doesn't work. My version is 2017 b and Simulink show me this:

Matlab \ Add-Ons \ Toolboxes \ HC-SR04 Arduino \ Code \ Sensor_ert_rtw> echo the make命令返回错误2
\ code \ sensor_ert_rtw> an_error_occurred_during_the_call_to_make
"An_error_occurred_during_the_call_to_make" no se reconoce como un comando interno o externo,
Programa O Archivo Por Lotes ejecutable。
### Build procedure for model: 'sensor' aborted due to an error.
Error:Error(s) encountered while building "sensor":
### Failed to generate all binary outputs.

Someone know why happen this?

谢谢!

Ivan Dominguez

抱歉现在讲,但我的matlab是2017年。也许它是如此

国龙江

Very good! Thanks!

Ramon Angel

Qiao Chen

N Kando

Davide Marzatico.

jeerawat pokanit.

Matlab释放兼容性
Created with R2015a
Compatible with R2015a to R2019a
Platform Compatibility
视窗 苹果系统 Linux
Acknowledgements

Inspired by:Device Drivers

Communities

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

开始狩猎!