Pages: [1]   Go Down
Author Topic: Excel or .txt matrice une arduino ??? HELP !!  (Read 1020 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi everybody !!

We are two french student and we have to program an Hexapod robots ! We have to program 18 servomotors.

We made a simulation with a DAO software and found the angle of each servo in a very large EXCEL matrix !! (18 columns and 2000 lines !!!!!)

Is it possible to copy paste that matrix in our program ??

Thanks for your answer !!

System information :
Arduino ATmega 1280
18 ervo futaba 3003
Logged

Hertfordshire, UK
Offline Offline
Newbie
*
Karma: 0
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'd guess your best route would be to export it to a CSV with quotes and then use some clever search/replace to get it into array format so you can define it in code.

Someone else might come up with a better solution though but that's what I'd do.
Logged

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

18 columns by 2000 rows is 36000 values. Even if they are all bytes, that is NOT going to fit in SRAM.

Your best bet is to save the data as a csv file, on an SD card, and add an SD card reader to the robot. Read a record, move the servos. Repeat until you get to the end of the file.

Then what? Does the robot just stop?
Logged

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

Yes,

At the end of the values the robot just stop.

So, on our arduino, SRAM is egual to 8Ko and 8Ko of EEPROM and 128Ko of flash memory.

If we take values with only 3 numbers (angle from 0 to 180°)...we can use 8000 values ?

((8ko of memory * octets)/8 bytes to code the three number of angle value ?)

Sorry for that stupid question but we are in mechanical design and we are novice in C language...

Thanks for your reply !!
Logged

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

We try to convert our EXCEL values with a basic software (transform columns in rows...) and withe the half of our values we occupe only 40% of the memory...

I attach a screen shot of the program...


* Capture number113 of 24-01-2013.jpg (334.36 KB, 1152x787 - viewed 12 times.)
Logged

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

The number you highlighted there is the amount of program memory you are using, NOT the amount of SRAM you are using. Screen shots are a lousy way to show code, but those float arrays seem to be quite large, and will not fit in the amount of SRAM that you have.

Of course, since the data is never going to change, you could use PROGMEM to store the data, rather than SRAM. Not too difficult, but not quite as easy as accessing the data in SRAM.
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 168
Posts: 12425
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Is there symmetry in the table you can use to fold it and make it smaller?
- I expect you can.

Or are some servo's just phase shifted version of others?
If so you can do with less tables (and a small shift formula)
- I expect this is the case too

Or can you find a formula for the movements as a function of f(time)?
- might be more difficult
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

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

Find a function of time to describe the mouvement are too difficult !! ( we tried !)

But we probably find a solution...

Firstly we write a program on matlab to extract the minimum and maximum of each increasing and decreasing phase of each columns...this operation reduce the size of the matrix from 2000 values to 10 or 15 values !!!

So it's right that we lost a big part of the information but when we load the totality of the value, the servomotors describes a very very jerk movement.

Secondly we don't load every values for every servomotors...we load the values of each movement ( stand up phase / walk phase / rotation phase ) in 18 matrix of 10 to 20 values ( 300 < values < 400 to control the 18 servomotors ) and we programm each servomotors with loop...

Actually we extract the good data...

We think that is a good idea to program our hexapod spider...But maybe you have others idea ?

thanks a lot for your help !

Logged

Pages: [1]   Go Up
Jump to: