Go Down

Topic: [Help] Servo Motor reading values (Read 647 times) previous topic - next topic


Jan 08, 2019, 12:21 am Last Edit: Jan 08, 2019, 12:22 am by stEEz
Hello all, so..

I've recorded values of axes x,y,z moving along the time in a file, now I want to reproduce those movments with servo motors exacly like they were recorded. so I have to build something that allows me to upload the file to the arduino and then automatically control the servo motors to replicate the movements syncronized in time

this values were recorded in sample rate of 1/8 so the they look like this:

I'm comfortable with coding but im new with arduinos, so what pieces do I need for this puzzle?
 - upload the file to the arduino like an array?
 - Make a cycle reading the 3 values (X,Y,Z) at the correct speed/sample rate and move the motors according at the same time

Do you have any tips or some examples that perhaps could help me?
Thank You!


How many values do you have? If it's a few, you could just put them in an array. If a lot, look at progmem to store them.

Do you need to do this with different files? Use an SD card to store them and use file operations to read the data.


Lets say for a recording of 3 minutes maybe 50000 values for each axies.
Yes I'm thinking of using an SDCard to store the data.


You already have the relationship between 3d co-ordinates and servo angles covered then? (So you know that to get the end-effector at x1, y1, z1 you need angles a1...an on the servos?)


Jan 09, 2019, 09:53 am Last Edit: Jan 09, 2019, 09:55 am by dekutree64
What exactly do you mean by "recorded in sample rate of 1/8"? If 3 minutes is 50000 values, that would be sample rate of 277.777 per second. Or is it not a steady sample rate, but a sequence of commands with timestamp in 8ths of a second? But then you only have 1440 unique timestamps in 3 minutes, so I don't understand where the 50000 is coming from. Or does the time value mean to wait that many milliseconds or something before executing the next command?

Go Up