MATLAB vs arduino for a project

Hello, I am building a Onewheel. I'm going to use 2x 350W 36V bldc motors from the hoverboard, 2x ESC with hall sensors support, ESP32, MPU6050, resistive sensor for foot activation, some Neopixel LEDs and 2x 6s2p batteries wired in series (together around 44V) to power it all.

Software wise I plan to use PID control with PWM output, madgwick fiter, some safety features with resistive foot sensor and later bluetooth connectivity with mobile app(maybe some gps tracking).

Now I am deciding between MATLAB and Arduino to program the whole thing. I see the advantages of MATLAB in easier implementation of algorithms and better debugging. I think there is also a possibility to convert the code from matlab to C++ using Simulink Coder, which I can modify and use later in the arduino code. What do you think? Should I use MATLAB, just arduino or a combination of both?

What hardware does MATLAB run on ?

I know very little about MATLAB but it sounds like an Arduino, or Arduino compatible board could do everything that you describe

That sounds like a recipe for much confusion

1 Like

you could run Matlab on a Raspberry Pi or use GNU Octave (which is free)

alternatively consider a powerful microcontroller such as the ESP32, RPi Pico,, STM32, etc

1 Like

I doubt very much that the C++ code produced by MatLab will run (or even fit) on most Arduinos. It'll probably want "real" C++ with assorted large libraries.

MatLab, of course, is a "large computer" application; easy to use and powerful, and frequently trivial to set up for complex mathematical models. Part of the challenge of "embedded" program (like for an Ardiuno) is somehow moving the big-computer code to the tiny little microcontroller... (or, these days, you can consider putting a much more powerful computer inside your "embedded" device. You can get near-PC-class single board computers that are not much bigger (or more expensive) than an Arduino. The sore point is usually power consumption.)

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.