Pages: [1]   Go Down
 Author Topic: Real-time Data Acquisition from Matlab to Arduino  (Read 2061 times) 0 Members and 1 Guest are viewing this topic.
Bacau, Romania
Offline
Newbie
Karma: 0
Posts: 9
 « on: December 17, 2011, 08:02:33 am » Bigger Smaller Reset

Okey, i need some help with the followings:
I need to transfer some variables from Matlab to arduino. I try to build a delta robot with an arduino controler, and I must calculate the degrees for the servo. Calculate their grades with Matlab, and after the matlab finish the calculation I want to send the results(3 degrees-variables) to arduino, and then arduino must send the data(degrees) at the servo.
I drew a sketch to be better understood.
 ARDUINO MATLAB.jpg (36.95 KB, 862x288 - viewed 39 times.) « Last Edit: December 17, 2011, 08:07:44 am by lusian » Logged

Seattle, WA USA
Offline
Brattain Member
Karma: 601
Posts: 48543
Seattle, WA USA
 « Reply #1 on: December 17, 2011, 08:12:18 am » Bigger Smaller Reset

Quote
I need to transfer some variables from Matlab to arduino.
You need help with which part of it? Having MatLab calculate the values? Having MatLab send the values? Having the Arduino receive the values? Having the Arduino use the values? Sourcing parts for the robot? Assembling the robot?
 Logged

Romania
Offline
Newbie
Karma: 0
Posts: 2
 « Reply #2 on: December 17, 2011, 10:47:32 am » Bigger Smaller Reset

Hello everyone
I'm Lucian colleague and I can answer .
So, yes=MatLab calculate the values; yes =  MatLab send the values; yes = the Arduino receive the values; yes = the Arduino use the values to move some servo. The the whole idea is :how to Arduino read some value from Matlab .

Thank you, bye.
 Logged

Seattle, WA USA
Offline
Brattain Member
Karma: 601
Posts: 48543
Seattle, WA USA
 « Reply #3 on: December 17, 2011, 12:02:53 pm » Bigger Smaller Reset

Quote
So, yes=MatLab calculate the values
Does this mean "Yes, we know how to make MatLab compute the values" or does it mean "Yes, we need help with making MatLab compute the values"?

The connection between MatLab and the Arduino is by way of the serial port. So, call Serial.begin() in setup, with a value to match MatLab. Then, use Serial.available() and Serial.read() to determine haow much data is available to read, and read the data one byte at a time.

Depending on how MatLab is sending the 3 values, you may have to read 3 bytes, 6 bytes, or an unknown number of bytes.
 Logged

Romania
Offline
Newbie
Karma: 0
Posts: 2
 « Reply #4 on: December 17, 2011, 12:36:46 pm » Bigger Smaller Reset

Sorry for the confusion. The calculation is done in Matlab. We want to send three values ​​to the Arduino. Would help us a simple example.
Thank you.
 Logged

Bacau, Romania
Offline
Newbie
Karma: 0
Posts: 9
 « Reply #5 on: December 19, 2011, 05:23:57 am » Bigger Smaller Reset

Quote
I need to transfer some variables from Matlab to arduino.
You need help with which part of it? Having MatLab calculate the values? Having MatLab send the values? Having the Arduino receive the values? Having the Arduino use the values? Sourcing parts for the robot? Assembling the robot?

Quote
Having MatLab send the values? Having the Arduino receive the values? Having the Arduino use the values?
The results from the matlab we want to send to arduino.
 Logged

Seattle, WA USA
Offline
Brattain Member
Karma: 601
Posts: 48543
Seattle, WA USA
 « Reply #6 on: December 19, 2011, 05:57:36 am » Bigger Smaller Reset

If I understand correctly, then, you need help with MatLab. When you get that working, will you go over to the MatLab forum and ask for help with the Arduino side?
 Logged

 Pages: [1]   Go Up