View Full Version : Question How do I record servo movements
qy8flyer
Jan 03, 2006, 05:43 PM
Hi,
I have 2 servos , rec , battery .
One servo is on chan 1
One servo is on chan 2
How would I build a circuit that could record random stick movements and then play back ?
Thanks,
Dave
Malc C
Jan 03, 2006, 06:34 PM
Dave,
Can you give us a more descriptive post, like what you actually want to do.
Do you want to interface the TX to the PC and "record" the stick movement and then reply them, similar to the way simulators can record "flights". Or do you want to fly / drive a model and record the movements of the servos so that you can repeat the same "flightpath" or "trip" the model took. Or then again do you want to hook up the PC to a bunch of servos and program the movements from the PC ??
With more information, then I'm sure some of the more techie guys can advise, or if we already know of a site with some schematics etc can point you in the right direction.
qy8flyer
Jan 03, 2006, 06:45 PM
Hi,
Yea, sorry , I wasnt very detailed because I need to take a picture of what i am doing.
Its very simple. This isnt for a plane or flying. Its a toy for my cat.
I have an old joystick that has the x and y axis hooked up to 2 servos. The Joystick is then attached to a carbon rod with bird toy on the end.
I can then use my transmitter to whip the carbon rod and bird toy around in wild life like moves, I can do this all day and my cat will not stop playing . What i want to do is record say an hour of this movement then play it back
I will take a photo
Thanks
Dave
vintage1
Jan 03, 2006, 07:03 PM
Hi,
Yea, sorry , I wasnt very detailed because I need to take a picture of what i am doing.
Its very simple. This isnt for a plane or flying. Its a toy for my cat.
I have an old joystick that has the x and y axis hooked up to 2 servos. The Joystick is then attached to a carbon rod with bird toy on the end.
I can then use my transmitter to whip the carbon rod and bird toy around in wild life like moves, I can do this all day and my cat will not stop playing . What i want to do is record say an hour of this movement then play it back
I will take a photo
Thanks
Dave
What is currently driving the servos?
What WILL drive the servos ultimately?
I am a tad confused....you can't 'record' off a servo..at best you can 'record' waht is going into it to drive it.,..
qy8flyer
Jan 03, 2006, 07:03 PM
Cat Toy
Miami Mike
Jan 03, 2006, 07:25 PM
That's pretty cool, but how does it work? What controls the servos? Did you build it?
qy8flyer
Jan 03, 2006, 07:34 PM
there is a rec and battery on teh other side. the carbon rod will whip back and forth in any direction.
the carbon rod is thin
qy8flyer
Jan 03, 2006, 07:36 PM
carbon rod whip with bird toy
Miami Mike
Jan 03, 2006, 08:00 PM
Are you controlling it with an r/c radio? What kind of radio?
qy8flyer
Jan 03, 2006, 08:07 PM
Here is what I do. I control the servos with my futaba 9cap.
I can keep my cat entertained for hours if i had the time or my batteries go dead.
What I want to be able to do is play for about 30 mins then have it "save" all the moves that were made in that time period. Then "play it back" unattended so I can get back to work. Perhaps just loop thru over and over again.
Sorry if this is too off topic.
Thanks for any ideas
Dave
vintage1
Jan 03, 2006, 08:10 PM
Here is what I do. I control the servos with my futaba 9cap.
I can keep my cat entertained for hours if i had the time or my batteries go dead.
What I want to be able to do is play for about 30 mins then have it "save" all the moves that were made in that time period. Then "play it back" unattended so I can get back to work. Perhaps just loop thru over and over again.
Sorry if this is too off topic.
Thanks for any ideas
Dave
Right. So the best thing is somnething that sits between the RX and the servos.
Yu run it first time,and it passes the PWM through, but records each frame as e.g and 8 bit number...and then take the RX away, and press 'replay' and it goes through it all over again?
Actually, a modified audio tape recorder should be close...and pretty simple. One servo to each stereo channel.
They mess with the phase tho, so some correction and limiting would be needed on the output.
You will need a scope...
Miami Mike
Jan 03, 2006, 08:18 PM
At the same time, it would be nice to come up with a way to keep the transmitter off so that you're not illegally transmitting on an aircraft channel while controlling a ground-based device. Perhaps you could hook up something to the buddy box jack.
qy8flyer
Jan 03, 2006, 08:58 PM
Right. So the best thing is somnething that sits between the RX and the servos.
Yu run it first time,and it passes the PWM through, but records each frame as e.g and 8 bit number...and then take the RX away, and press 'replay' and it goes through it all over again?
Actually, a modified audio tape recorder should be close...and pretty simple. One servo to each stereo channel.
They mess with the phase tho, so some correction and limiting would be needed on the output.
You will need a scope...
Really, an audio recorder ? stereo ? umm, thats very interesting. You get the idea exactly .
qy8flyer
Jan 03, 2006, 08:58 PM
At the same time, it would be nice to come up with a way to keep the transmitter off so that you're not illegally transmitting on an aircraft channel while controlling a ground-based device. Perhaps you could hook up something to the buddy box jack.
Well, its not entirely on the ground. I can get the little bird feather toy flying around pretty good.
LOL
Mr.RC-CAM
Jan 03, 2006, 09:36 PM
There are many animatronic boards in the market that are designed to control groups of R/C servos. They are popular with hobbyists and professionals that build active props. A number of these boards allow the user to record servo movements into memory for automated playback. Some offer random play. To give you an idea of what I am trying to describe: Controllers (http://www.therobotstore.com/s.nl/sc.2/category.26/.f) (check out the Smart 6 -- looks like a good cat entertainer)
Don't get discouraged by the prices at that site. There are probably lower cost solutions out there. Of course this is a perfect DiY PIC project, so if you are into embedded programming then just roll your own.
Comatose
Jan 04, 2006, 12:19 AM
Sounds like a perfect application for a PIC, an I2C serial eeprom and a voltage regulator.
Or even just come up with a pseudo-random servo behavior generator and skip the eeprom.
Mr.RC-CAM
Jan 04, 2006, 12:41 AM
There is a chance that your kitty won't really care about a carefully programmed or truly random flying feather. How about just using two servo exercisers set to different sweep rates? It seems to me that fluffy will never know you cheated on the recipe.
If you like PIC projects, then a pair of these servo testers just might be the ticket: http://www.rc-cam.com/servotst.htm
RC-CAM
Malc C
Jan 04, 2006, 03:59 AM
Also have a look at the Lynx Motion website, http://www.lynxmotion.com/Category.aspx?CategoryID=2
They provide software to control their robots from the PC and uses a cheaper ($32) solution to control the servos http://www.lynxmotion.com/Product.aspx?productID=395&CategoryID=52
http://www.lynxmotion.com/images/Products/Full/ssc32.jpg
qy8flyer
Jan 04, 2006, 08:44 AM
Thanks for all the ideas guys. Can someone tell me where i can find a good introduction into PIC programing. Seems like thats the less expensive way to do what I want. I think I would have more fun building it from scratch anyway.
Dave
qy8flyer
Jan 04, 2006, 08:51 AM
There is a chance that your kitty won't really care about a carefully programmed or truly random flying feather. How about just using two servo exercisers set to different sweep rates? It seems to me that fluffy will never know you cheated on the recipe.
If you like PIC projects, then a pair of these servo testers just might be the ticket: http://www.rc-cam.com/servotst.htm
RC-CAM
From my experience with this toy so far is that the Cat really wants human interaction. Before I built this RC controlled toy I used a feather toy on the end of a wand. Its a great toy you can buy at a pet store for $5 . Again he got addicted to it and wanted to play with it all the time. if the feather flys around in a predictable motion, ie rotate or back and forth, he gets board really quick. Another idea I had was to incorporate some motion sensors that could change the motion based on the cats motion? Might seem crazy but Cats are pretty smart, he even figured out that the transmitter is what controsl the toy.
Malc C
Jan 04, 2006, 10:31 AM
Thanks for all the ideas guys. Can someone tell me where i can find a good introduction into PIC programing. Seems like thats the less expensive way to do what I want. I think I would have more fun building it from scratch anyway.
Dave
Dave,
You can get started in PIC programming for less than $25 inc a PIC chip, or you can spend $500 +, it all depends on what you want to get out of it. The cheap option would be to get one of the PIC programmers from Spark Fun (http://www.sparkfun.com/commerce/categories.php?osCsid=67b28caa17ca8f7a0db57ca8d343 ca71)
http://www.sparkfun.com/commerce/images/Main-PG2C-1.jpg
I have the PG2 programmer above which works well with the freely available WinPIC Pro or IC-PROG software and cost just $12.95 plus $3 for a 6 foot serial cable.
As for the languages, there are loads. PICs use Assembly code, and you can program direct in PIC assembly, however (at least to me) this can appear as a dark art and some of the higher level languages like JAL, PicBASIC pro, MBASIC, MikroBASIC, CHBASIC, PIC C are a better option. Each have their own good and bad points, but most find that they actually get further, and make projects that actually work (even the simple task of flashing an LED in Assembly can appear daunting !) - Some of these languages are free, others are several hundred $$ / ££ and you often get what you pay for. I would suggest spending a few days browsing the net, enter some of the above langauges in google / yahoo (sorry I'm too lazy :) ) and then take the plunge :)
Mr.RC-CAM
Jan 04, 2006, 11:11 AM
Here is a very simple PIC servo controller project that would allow you to use your PC as an intelligent host to drive several servos. Schematic, PIC Basic source code, and hex code, is from the rentron.com site: http://www.rentron.com/servo.htm
Ideally you would create a custom PC app that sent the required serial commands to the kitty teasing flying feather. The hardware looks like it would be a nice intro PIC project for someone that has never used them.
Malc C
Jan 04, 2006, 11:54 AM
Also on the same site are details on their robotic software that allows a "program" of servo movements to be sent via the PC, saved on the PC etc, which is probably more what your looking for if you are not able to write programs in VB or C++ etc
http://www.rentron.com/Robo-Ware.htm
MRP
Jan 04, 2006, 12:47 PM
Hi,
I have 2 servos , rec , battery .
One servo is on chan 1
One servo is on chan 2
How would I build a circuit that could record random stick movements and then play back ?
Thanks,
Dave
It might be worth you looking at the
"Versatile Microprocessor Based Servo Tester"
on
http://www.omegaco.demon.co.uk/mechome.htm
I believe that this will "record" your servo movements and replay them. It might give you some ideas.
Cheers
qy8flyer
Jan 04, 2006, 02:36 PM
thanks again guys, great stuff. I have been missing some great fun. Time to get into PIC programing
Dave
qy8flyer
Jan 04, 2006, 02:39 PM
It might be worth you looking at the
"Versatile Microprocessor Based Servo Tester"
on
http://www.omegaco.demon.co.uk/mechome.htm
I believe that this will "record" your servo movements and replay them. It might give you some ideas.
Cheers
This looks like its exactly what I want. looks like they ship to USA but I have to send a money order. That servo test is only 14 pounds , is that about 28 us $?
cant beat that price
MRP
Jan 04, 2006, 06:01 PM
This looks like its exactly what I want. looks like they ship to USA but I have to send a money order. That servo test is only 14 pounds , is that about 28 us $?
cant beat that price
Looks like about $25 :D (www.xe.com)
Send an e-mail to the guy - he is very helpful (I got some other stuff from him). Let us know if it works as good as it sounds.
Cheers
Mark
Mark J
Jan 04, 2006, 06:45 PM
I got one of the pic programmers after Malc recommended it to me in another thread and with the cable it came to just over £15 inc postage to the uk (not sure if your in the uk, as never noticed if you were etc)
Ive just gotten into pic programming (well, electronics as well) and its a great little bit of kit! works great :)
If you do get into pic programming, you could use a pic and create a random routine for each servo, and have it do it that way or just create a data table in the eeprom space of a pic chip (12F675 has a small eeprom space as I use it for my nav light / lipo alarm I made :D )
also on the renton site is a whole section geared towards robotics in PIC basic pro and that has sample code for servo control etc, so would be easy enough to modify for your own use etc to get servos moving etc.
Renton robot code (http://www.rentron.com/Micro-Bot/index.htm)
Malc C
Jan 04, 2006, 07:39 PM
Using JAL I played about with making a servo dance (wave its arm around)
Here is a sample code, and to be honest I'm not sure if it is fully debugged (its over a year since we tried this and was our second program, having got fed up with a flashing LED :) and I have so many versions !!)
-- Servo test program
--
-- Moves Servo arm to left, right then middle
-- pause of 1 second between moves
-- repeats sequence after 2 seconds
include f675_4i
include jlib
pin_a2_direction = output -- set GPIO 2 as an output
var bit servo is pin_a2 -- designated GPIO 2 as the signal pin
var byte servo_high -- provide multiplier (0 - 255) for servo_high
var byte servo_low -- provide multiplier (0 - 255) for servo_low
var byte i
servo = low -- turn pin 2 off
-- Values for Postion of the Servo arm - FUTABA 3001 Servo
-- Full RIGHT - servo_high = 2 , servo_low = 198
-- MIDDLE - servo_high = 12 , servo_low = 188
-- Full LEFT - servo_high = 22 , servo_low = 178
-- DONT EXCEED THESE VALUES
forever loop
-- Full RIGHT
servo_high = 2
servo_low = 198
i = 50 -- number of pulses sent to servo to give the arm time to move
while i > 0 loop
servo = high -- turn on pin 2
delay_100uS ( servo_high ) -- delay 100us * value of servo_high
servo = low -- turn off pin 2
delay_100uS ( servo_low ) -- delay 100us * value of servo_low
i = i - 1 -- decrease pulse count
end loop
delay_1s ( 1) -- wait between moves
-- FULL LEFT
servo_high = 22
servo_low = 178
i = 50 -- number of pulses sent to servo to give the arm time to move
while i > 0 loop
servo = high -- turn on pin 2
delay_100uS ( servo_high ) -- delay 100us * value of servo_high
servo = low -- turn off pin 2
delay_100uS ( servo_low ) -- delay 100us * value of servo_low
i = i - 1 -- decrease pulse count
end loop
delay_1s ( 1) -- wait between moves
-- MIDDLE
servo_high = 12
servo_low = 188
i = 50 -- number of pulses sent to servo to give the arm time to move
while i > 0 loop
servo = high -- turn on pin 2
delay_100uS ( servo_high ) -- delay 100us * value of servo_high
servo = low -- turn off pin 2
delay_100uS ( servo_low ) -- delay 100us * value of servo_low
i = i - 1 -- decrease pulse count
end loop
delay_2s ( 1) -- wait between moves
end loop
All we used was a 12F657 and I think we had more than three servos dancing with a later version. Add a 4.8v rx pack, and thats it -
vintage1
Jan 05, 2006, 06:29 AM
I think it very intersting that everyone immedialtely 'thinks PIC'. Gosh, how ever did we manage to do data recording on tape machines, before we had floppy disks?
Malc C
Jan 05, 2006, 06:44 AM
I think it very intersting that everyone immedialtely 'thinks PIC'. Gosh, how ever did we manage to do data recording on tape machines, before we had floppy disks?
Yeah.. but try and find a small tape deck in shops these days... - like hens teeth !
vintage1
Jan 05, 2006, 06:46 AM
Yeah.. but try and find a small tape deck in shops these days... - like hens teeth !
There are dozens in every scrap heap in the world, all fully working.
Acetronics
Jan 05, 2006, 08:19 AM
A happy new year to everybody ..
And why not use an ISD 10xx or 25xx chip for that ???
mmmmhhhhh ???
Alain
qy8flyer
Jan 05, 2006, 09:58 AM
Hi Vintage,
so what you are saying is that i could actually record the servos movements on audio tape? Makes sense. How do I do it exactly. Somehow the recorder mic inputs have to be inbetween the rec and the servo? Can you draw a schematic ?
Thanks,
Dave
imeins
Jan 05, 2006, 10:08 AM
There was a toy animatronic teddy bear called "Teddy Ruxpin" that used exactly Vintage's technique. It was only a single channel though with the mouth moving in time to the story on the other channel. If you've ever heard your ppm signal on a scanner or other receiver you'll notice it's just a low frequency buzz. I'd try feeding the left and right line inputs of a recorder from each servo's signal lines via a small, maybe 1uF capacitor. Then for playback, provide the servos with power and feed the signal inputs to the servos from the L/R phone outputs again via a small capacitor.
It may be a complete failure but for the cost ($1) of the parts it's worth a try.
Ingmar
decoded rx ch output -----||-------left line input of recorder
1uF
common(gnd, -) from rx -------------ground of recorder
duplicated for other channel.
qy8flyer
Jan 05, 2006, 10:17 AM
Hi,
Does it have to be analog tape, would it work if I pluged it into the mic on my PC ?
qy8flyer
Jan 05, 2006, 10:18 AM
Yeah.. but try and find a small tape deck in shops these days... - like hens teeth !
Actually , you might be right, I must have had several walkmans over the years, I will search the house and see if I can find one.
Malc C
Jan 05, 2006, 11:11 AM
I must admit I did modify an old stereo cassette tape deck once in a bid to use one track as a control track for sync pulses for triggerig a slide projector. I wired both record heads and the erase head via on/off switches so I could turn it into a twin track track recorder.
The idea was to record the narrative on one track (LH) and the "pulse" to trigger the projector on the other (RH). The only problem was both channels were in record or playback mode, so it was almost impossible to get the timing right as I couldn't modify the machine so that it played one track whilsr recording on the other.
The alternative to using a PIC or tape deck is to use an NE555 and a handful of caps and resistors to generate the 1 - 2 ms pulses to control the servo positions.
Comatose
Jan 05, 2006, 08:13 PM
Another way to have a PIC controlled servo without writing a timing loop would be to use a 555 timer and a digital capacitor.
http://afrotechmods.com/cheap/capacitor/digitalcapacitor.htm
I freely admit that its actually harder to do than doing the pulse generation in software. But if you're going to monkey around with a 555, might as well go whole hog.
MatC
Jan 06, 2006, 04:59 PM
If the tape recorder idea doesn't work (and it might not, I suspect the resolution at 50 HZ will be very bad), you might try FM encoding/decoding the two channels. Or (simpler) output/decode a 1 KHz tone rather than the straight PPM from the receiver.
PC will work better than a tape recorder (but check the voltage levels, and if you must use an electrolytic cap anywhere make sure it's non polarised). mp3 compression won't help you any ;)
But if you're prepared to use a PC, you can get rid of the whole first stage anyway: use one of many joystick->PC or transmitter->PC interfaces (or mouse) and a PC->Servo interface (could use soundcard for this too I'm guessing). Then write a C program and have hours of recordings. (Getting access to the i/o drivers will require a little research).
vBulletin® Copyright ©2000-2009, Jelsoft Enterprises Ltd.