File Exchange

image thumbnail

Arduino_Engineering​_Kit_Project_Files

version 1.3.1 (15.7 MB) by MathWorks Maker Team
MATLAB and Simulink files to program the drawing robot, mobile rover, and self-balancing motorcycle.

283 Downloads

Updated 09 Sep 2019

View License

Editor's Note: This file was selected as MATLAB Central Pick of the Week

This package includes the MATLAB and Simulink files used to program the three projects in the Arduino Engineering Kit.
• A drawing robot that takes a reference drawing and duplicates it on a whiteboard
• A mobile rover that navigates between reference points and moves objects with its forklift
• A self-balancing motorcycle that maneuvers itself on varying terrain and remains upright using a flywheel for balance
These files along with the associated online learning materials included with the kit guide users through the process of programming each project, teaching important engineering concepts along the way in areas such as controls, system modeling, image processing, and robotics.
Learn more about the Arduino Engineering Kit at www.mathworks.com/arduino-kit

Important note: After installing this toolbox, type the following command in MATLAB to move to the appropriate folder.
>> cd(arduinokit.kitRoot)

Cite As

MathWorks Maker Team (2019). Arduino_Engineering_Kit_Project_Files (https://www.mathworks.com/matlabcentral/fileexchange/66569-arduino_engineering_kit_project_files), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (18)

James Hill

For anybody still getting this error:
home/gilgamesh007/Documents/MATLAB/SupportPackages/R2018b/toolbox/target/supportpackages/arduinobase/src/MW_PWM.cpp:6:21: fatal error: Arduino.h: No such file or directory
#include "Arduino.h"
^
compilation terminated.
gmake: *** [MW_PWM.o] Error 1
### Build procedure for model: 'myDCMotorControl' aborted due to an error.
Error:Error(s) encountered while building "myDCMotorControl":
### Failed to generate all binary outputs.

Please see this:

https://www.mathworks.com/matlabcentral/answers/407753-arduino-mkr1000-simulink-build-procedure-aborted-due-to-error

and

https://www.mathworks.com/matlabcentral/fileexchange/68620-arduino_engineering_kit_hardware_support_18b?s_tid=FX_rc2_behav

James Hill

Not sure if this is the right place to comment as it is about the actual content of the instructions. This has bothered me for a while...

Can I please get clarification as to whether the Live Script created in 2.2 MATLAB Getting Started is the Motor Shaft or the Gear Box axle or just raw encoder buffer that does not even relate the quadrature?

The Live Script presented has no conversion for encoder quadrature nor is there any conversion of the motor shaft to the output axle. No math in the Live Script relates any of these items. It looks to me that we are just reading the encoder buffer. Yet the Plot at the end is Titled "100:1 Gearbox Motor Steady State Response"

Earlier in the Chapter we were presented with the following math:
shaftAngle = readCount(enc) * 360/12;
axleAngle = readCount(enc) * 360/12/100.37;
axleAngleNorm = mod(axleAngle,360);
convSpeed = (stopCount - startCount) * 360/dt/12/100.37

Not a single bit of this math appears in the Live Script.

It seems to me that line in the Live Script that should change is:
speedRaw(ii) = (endCount - startCount) / dt;% calculate speed (cts/s)

Changed to:
speedRaw(ii) = (endCount - startCount) / dt / 12 / 100.37 ;% calculate speed (cts/s)

@Yamin Hameed - Try downloading the arduino_gettingstarted model to see if the Simulink support package installation went through correctly. If that works, post the MATLAB Add-Ons installation folder here/via email.

I have uninstalled and installed all the packages (ran as administrator), but I still get the same message :S

I was able to successfully complete the drawing robot project and started working on the mobile rover project, but I get a similar error message. I did not change any file paths etc...
Here is it is
=== Build (Elapsed: 14 sec) ===
### Starting build procedure for model: roverOpenloop_hw
Error:C:/ProgramData/MATLAB/SupportPackages/R2018a/3P.instrset/arduinoide.instrset/idepkgs/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-g++ -std=gnu++11 -fno-threadsafe-statics -fno-rtti -fno-exceptions -Os -c -g -w -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -Dprintf=iprintf -DARDUINO=10801 -MMD -MP -MF"MW_PWM.dep" -MT"MW_PWM.o" -MMD -mcpu=cortex-m0plus -fpermissive -DF_CPU=48000000L -DARDUINO_SAMD_MKR1000 -DARDUINO_ARCH_SAMD -D__SAMD21G18A__ -mthumb -DUSB_VID=0x2341 -DUSB_PID=0x824e -DUSBCON -DUSB_MANUFACTURER=\""Unknown\"" -DUSB_PRODUCT=\""Genuino MKR1000\"" -D_RUNONTARGETHARDWARE_BUILD_ -D_ROTH_MKR1000_ -DMODEL=roverOpenloop_hw -DNUMST=2 -DNCSTATES=0 -DHAVESTDIO -DMODEL_HAS_DYNAMICALLY_LOADED_SFCNS=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=1 -DONESTEPFCN=1 -DTERMFCN=1 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DEXIT_FAILURE=1 -DEXTMODE_DISABLEPRINTF -DEXTMODE_DISABLETESTING -DEXTMODE_DISABLE_ARGS_PROCESSING=1 -DSTACK_SIZE=64 -D__MW_TARGET_USE_HARDWARE_RESOURCES_H__ -DRT -DMW_TIMERID=8 -DMW_PRESCALAR=256 -DMW_TIMERCOUNT=1875 -DMW_SCHEDULERCOUNTER=1 -D_RTT_BAUDRATE_SERIAL0_=9600 -D_RTT_BAUDRATE_SERIAL1_=9600 -D_RTT_ANALOG_REF_=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DONESTEPFCN=1 -DTERMFCN=1 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DTID01EQ=1 -DEXIT_FAILURE=1 -DEXTMODE_DISABLEPRINTF -DEXTMODE_DISABLETESTING -DEXTMODE_DISABLE_ARGS_PROCESSING=1 -DSTACK_SIZE=64 -DRT -DMODEL=roverOpenloop_hw -DNUMST=2 -DNCSTATES=0 -DHAVESTDIO -DMODEL_HAS_DYNAMICALLY_LOADED_SFCNS=0 -ID:/Arduino Engineering Kit/Arduino_Engineering_Kit_Project_Files -IC:/ProgramData/MATLAB/SupportPackages/R2018a/toolbox/target/shared/svd/include -ID:/Arduino Engineering Kit/Arduino_Engineering_Kit_Project_Files/roverOpenloop_hw_ert_rtw -ID:/Arduino Engineering Kit/Arduino_Engineering_Kit_Project_Files/MobileRover/Exercise2 -IC:/PROGRA~1/MATLAB/R2018a/extern/include -IC:/PROGRA~1/MATLAB/R2018a/simulink/include -IC:/PROGRA~1/MATLAB/R2018a/rtw/c/src -IC:/PROGRA~1/MATLAB/R2018a/rtw/c/src/ext_mode/common -IC:/PROGRA~1/MATLAB/R2018a/rtw/c/ert -IC:/ProgramData/MATLAB/SupportPackages/R2018a/3P.instrset/arduinoide.instrset/idepkgs/packages/arduino/tools/CMSIS/4.5.0/CMSIS/Include -IC:/ProgramData/MATLAB/SupportPackages/R2018a/3P.instrset/arduinoide.instrset/idepkgs/packages/arduino/tools/CMSIS-Atmel/1.1.0/CMSIS/Device/ATMEL -IC:/ProgramData/MATLAB/SupportPackages/R2018a/3P.instrset/arduinoide.instrset/idepkgs/packages/arduino/hardware/samd/1.6.12/cores/arduino -IC:/ProgramData/MATLAB/SupportPackages/R2018a/3P.instrset/arduinoide.instrset/idepkgs/packages/arduino/hardware/samd/1.6.12/variants/mkr1000 -IC:/ProgramData/MATLAB/SupportPackages/R2018a/toolbox/target/supportpackages/arduinotarget/include -IC:/ProgramData/MATLAB/SupportPackages/R2018a/toolbox/target/supportpackages/arduinotarget/scheduler/include -IC:/ProgramData/MATLAB/SupportPackages/R2018a/toolbox/target/supportpackages/armcortexmbase/scheduler/include -IC:/ProgramData/MATLAB/SupportPackages/R2018a/toolbox/target/supportpackages/arduinobase/include -IC:/ProgramData/MATLAB/SupportPackages/R2018a/toolbox/target/shared/externalmode_daemon/include -o MW_PWM.o C:/ProgramData/MATLAB/SupportPackages/R2018a/toolbox/target/supportpackages/arduinobase/src/MW_PWM.cpp
arm-none-eabi-g++: error: Engineering: No such file or directory
arm-none-eabi-g++: error: Kit/Arduino_Engineering_Kit_Project_Files: No such file or directory
arm-none-eabi-g++: error: Engineering: No such file or directory
arm-none-eabi-g++: error: Kit/Arduino_Engineering_Kit_Project_Files/roverOpenloop_hw_ert_rtw: No such file or directory
arm-none-eabi-g++: error: Engineering: No such file or directory
arm-none-eabi-g++: error: Kit/Arduino_Engineering_Kit_Project_Files/MobileRover/Exercise2: No such file or directory
gmake: *** [MW_PWM.o] Error 1
The make command returned an error of 2
'An_error_occurred_during_the_call_to_make' is not recognized as an internal or external command,
operable program or batch file.
### Build procedure for model: 'roverOpenloop_hw' aborted due to an error.
Error:Error(s) encountered while building "roverOpenloop_hw":
### Failed to generate all binary outputs.

haoyu jiang

@Multiplexer - On some OSes users were having issues with the white space messing up stuff during code generation. Hence the need to use _ sign.

Multiplexer

Anybody gets mildly triggered by how instead of space the _ is separating words just for this addon?

admin privileges is the answer, thanks

@Federico Vismarra - Have you tried what Pavol did? Reinstall the MATLAB and Simulink support package for Arduino. Uninstall the support packages and close MATLAB. Reopen it with admin rights by right clicking MATLAB icon and selecting Run as administrator. Then install the support packages.

Arduino.h is an integral part of the 3rd party libraries that you download during MATLAB support package. If that itself is missing, the best shot is to reinstall with admin privileges.

HTH,
Madhu

C:/ProgramData/MATLAB/SupportPackages/R2018a/toolbox/target/supportpackages/arduinobase/src/MW_PWM.cpp:6:21: fatal error: Arduino.h: No such file or directory
#include "Arduino.h"
^
compilation terminated.
gmake: *** [MW_PWM.o] Error 1
The make command returned an error of 2
"An_error_occurred_during_the_call_to_make" non è riconosciuto come comando interno o esterno,
un programma eseguibile o un file batch.

Same problem, No solutions found yet

For those who are downloading the zip file from File Exchange directly, steps to follow -

1) Download and extract the zip file.
2) From within MATLAB, move to the extracted folder and execute the following commands -
>> addpath(genpath('Arduino_Engineering_Kit_Project_Files'))
>> rmpath(fullfile('Arduino_Engineering_Kit_Project_Files','DrawingRobot','Solutions'))
>> savepath

