I am working on a project where a process is to be automated.
What I want to do is have a compressed air gun move horizontally in a sinusoidal motion for 5 seconds one way and then return in 5 seconds.
Other features I want to control include, but aren't as important: turning on/off the compressed air supply rather than physically moving a lever; have some sort of ability to sense if there is an object to be blasted with air; and operation to be controlled by a button.
I have very little background in programming, but if the first idea (sinusoidal motion) is possible, then I'd be open to suggestions.
Thanks
There is a [u]sin()[/u] function and a couple of timing functions. Note that the angle is given in radians.
However, there is no true analog output and you'd have to figure-out how to control a stepper motor or a servo motor. (A servo is easier if you want angular motion and if you don't need to rotate 360 degrees.)
You'll need driver circuit to provide the voltage & current for a stepper motor and for the air solenoid if you are going to turn the air on & off. (Servos have the driver built-in so they just need a power supply and a timing signal from the Arduino.)
What I want to do is have a compressed air gun move horizontally in a sinusoidal motion...
I'm not really visualizing what you're trying to do, but that could possibly be done mechanically with a cam.
From what you've told us, I'd say the Arduino can handle it and the programming is the easiest part. That is, if you had a a programmer, an electrical engineer, and a mechanical engineer, the programmer would have the easiest job. Of course if your skills are more electrical or mechanical, that could be switched-around.
With arduino level hardware & programming one can control several axis CNC mills and 3D printers with quite complex trajectories.
But you are not specific that makes is hard to figure out what you actually want.
if the movement is horizontal I don't see where is the sinusoidal (oscillating) component. Vertical ? Horizontal too (back-forth)? The one-axis speed value varies sinusoidally?
what is the sinusoidal component's period or frequency? you only mentioned the movement takes 5 seconds in one direction and 5 the opposite direction.
With arduino level hardware & programming one can control several axis CNC mills and 3D printers with quite complex trajectories.
good to know
But you are not specific that makes is hard to figure out what you actually want.
oh, sorry
if the movement is horizontal I don't see where is the sinusoidal (oscillating) component. Vertical ? Horizontal too (back-forth)? The one-axis speed value varies sinusoidally?
The air gun would simply move left and right as if going up and down hills, like a sine wave. I'm not doing anything crazy. Hold your right hand out and move it left to right while making a sin wave and after 5 seconds, go right to left. That's what I want the air gun to do. The speed would be constant; it shouldn't speed up or slow down at all.
what is the sinusoidal component's period or frequency? you only mentioned the movement takes 5 seconds in one direction and 5 the opposite direction.
I'm not sure what the component's period or frequency would be; I am not at that stage. Maybe it should take 5 seconds to go from zero to 2pi.
I'm visualizing a paintball gun on a gantry, blot-plotting a sin wave onto a target.
You need to know:
How far do you want to travel in 5 seconds? 1 ft in 5 seconds is very slow. 10 feet in 5 seconds is much faster. Speed matters... your motor (assuming a stepper) can only move so fast before you have to worry about missed steps, etc.
What is the amplitude of your sine wave? Could be a dumb question, but basically you should consider your scale. Movement over a large area will require larger steppers (more cost) if you want to maintain that kind of speed.
I would think it's a simple program. Set one stepper to drive your X-axis. Make it move from Zero to EndStop, then back again with a simple loop. Set the other stepper to the Z-axis, and have it move based on sin(angle)*scalefactor. Trigger your paintball gun (air gun) at whatever discreet point you want... say every 1/100th of your total scale. Or, just send a high signal to your flow solenoid to keep it on the whole time (if you're using an air gun).
You're essentially creating a CNC machine. You can find all kinds of inspiration with the RepRap stuff, or the GRBL Shield stuff. Search DIY CNC and your possibilities are endless.
You could make it a real challenge by doing "polar" coordinates... instead of a linear X-axis, put it on a gimbal which gives you rotation. You'll set two angles... one for the horizontal direction, and the other for the vertical direction. This would be a much more compact set up, requiring a much smaller footprint. And the stepper / movement mechanical elements would be much simpler, in my humble opinion. If you do this, I'd be interested to see the end result. There may be some garage tinkerers interested in setting up a life-scale Portal turret or something similar ;).
Or! Let's go nuts...
Build a system which tracks a line you draw on a wall, and blot-plots over the line using whatever air-propelled marker you choose (paintball, etc.).
Someone already did something similar: check this out!
Why a sin wave?
It sort of sounds like the kind of industrial machine where you are trying to separate chunks from a stream. Like picking all the red Smarties (M&M's) out of a falling curtain of candy. That's usually done with fixed nozzles and a sensor array just a small distance above the nozzles. The wanted chunk triggers a sensor and by the time the air solenoid has opened, it has fallen in front of the jet.
It can be a cos wave too. Or zigzag. Just not straight line
well, you got the point. move a blower of air (or spray paint) of unspecified size and weight, on a vertical wall, from an unspecified distance, with undefined X-Y dimensions and undefined variable speed and directions.
Yes can be done with an arduino and additional equipment that can't be specified before the above unspecified values are specified.
blimpyway:
well, you got the point. move a blower of air (or spray paint) of unspecified size and weight, on a vertical wall, from an unspecified distance, with undefined X-Y dimensions and undefined variable speed and directions.
Yes can be done with an arduino and additional equipment that can't be specified before the above unspecified values are specified.
is there a specific number of unspecified things that can’t be specified before the unspecified values are specified ?