using the Prop to create visual arrays for animatronics
Darcy
Posts: 31
Hey there, fellow propeller noob, and I am working on an animatronic project where the movements will be controlled by pneumatic cylinders hooked up to a solenoid valve, so it is a simple on/off function.
I need to know how to get the propeller to read through a pattern, and to repeat that pattern once it gets to the end. I'm hoping to construct the code so it will have an easy to edit visual display, so that you can see how the valves will be triggered in relation to one another.
i'm assuming the code could look something like this:
Larm = %11001100110011001100110011001100
rarm = %00110011001100110011001100110011
tails = %00001111000011110000111100001111
bdup = %00000111111000011111100001111100
eyes = %00001111100110000111100110000111
mout = %00001111000000001111000000111100
sond = %00000011000000000111000000011100
by listing it in this format, i would be able to tell how the left and right arm would work together, i would be able to trigger the mouth to open before the audio goes off so it looks more natural, etc...
I know that i'm still early in my hunt for the proper code, but i wanted to see if you knew how to make a pinout cycle through this sequence, and then return to the beginning and repeat once it gets to the end of the code. I would adjust the timing of how quickly it goes through the cycle with the waitcnt(clkfreq + cnt)
i've typed up several pseudo codes, i just havent been able to get it to repeat one of these patterns.
any suggestions would be really beneficial for my quest.
I need to know how to get the propeller to read through a pattern, and to repeat that pattern once it gets to the end. I'm hoping to construct the code so it will have an easy to edit visual display, so that you can see how the valves will be triggered in relation to one another.
i'm assuming the code could look something like this:
Larm = %11001100110011001100110011001100
rarm = %00110011001100110011001100110011
tails = %00001111000011110000111100001111
bdup = %00000111111000011111100001111100
eyes = %00001111100110000111100110000111
mout = %00001111000000001111000000111100
sond = %00000011000000000111000000011100
by listing it in this format, i would be able to tell how the left and right arm would work together, i would be able to trigger the mouth to open before the audio goes off so it looks more natural, etc...
I know that i'm still early in my hunt for the proper code, but i wanted to see if you knew how to make a pinout cycle through this sequence, and then return to the beginning and repeat once it gets to the end of the code. I would adjust the timing of how quickly it goes through the cycle with the waitcnt(clkfreq + cnt)
i've typed up several pseudo codes, i just havent been able to get it to repeat one of these patterns.
any suggestions would be really beneficial for my quest.
Comments
Is 1/10second control precise enough?
Say 1/10th is OK,
Using 1 long and 'ROL wc' it, you would only have 3.2seconds before it restarts.
With 4 longs and you get 12.8 secoinds.
Nice thing is that you have RCL.
TEST larm,_mybit31 wc ' needed as we need to set intial c status
RCL larm+3,#1 wc
RCL larm+2,#1 wc
RCL larm+1,#1 wc
RCL larm,#1 wc
MUXC outa,_larmpin
_larmpin long 1<<12 ' pin 12 for an expample.
_mybit31 long 1<<31
larm long %00000000_00001001_00011100_11111000, %00000000_00001111_00011100_11111000, %00000000_00001111_00011100_11111000, %00000000_00001111_00011100_11111000
rarm long %00110000_00001111_00011100_11111000, %00000000_00001100_00011100_11111000, %00000000_00000011_00011100_10011000, %00000000_00001111_00011100_11001000
It's easy to see how the left and right arm relate when all the data are aligned underneath each other. (resize windows explore max sideways)
This could be adapted to be run from an SD card for very long sequences. I suggest any software you're working on export a DAT section like the ones in my program -- at least until you get a handle on this and develop your own strategy.
The program will run on a demo board or QuickStart as is.
[ EDIT ] I simplified the interface to make the code easier to use.
http://forums.parallax.com/showthread.php?123900-EFX-TEK-shows-the-Propeller-AP-16-WAV-Audio-Player-at-Parallax-wow!&highlight=ap16
www.firefallthegame.com
The game company was so happy to have a programmer involved (this is not the norm for these things) and and audio board (AP-16+) that could support their desires, that they sent me a bunch of audio assets from the game to be incorporated into the display. The first display went to China, a second is under construction now (it will go to Seattle).
I was working in a company that developed machines that used pneumatic cylinders a lot. For slow and smooth motion that starts instantly after opening the valve
it is very common to use exhaust air throttles. These throttles reduce air-flow only in one direction. They were inserted on both sides of the two-way-cylinders.
valve-ou1-throttle1-cylinder-throttle2-valve-out2. Opening valvle-ou1 drives the piston out. Opening valvle-out2 drives the piston back in.
Now if valve-out1 opens throttle1 will let in the air without resistance. as the cylinders moves air goes out at the opposite. for air coming from the cylinder and then going into throttle2
there is an adjustable resistance for the air. This combines two advantages: The air that goes into the cylinder can be at high pressure filling up the cylinder very fast. The movement is still
slow and smoothly because of throttle2 and the speed is constant as the mechanical friction of the piston is low compared to the force created by the high pressure.
If you use a low pressure or only one throttle on the side where the air goes in the piston will move and stop move and stop because compared to the low pressure the piston-friction
is high.
best regards
Stefan
I have some adjustable one-way restrictors on both sides of the pneumatic valve to slow down the cylinder movement, similar to what you have described, so we'll visually tweak the air pressure as needed to create a more realistic movement
12Blocks lets you change parameters while your program is running.
Just type a new value for the parameter (like a servos position) and the next time the block is executed it'll use that value.
A while back I heard from a customer who was programming animatronic owls with 12Blocks. A bunch of servos controlled the owl's movements, he stubbed out a program to control the servos and then he adjusted the exact position of each servo while the program was running. Taking out the need to recompile/load made him more productive. And by not needing to remember spin vocabulary/syntax/grammar he could focus on other things- like owl mechanics
Hanno
Yes, i've been working with the code that you provided, thanks so much for your input. I'm still rather new to working with the propeller, so i'm experimenting with trying to manipulate the code you provided. I'm still a novice though so i'm working with a lot of trial and error on my part.
Nope, it's setup for pure digital outputs (hence the name "bit player" -- just what you asked for.
That said, it would be easy to create a servo-player cog (would require a servo driver -- I have a really good one that I just used in my Nuts & Volts column), so you end put using two cogs for servo control. Still, you could have a cool little show controller with a main cog calling the bit outputs and the servo outputs at the same time; four cogs and cool show control -- though there is a small matter of programming (no WYSIWYG/GUI programming) on your part.