Using SD Cards with...
 
Notifications
Clear all

Using SD Cards with Arduino - Record Servo Motor Movements

84 Posts
6 Users
1 Likes
7,704 Views
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2531
 

@frogandtoad 

Thanks for the update and information.

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2531
 
Posted by: @robomaster

@will 

The record button just starts the record function loop and putting the servo position on the SD Card. The blue button (Stop) is what breaks it out of the record function stopping it.

You're not listening. I have set the sketch to use to let you set the pots manually and it will STAY paused waiting for you to set them until you press the red button again to tell it that you have finished setting the pots.

I chose this method to give you time to set the pots and since the red button is already used to choose the Record function, POLA (the principle o lest astonishment) suggested the it would be reasonable way of indicating that the current set of pot values should be saved.

This doesn't seem to be acceptable to you, so perhaps you could tell me how you would signal that the pots have been correctly set and are ready to be stored onto the SD card.

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
(@robomaster)
Member
Joined: 3 years ago
Posts: 36
 

I hope this is getting to you ok.

 

What the record function Should do is read all four pots convert them to 0 to 180-degree values store them to the SD Card and move the servos so I can see the movements move as being recorded and keep looping until the blue button is pressed. (Stop Button)   So the record button is used to start it recording.

(Red Button)


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2531
 

@robomaster 

So, you're telling me that you want recording to stop after the first set of values is stored (because you're using the STOP) button ?

Is that correct ?

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2531
 

@robomaster 

I'm trying to make sense of what's going on here and it occurred to me that you want to continuously record the pots as they move and not just when they've been set in place.

Is that right ?

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
(@robomaster)
Member
Joined: 3 years ago
Posts: 36
 

@will 

 

In the above is the single-channel version of this. The Record Button (Red) just starts the Record Function Looping Reading the pot converting it and put the servo information on the SD Card and move the servo at the same time and playing it back.

All I want to do for now is expand to is read four pots and record and play it back. Think of it as a tape recorder. Later I want to expand to sixteen pots and servos.


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2531
 

@robomaster 

OK, but you haven't answered my question. please remember that I have NO idea what you're doing except for what you tell me and I have to ask questions to understand what the sketch has to do because I, in turn, have to tell the Arduino what to do.

So, I just want you to confirm (or deny) that the the pot values are collected and sent to the servos continuously and then stored in the file as fast as possible. That is, no signal from you is required to cause the pot readings to be acted upon.

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
robotBuilder
(@robotbuilder)
Member
Joined: 5 years ago
Posts: 2042
 

@will 

Yes it is a little bit frustrating if you don't know exactly what you are supposed to be coding.  Being fed little pieces of information without the complete picture is why I haven't bought into this exchange earlier apart for being busy with other things. A complete description of what the project is would make it much easier. Lacking that it is all guess work. My guess is this is an animatronic project. So for example I might have a robotic arm which I can control using POTS. I press RECORD and then start moving the arm about using the sliders while changes in position over time are recorded until I press STOP. I can then press PLAY and the arm will reset to the start and move through the recorded positions at each unit of time.

@robomaster

Now it is unclear what this means?

Need to be able to switch the 4 channel console between servo banks without affecting what was recorded previously.

Are there four different sets of four servos which need to be controlled in turn by the same four sliders? In which case you need another input to indicate which of the four sets of servos you want to control with the same controller.

Trying to fix, write or give advice on code is pointless until you have a complete step by step description of the required behaviour in a human language. IMHO

 


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2531
 

@robomaster 

I'm much too lazy to try to dig through the sketch you attached to figure out what you want/need. Here is a new version (5C) that may or may not be what you're looking for. I think this includes all of the subs you'd need to implement what I guess you want.

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2531
 

@robotbuilder 

Apparently you understand what he wants a lot better than I do. Never heard of animatronics before, guess I'll go look it up now.

Nah, on second thought I'm going to go clean up another project of my own:)

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
robotBuilder
(@robotbuilder)
Member
Joined: 5 years ago
Posts: 2042
 

@robomaster 

Ok. I just watched Bill's video and it all seems easy enough.

I will order the SD module tomorrow as I can see it might be useful in my own projects but it may take a week or more before it arrives.

I have looked at your code and it is simple enough to expand to more servos but you must answer the question I asked because it would be relevant to getting a sensible reply.  Unless of course you figure it out all by yourself in the meantime 🙂

Just found this online which is similar to what I think you want to do,
https://create.arduino.cc/projecthub/mircemk/record-and-play-arduino-3d-printed-robotic-arm-a87430

But it doesn't answer your question which I don't really understand fully:

Need to be able to switch the 4 channel console between servo banks without affecting what was recorded previously.

 


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2531
 

 @robotBuilder

 In ihis 2021-10-06 4:32 PM post he says

 
Posted by: @robomaster

@will 

 

In the above is the single-channel version of this. The Record Button (Red) just starts the Record Function Looping Reading the pot converting it and put the servo information on the SD Card and move the servo at the same time and playing it back.

All I want to do for now is expand to is read four pots and record and play it back. Think of it as a tape recorder. Later I want to expand to sixteen pots and servos.

 which implies that he will have 16 servos and 16 pots. No idea what "servo banks" means.

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
(@robomaster)
Member
Joined: 3 years ago
Posts: 36
 

@will 

I'm trying to make sense of what's going on here and it occurred to me that you want to continuously record the pots as they move and not just when they've been set in place.

Is that right ?

 

Yes.

 

So, I just want you to confirm (or deny) that the pot values are collected and sent to the servos continuously and then stored in the file as fast as possible. That is, no signal from you is required to cause the pot readings to be acted upon.

Yes, confirmed.

I have download the 5C program but have not looked at it yet. I still want to thank you for all your help.

The Servo Controller Base Functions:

To be able to control sixteen servos and by using in this case a small four-channel console using buttons for control to record and playback servo positon data to and from an SD Card. Then be able to switch channels of the four-channel console to the next four servos and record those channels without affecting the first four channels and keep this going until all sixteen channels are recorded.  To be able to rerecord any channel without affecting the other channels for editing if I got a channel wrong. To be able to set Upper and Lower limits of each servo and lastly be able to sync it to an external MP3 player.  This is basically how I would like to get to work.

 

For now, I need to have four channels working so I can show it to my client I can record and playback from an SD Card and then get them to lock down all the functions that they want


   
ReplyQuote
(@robomaster)
Member
Joined: 3 years ago
Posts: 36
 

@will 

You don't know what an animatronic Figure is the check out this is Igor my talking skull I am adding more function that is why I am making the Controller.

 


   
ReplyQuote
robotBuilder
(@robotbuilder)
Member
Joined: 5 years ago
Posts: 2042
 
Posted by: @will

@robotbuilder 

Apparently you understand what he wants a lot better than I do.

Well no I have no exact idea what robomaster requires.
I assumed something to do with animatronics because of the posted code.
I see he also wants to sync it to an external MP3 player.
https://forum.arduino.cc/t/how-to-synchronize-servo-with-audio-mp3-files-like-talking-robot/618049
He may be the Tim Lewis that does kinetic art?
http://www.kinetica-artfair.com/?exhibitors/2013/tim-lewis

With interactive kinetic art the work might react to a person's presence in some way.

 

 


   
ReplyQuote
Page 4 / 6