Remember to follow the Important Note on this submission as well.

For those who are using the Add-On explorer inside MATLAB toolstrip, if it hangs during this process please visit this link https://www.mathworks.com/matlabcentral/fileexchange/66569-arduino_engineering_kit_project_files to download the zip file.

Steps to follow -

1) Download and extract the zip file.
2) From within MATLAB, move to the extracted folder and execute the following commands -
>> addpath(genpath('Arduino_Engineering_Kit_Project_Files'))
>> rmpath(fullfile('Arduino_Engineering_Kit_Project_Files','DrawingRobot','Solutions'))
>> savepath

Remember to follow the Important Note on this submission as well.

@Kevin Hoche - Removed all the spaces from the submission in the latest version (1.1.2) of the toolbox.

CJ Godfrey

@Pavol Michalina: I had this exact problem too (MacOS High Sierra). I found I had to uninstall the Hardware Support packages (Matlab and Simulink Support Pkgs), then uninstall the Arduino IDE, then reinstall the Hardware Support Packages. Not sure why already having Arduino IDE installed created the problem but the hardware support packages also install the Arduino IDE.
If this was indeed the cause, it will be a frequently encountered issue with makers who have probably been working with Arduino before using the hardware support packages for Arduino engineering kit.

So reinstalled everything and now it works no idea what was wrong.

