Servo motor interface - Page 1
Forum section: electronics / projects

author: akis
author_rank: Frequent Contributor
timestamp: March 05, 2020, 09:25:35 pm
content: Quick question, for a small project. There is a servo motor receiving input through a 3 pin connector. The motor seems to be able to turn 180 degrees. One wire must be ground, another must be 5V, and I am not sure about the third wire. Is it a linear voltage from 0 to 5 V ? I have only seen photos at this stage so cannot put my hands on it. It is a remote control like they use for model planes, a "receiver" unit with a lot of pins to connect to things like "flaps", "gear", "throttle" etc. The servo motor is connected to the receiver unit.

author: FenTiger
author_rank: Regular Contributor
timestamp: March 05, 2020, 09:44:48 pm
content: Usually they're pulse width modulated.http://smartmicrocontroller.com/how-to-control-a-servo-using-pulse-width-modulation-pwm/

author: akis
author_rank: Frequent Contributor
timestamp: March 06, 2020, 09:50:11 am
content: OK, thanks I will look at the Arduino's built in PWM pins, I know there are some pins at 900Hz and some at 470Hz. If it is a single pulse we need I presume we need to toggle the output pins manually? There is also a servo library I need to take a look at.

author: FenTiger
author_rank: Regular Contributor
timestamp: March 06, 2020, 09:57:03 am
content: No, it's a repeating pulse train. I'd be surprised if you can't drive one from an Arduino PWM pin. Check the frequency, though - these servos want a repetition rate of about 50 Hz or so.

author: beanflying
author_rank: Super Contributor
timestamp: March 06, 2020, 10:21:19 am
content: Without a picture or more info it is a bit hard? Sounds like you have a very typical model servo they are typically +- 60 degrees of travel from a nominal center point for a 1-2mS variable pulse with a center at 1.5mS. Depending on the servo you can drive them outside those limits and toward the 270-300 degree limit of the potentiometer that senses the position. However watch out for mechanical stops on the gear train lest you break somethingThe Arduino library you want is herehttps://www.arduino.cc/en/reference/servoif you want a simple option or even a 555 timer can be made work if you likehttp://hades.mech.northwestern.edu/index.php/555_Servo_Circuitorhttps://www.instructables.com/id/Drive-Servos-with-a-555-timer-IC/

author: akis
author_rank: Frequent Contributor
timestamp: March 06, 2020, 10:30:57 am
content: It is a remote controlled "robot" project my son is doing at uni with a group... They have been given a ready made PCB consisting of a few power resistors and a servo to allow some sort of contact to wipe over the raw PCB copper tracks and provide voltage to the wheel's motor, reverse and forward, full speed and half speed. I find the idea of a servo motor being used as a wiper similar to the mechanical distributor in older cars, with crudely made contacts (wires, solder blobs, graphite brushes) wiping over the copper tracks and getting caught and worn over the gaps...So I thought why not have a little arduino board that will connect to the RF receiver and intercept the 3 wires destined for the servo motor, I presume it only needs to use GND and Signal, no need for the 5V line, and then the arduino will read and interpret the requested position and based on that it will drive a couple of relays (or SSRs) to power the wheel's motor.

author: beanflying
author_rank: Super Contributor
timestamp: March 06, 2020, 10:44:11 am
content: Yep way back in the dim dark past of R/C cars and even some of the very early electric aircraft I flew Servos to a Fat Potentiometer or a couple of resistors were used for crude speed control. Generally it will be a positive pulse relative to ground and the +5V is for driving the circuit and supplying power to the motor.SSR? Generally most Robots will be DC powered so a FET/FETS are the normal options for speed control. One of the issues if you try a DIY you will run into is blowing the stuffing out of your fets on change of direction with back EMF so you want to allow some time or even look at braking to a halt or making sure you allow some time between.Given the cost of buying one off the shelfhttps://hobbyking.com/en_us/quicrun-wp-1625-brushed.html?queryID=790fd5ecf79c28f26a51e727649399b6&objectID=62437&indexName=hbk_live_magento_en_us_productsORhttps://hobbyking.com/en_us/hobbyking-x-car-45a-brushed-car-esc.htmlI wouldn't spend my time or effort on it but if you do

author: akis
author_rank: Frequent Contributor
timestamp: March 06, 2020, 11:40:25 am
content: Thanks!So in the photohttps://hobbyking.com/en_us/quicrun-wp-1625-brushed.html?queryID=790fd5ecf79c28f26a51e727649399b6&objectID=62437&indexName=hbk_live_magento_en_us_products&___store=en_usDo I assume:Red/Black is battery power to the motorBlue/Yellow connects to the motorWhite/Red/Black triad connects to RF receiverAm I understanding this right?

author: beanflying
author_rank: Super Contributor
timestamp: March 06, 2020, 11:52:21 am
content: The Manualhttps://cdn-global-hk.hobbyking.com/media/file/q/u/quicrun25a-116058.pdfIt is what is called a BEC (Battery Eliminator Circuit, historically a separate pack was used for the Servos and Receiver power) type that is the receiver draws power from the main pack via a 5V regulator which is fed to it by the thin triple cable. The corresponding signal to control the ESC (Electronic Speed Control) will be the white one of those three back from the receiver. The main power wires are shown in the instructions.