Pages: [1]   Go Down
Author Topic: Real-time Data Acquisition from Matlab to Arduino  (Read 2149 times)
0 Members and 1 Guest are viewing this topic.
Bacau, Romania
Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset 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 44 times.)
« Last Edit: December 17, 2011, 08:07:44 am by lusian » Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 610
Posts: 49074
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset 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 Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset 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 Offline
Brattain Member
*****
Karma: 610
Posts: 49074
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset 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 Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset 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 Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset 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 Offline
Brattain Member
*****
Karma: 610
Posts: 49074
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset 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
Jump to: