How to Control a DC Linear Actuator using input from an optical incremental encoder with Arduino?

I have searched the internet, searched multiple forums, and even taken courses in programing the Arduino. I have found detailed videos of controlling servos with an encoder, and controlling a dc motor with an encoder. Unfortunately I have not been able to find any information that specifically deals with the application I am trying to program. I am trying to take input from an independent incremental optical rotary encoder, one not attached to a motor, and use it with the Arduino uno and a motor controller to control a DC linear actuator. I am using this setup to control the trim system on a flight simulator I am building. When the trim is actuated on my simulator, whether manually or electrically, the shaft attached to the rotary encoder will turn causing the encoder to spin. It will either spin clockwise or counter clockwise depending on the direction the trim is being adjusted. I want to use this input to activate the linear actuator to either extend or retract based on the clockwise or counter clockwise movement of the encoder. When the encoder stops moving, the linear actuator needs to stop as well. The speed the encoder will spin will be at a low and high speed and a variable speed if trim is adjusted manually. The video I saw that was helpful was using an encoder to control a servo. But I can't use a servo in this application as a servo is not powerful enough. I am using actual control columns and rudder pedals from a Boeing 737 to build my simulator. I am using a DC Linear Actuator and springs to simulate changes in control forces similar to what an actual plane experiences in changing flight configurations. When the aircraft needs to be trimmed to alleviate control forces on the flight controls the trim is activated either manually or electrically which turns the trim wheels this turns a shaft which is attached to the incremental optical encoder. I wish to take the input from the encoder and use it to activate a DC linear actuator to extend, stop, or retract based upon clockwise, stationary, or counter clockwise movement of the encoder. The extension or retraction of the actuator increases or decreases forces acting on the flight controls. I appreciate any help you can provide. I hope this is enough information to start to get some assistance in solving my problem. Thanks.

Help others help you, by reading and following the instructions in the "How to get the best out of this forum" post, linked at the head of every forum topic.

We need to see code, posted properly with code tags, links to the components and explicit descriptions of the problems you want to solve.

Hello
TL;DR

Lookup these three coding items:

  • rotary encoder, home position
  • DC motor
  • PID controller
    You'll find any number of projects with these items. The final determination of the PID parameters to control the linear actuator depend on your setup and skills.

Watching videos can not replace making your hands dirty with own practical experiments and work. Start somewhere and come back with special questions.

Too many words giving too little of facts and information.

Learn to write non-blocking code and you can write effectively parallel running sketches that share global variables.

Do you know how video is FPS for Frames Per Second? An Arduino sketch can run at Frames Per Millisecond keeping steps short.

If you can write each part using delay and blocking text, I'll get you through converting each part into code that combines with other non-blocking code.

Beginner level tutorial on Arduino timing to get started on square 1.

Did you want to control the POSITION of the linear actuator or just the SPEED? If you want POSITION control your actuator will need a feedback sensor.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.