I have a problem with DC3_open_loop.slx and all the other files that need to run on hardware. This is the error:
C:/ProgramData/MATLAB/SupportPackages/R2018a/toolbox/target/supportpackages/arduinobase/src/MW_PWM.cpp:6:21: fatal error: Arduino.h: No such file or directory
#include "Arduino.h"
^
compilation terminated.
gmake: *** [MW_PWM.o] Error 1
The make command returned an error of 2
'An_error_occurred_during_the_call_to_make' is not recognized as an internal or external command,
operable program or batch file.

So i figured i just paste Arduino.h in to the /src/ folder but that did not work because that references other files in other directories and each time i put another file in the folder it just crashes with the same error different file missing. And there is no support forum for this kit or anything.

What piece of trash 1 star.

Hoche96

The folder path has spaces. Please fix this. Simulink cant find the work folder.

Updates

1.3.1

Starting R2019a, the location of resources had changed. This update should fix that.

1.3

Updating the drawing robot files to make the robot faster.

1.2

Updating motorcycle and introduction chapters to address a bug.

1.1.3.1

Removing whitespace from name and the file name.

1.1.3.0

Fixed the name on the submission

1.1.2.0

Updating the name to exclude spaces in the path.

1.1.1.0

Updating the required products

1.1.0.0

Modified description

MATLAB Release Compatibility
Created with R2019a
Compatible with R2018a to any release
Platform Compatibility
Windows macOS Linux
Categories