I am creating a follow focus to record video for a project. I have come across the Arduino and think this is the best method.
What i plan to do is:
Store several manually focused positions. These positions can be selected as the video is captured, keeping the object in focus. However the distance needs to be considered so the focus interchange between positions does not happen to quickly or slowly and therefore hits the next position preset at the appropriate time.
My plan is to use a DC motor and H bridge so that the motor can move back and forth.
I will use buttons to store the points and the time delays.
I plan to use a encoder to know the exact position.
I was thinking of using a LCD to select the time between points.
The issue:
Can i store all this information on the Arduino?
Is this the best method of doing this?
As this is the first time i am using the Arduino, all help with code would be appreciated.
I was thinking of using a LCD to select the time between points.
And a switch to visualize the data?
I will use buttons to store the points and the time delays.
No zippers?
Can i store all this information on the Arduino?
Depends on how much data "all this information" is. Are we talking about 20 focus changes, or 2000? 20 is possible. 2000 isn't. Unless you add an SD card/shield.
As this is the first time i am using the Arduino, all help with code would be appreciated.
This will get you started:
// Include files go here
void setup()
{
// One time only stuff goes here
}
void loop()
{
// Called in an endless loop
}
Yeh well as time is restricted, i am thinking of using 5 positions.
the LCD i was thinking will be used with buttons one for + time and one for - time, then a third button for making a selection.
I was thinking of going a step further.
initially a potentiometer will be used to adjust the motor connected to the camera, one the desired position is achieved and selected a LED (RED) will come on to tell the user the information is selected.
then the LCD will come on and the user can select the time required for the change and another LED (red) coming on when selected.
once both have been entered a final LED (Green) will come on to notify the user that the position is stored.
ISSUE:
can i go back to alter any problems, do you think i should use the lcd to confirm selections??
As it will become a length process.
and as for zippers i am not aware of them and will now look it to them.
You begin with lots of smaller projects. Learn how to read values from the pot. Learn how to move the motor using the H-bridge. Learn how to use millis() to measure duration. Learn how to read switches (not buttons).
Eventually, you will discover that you've written stuff to do everything you want to do, just not all in one sketch. All that will be left is to combine bits and pieces of the various sketches into one sketch that does it all, in the right order, at the right time.
I have looked at the playground, however there is nothing in regards to:
forward and reverse motor control using a H bridge and a potentiometer,
position storage of the rotary encoder connected to the motor shaft
LCD number increment change and storage,
and do not have a clue how to store information and re select it again when needed with the push of buttons.
zoomkat:
It would seem that using a stepper motor would be more typical for this type of project (and probably more simple).
I think a DC motor is better as I am recording video, therefore need a smooth change of focus changes and the stepper motor is found to be unstable over small increment changes. this would effect the filming.
I think a DC motor is better as I am recording video, therefore need a smooth change of focus changes and the stepper motor is found to be unstable over small increment changes. this would effect the filming.
Well, let us know how that eventually works out for you.
I have looked at the playground, however there is nothing in regards to:
forward and reverse motor control using a H bridge and a potentiometer,
What exactly do you expect the potentiometer to control? The H-bridge allows you turn on the motor going either direction. Some motor controllers (which you are not using) allow control over the speed of the motor.
position storage of the rotary encoder connected to the motor shaft
Because this is not an atomic function. You need to first figure out how to read the rotary encoder data. Then, you need to figure out how to use the change information to determine a position. Then, you need to figure out how to store that position information wherever you deem appropriate.
LCD number increment change and storage,
Well, an LCD doesn't have any of these capabilities. LCDs are used to display data. They can not increment data. They can not decrement data. They can not store data.
The problem I think you have is that you know so little you can't see what is relevant when you look at it.
This suggests that you are better off forgetting your project for the time being until you learn a little about this subject.
What exactly do you expect the potentiometer to control? The H-bridge allows you turn on the motor going either direction. Some motor controllers (which you are not using) allow control over the speed of the motor.
I was thinking of using the potentiometer to vary the direction and speed of the motor, which is linked to the focus on the lens. once the correct focus position is achieved it can be stored.
I was thinking of using the potentiometer to vary the direction and speed of the motor,
That is no problem but it will not work because there is no absolute measurement of the position of the motor. Turning it on in a direction for say half a second gets you to different places every time you do it even it you start off at the same place. You need a stepping motor.
Just think of a know that works like you think, you could never get to the right place.
That is no problem but it will not work because there is no absolute measurement of the position of the motor. Turning it on in a direction for say half a second gets you to different places every time you do it even it you start off at the same place. You need a stepping motor.
[/quote]
To achieve the smoothness i was planning on using the DC motor and to track position the encoder on the motor shaft.
You have some way of getting an absolute location because rotary shaft encoders are only relative sensors. You can get absolute shaft encoders but these cost a lot.
Speed control is not that easy at very low speeds so you probably need something geared.
Grumpy_Mike:
2) You have some way of getting an absolute location because rotary shaft encoders are only relative sensors. You can get absolute shaft encoders but these cost a lot.
I should only really need the motor to rotate 360 degrees and was thinking of a way that I could measure the rotation and bring it back to zero
Grumpy_Mike:
3) Speed control is not that easy at very low speeds so you probably need something geared.
The speed does not need to be tremendous, I was thinking of around 6 - 8 rpm
So you say you have lots of turns to play with but then say it is restricted to one. So actually you don't have many turns at all. It is looking like you can't do this with a DC motor at all. You need a stepping motor or a servo. A servo will be restricted to 180 to 270 degrees depending on the one you get.