Measuring Step Response of Servo Motor - Page 1
Forum section: electronics / beginners

author: Mattjd
author_rank: Regular Contributor
timestamp: September 11, 2018, 02:54:58 am
content: So I took a controls class and learned all the math and stuff about implemented an analog PID controller. I had a final project which was to move adjust a mount that held a small solar panel such that it had the greatest light incidence. We have photoresistors to measure the light levels, 4 of them, and moved the mount in two directions using servo motors.Now the servo motors worked by sending PWM signals to them with a period of 20ms. Easy enough to implement on a micro.The process I went through with completing that project was nothing like I had ever done in the class and it was fairly frustrating. In class, we had a system, and its step response. We then did all the math to develop a PID controller to give the desired settling time and %OS. What I did in reality was not that, and felt like hackery.Ive read things of people measuring the response of their system and then uploading it to matlab and using simulink/control toolbox to get the right values of Kp,Ki,Kd and then converted it to appropriate values in Z domain and implement a digital PID controller. That is what I would like to do, but I am at a loss of how I would measure the step response of my system.The system was as in thishttps://browndoggadgets.dozuki.com/Guide/Dual+Axis+Solar+Tracker+2.0/14?lang=enI purchased the wood from them, and I used photoresistors just as them. The opposite is that I used an msp430 instead of an andruino. So my question is, for that system, how would I measure its step response in 1 axis? If that is even possible? Or is there some kind of mathematical model (a transfer function if you will) for a servo motor driven by a pwm that I am unaware of.

author: JS
author_rank: Frequent Contributor
timestamp: September 11, 2018, 03:09:39 am
content: For that application you need quite slow response! An over dampened system is better than a well calibrated PID, so I'd suggest to leave the D aside and use a PI control for this, with slow response, with little gain on the integrator with saturation and a LPF at the output making the changes slow enough.If you like you can measure the step response, make a simple program with a uC to change the position from 25% to 75% and measure the position. One way to measure the position could be tapping into the servo potentiometer and read the position from there.JS

author: ignator
author_rank: Regular Contributor
timestamp: September 11, 2018, 03:13:28 am
content: When I started my avionics career in an autopilot group, one of the first tasks they gave me was to perform a servo oscillatory analysis. I used the analog H bridge of the autopilot servo amplifier, and drove this with a function generator (square wave). The motor was loaded with what was a purchased device called a McFadden servo loader. I had the loader simulate a spring load that would drive into the torque limit of the test servo.I made a Bode plot of frequency vs peak angular displacement of the servo shaft.Is there a way that you can drive your system with a command signal that sweeps frequency. I understand you want to know step response. If you plot the motor shaft angle vs frequency (square wave drive), I think you can determine step response of this.The servo amplifier used for auto pilots are torque limiting, so in our case it was a transconductance amplifier, where I could set different current limits with a programming resistor.My test report was a set of curves for various current limits.The end intent was to give this to the end customer installing our servo in their aircraft, and they did an oscillatory analysis to see if under the event of failure, the aircraft would not be broken.

author: ivaylo
author_rank: Frequent Contributor
timestamp: September 11, 2018, 06:09:50 am
content: I think he does exactly what you are asking here:https://youtu.be/th0acX5omRM

author: johnwa
author_rank: Frequent Contributor
timestamp: September 11, 2018, 08:30:46 am
content: The class you took is probably called something like "Linear Control Systems". Well, unfortunately, in the real world, things are usually nonlinear, sometimes quite significantly so. Backlash and static friction are major causes of this, and conventional control theory is not always that helpful. So don't feel too bad if you end up with a bit of an ad-hack solution. Sometimes, just adding a bit of a deadband is enough to get things to work acceptably.

author: Mattjd
author_rank: Regular Contributor
timestamp: September 11, 2018, 12:39:54 pm
content: Quote from: JS on September 11, 2018, 03:09:39 amQuote from: ivaylo on September 11, 2018, 06:09:50 amThis is exactly the sort of thing I was thinking of. Thank you!Quote from: johnwa on September 11, 2018, 08:30:46 amQuote from: ignator on September 11, 2018, 03:13:28 amI'd have to look into it, but the video that Ivaylo posted, talks about this. So thank you!Additionally, when I was looking up the McFadden Servo Loader, the first two hits on google wherethisandthis. I thought u were trolling me until the saw the third result linking to a NASA paper. What I googled specifically "McFadden Servo Loader"

author: ignator
author_rank: Regular Contributor
timestamp: September 11, 2018, 01:22:20 pm
content: The McFadden Servo Loader that I used was in a simulation lab. It's original use was for a cockpit layout, where it backdrived the pilots wheel, and was a 3 axis machine. The aircraft was simulated with an antique analog computer, which manufactures name I do not remember. This was back in 1984. It was a huge console, as 3 axis of the aircraft was simulated.I see that McFadden is attached to guns, which I never knew about.

author: bob225
author_rank: Frequent Contributor
timestamp: September 11, 2018, 01:55:03 pm
content: is a rotary encoder to simple ? a optical sensor with a wheel or even a hall effect sensor ?

author: Doctorandus_P
author_rank: Super Contributor
timestamp: September 11, 2018, 02:39:07 pm
content: A rotary encoder would be one of the easier ways to measure motor speed.Often these are used as a simple counter, and count pulses in a fixed time interval to determine speed.Adequate in a lot of situations, but this gives a relatively low resolution with cheap encoders.In "industry" encoders with 1000 or or more lines are often used to overcome this.(These are even reasonably priced on Ali / Ebay / China nowaday's, though the 400 pulses/rev. are more common).Another way is however to simple measure the pulse widht of each pulse.You seem to be familiar with uC's. and setting up a hardware timer to measure pulsewith, and then send those to a pc for further analysis should be a fun afternoon project.Alternatively you can use a potentiometer for feedback measurement.For example the WDD35D4https://www.aliexpress.com/wholesale?SearchText=WDD35D4These potentiometers are capable of continuous rotation and they are not the cheapest (Around USD12), but their quality warrants the price.They have ball bearings in the axle, are nicely calibrated (To different tolerances) and should have a service live of millions of rotations.