Pages: [1]   Go Down
Author Topic: AHRS with matlab and arduino  (Read 1729 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

my ahrs sensor is sending data to matlab which processes it...the results of the processing needs to be sent to the arduino to run motors..
here is the matlab code...how do i interface my arduino deumilanove so that it can receive this data from the serial port send by matlab...is there any simple way of receiving this serial data on my arduino without going into the arduino libraries in matlab and using a usb domain only?
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48556
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
my ahrs sensor is sending data to matlab
How did you connect the sensor to matlab? Wasn't it a bit hard to solder the wires to the bits?

Quote
the results of the processing needs to be sent to the arduino to run motors
What results? Speed and direction?

Quote
here is the matlab code
Where?

Quote
how do i interface my arduino deumilanove so that it can receive this data from the serial port send by matlab
Start by losing the stupid buzzwords. Interface? What does that mean?

Having the Arduino read data from the serial port is trivial. Look at the Serial.available() and Serial.read() functions.

Quote
is there any simple way of receiving this serial data on my arduino
Yeah.

What's wrong with your shift key?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

sorry for the vague question earlier...i am new to hardware...

I wanted to send some value from MATLAB to my arduino installed at say COM18. What are the steps i should follow? This should do my job.

Thanks.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48556
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Have you read this?
http://arduino.cc/playground/Interfacing/Matlab

Are there things that are missing/should be added?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

my arduino is on com 18...i have uploaded the adiosrv.pde on the board..but when i try to connect using matlab i get this error...i tried plugging and unpluggin the arduino but yet the problem persisits... arduino.m is included in the folder...
where am i going wrong?


 a=arduino('COM18')
Attempting connection ......
Warning: A timeout occurred before the Terminator was reached.
??? Error using ==> arduino>arduino.arduino at 100
Connection unsuccessful, please make sure that the Arduino is powered on, running
either adiosrv.pde or mororsrv.pde, and that the board is connected to the indicated
serial port. You might also try to unplug and re-plug the USB cable before
attempting a reconnection.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48556
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
where am i going wrong?
There seems to be an issue with Windows and/or some applications handling of COM ports 10 or above.
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1192119372
The Arduino side is supposed to have been fixed, but, perhaps Matlab hasn't. Try changing the serial port name to \\.\COM18 and see if that helps.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks a ton Paul. Hope this works. I had similar problem working on a Zigbee. Thanks again.
Cheers. Thanks for taking out time for such a trivial thing.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The problem still persists, I connected it to a COM port 6, and try to access by a=arduino('COM6') in Matlab but it still gives the same warning when i am using Windows(XP or 7). However, when i do the same in Linux (Ubuntu) it connects, what is the problem in Windows?
My port config is bps- 9600, data bits-8, parity- none, stop bits-1, flow- none. Can you please solve this problem? I have tried a lot of different things like installing uninstalling drivers, Matlab etc , but nothing changes in that Warning.
Logged

Pages: [1]   Go Up
Jump to: