📜 ⬆️ ⬇️

Remote Follow Focus on Arduino

Once I decided to make a remote follow focus for my camera. This is a system that allows you to focus the lens from a certain distance. Thus, the camera can be located on a crane, a steadicam or on the shoulder of the operator, and the operator of the focus (focus puller) can turn the focus ring on the lens remotely. The idea was born by itself when I watched what can be done with the help of Arduino.



When all the components arrived, I proceeded to build the prototype. For this project I used:
  1. Arduino Duemilanove and Arduino Uno (different only because they were bought at intervals of several years)
  2. 2 nRF24L01 + transceivers
  3. Servo machine
  4. Cogwheel (0.8 pitch)
  5. MaxSonar EZ0
  6. 7-Segment Serial Display
  7. 10k variable resistor
  8. 2 voltage regulators 3.3V
  9. Several capacitors and resistors to stabilize the power supply according to the specifications of the voltage regulator and sonar
  10. Development boards, loops, connectors, shrinking, wires, miscellaneous
With subsequent assembly into the case, I plan to use the Arduino Nano. This version is substantially less than Duemilanove and Uno. The only disadvantage of this board is that it does not give out 3.3V if it is not powered via USB. That is why I added a voltage regulator to my prototype board.


')
Transmitter (control unit)


Receiver (performing unit)


The task involves two blocks - the transmitter and receiver. The transmitter reads the readings of the variable resistor, smoothes them and sends them by radio to the receiver. The receiver accepts a packet with the position of the resistor knob and rotates the servo proportionally to this value.

I was lucky and nRF24L01 + are able to communicate in two-way mode. So I also installed the MaxSonar EZ0 ultrasonic rangefinder on the “receiver”. It measures the distance to the object in front of the camera and this figure “receiver” sends to the “transmitter” - to the control unit. There, this figure is displayed on a 7-segment display. She is supposed to help a person manage the focus. For example, you can apply a scale around the handle so that you can focus on the numbers.

Development board and module with nRF24L01 +


MaxSonar EZ0


The reverse side of one of the development boards


In the process of working on this project, I encountered many different problems. But almost all of them managed to heroically overcome.

Here are some of them:
  1. Floating value analog input. For some reason, at the input from the resistor, I get a very large variation in values ​​at the moment when the handle is not spinning. I solved the problem programmatically - averaging the values ​​and doing a few more tricks. In general, the problem is almost solved. I'll try another resistor. The current seems to be older than me.
  2. Low positioning accuracy servos. The default documentation suggests positioning the servo with an accuracy of 1 degree. For me this was not enough. Improved the situation with the writeMicroseconds function. It allows you to more accurately rotate the gear.
  3. Receivers did not start immediately. The problem was in the pinout on the page with the documentation. I found another page in the network with a working pinout and the radio was working.
  4. Servo works jerky when using the serial port in the program. Apparently, interrupts interfere with its timing. And the most convenient data from MaxSonar was to take it out via the serial port. I had to completely rewrite the program to interrupt and use PWM output. From the analogue output, the distance was bad.
  5. PWM output at MaxSonar is not stable. There is a spread of values. But so far it is not critical for me. I plan to solve this problem more radically in the future. I still do not know how.
  6. The 7-segment display has managed to flip itself to another baud rate. I thought for two days that it just burned out. But then I thought of double-checking at all baud rate and saw that he was still a worker. In general, it does not work very stable. Perhaps due to the fact that I use SoftwareSerial. Or due to the fact that the frequency generators for him and for Arduino are different.
Next, I plan to switch to Arduino Nano to save space, place the circuits in the case, solve the power issue (there will be a LiPo battery and charge from Mini USB), replace the servo, make a mount for the servo from the aluminum corner and not from polymorphic plastic. And, of course, conduct field trials. I hope that something will come out of this. Do not switch.

Source: https://habr.com/ru/post/139385/


All Articles