Author Topic: Measuring Step Response of Servo Motor  (Read 2124 times)

0 Members and 1 Guest are viewing this topic.

Offline MattjdTopic starter

  • Regular Contributor
  • *
  • Posts: 230
  • Country: us
Measuring Step Response of Servo Motor
« on: September 11, 2018, 02:54:58 am »
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 this

https://browndoggadgets.dozuki.com/Guide/Dual+Axis+Solar+Tracker+2.0/14?lang=en

I 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.
 

Offline JS

  • Frequent Contributor
  • **
  • Posts: 947
  • Country: ar
Re: Measuring Step Response of Servo Motor
« Reply #1 on: September 11, 2018, 03:09:39 am »
  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

If I don't know how it works, I prefer not to turn it on.
 

Offline ignator

  • Regular Contributor
  • *
  • Posts: 206
  • Country: us
Re: Measuring Step Response of Servo Motor
« Reply #2 on: September 11, 2018, 03:13:28 am »
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.
 

Offline ivaylo

  • Frequent Contributor
  • **
  • Posts: 661
  • Country: us
Re: Measuring Step Response of Servo Motor
« Reply #3 on: September 11, 2018, 06:09:50 am »
I think he does exactly what you are asking here:
https://youtu.be/th0acX5omRM
 

Offline johnwa

  • Frequent Contributor
  • **
  • Posts: 255
  • Country: au
    • loopgain.net - a few of my projects
Re: Measuring Step Response of Servo Motor
« Reply #4 on: September 11, 2018, 08:30:46 am »
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.
 

Offline MattjdTopic starter

  • Regular Contributor
  • *
  • Posts: 230
  • Country: us
Re: Measuring Step Response of Servo Motor
« Reply #5 on: September 11, 2018, 12:39:54 pm »
  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

I think he does exactly what you are asking here:
https://youtu.be/th0acX5omRM


This is exactly the sort of thing I was thinking of. Thank you!

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.

 :(

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.

I'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 where this and this. I thought u were trolling me until the saw the third result linking to a NASA paper  :-DD. What I googled specifically  "McFadden Servo Loader"
 

Offline ignator

  • Regular Contributor
  • *
  • Posts: 206
  • Country: us
Re: Measuring Step Response of Servo Motor
« Reply #6 on: September 11, 2018, 01:22:20 pm »
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.
 

Offline bob225

  • Frequent Contributor
  • **
  • Posts: 259
  • Country: gb
Re: Measuring Step Response of Servo Motor
« Reply #7 on: September 11, 2018, 01:55:03 pm »
is a rotary encoder to simple ? a optical sensor with a wheel or even a hall effect sensor ?
 

Offline Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 3365
  • Country: nl
Re: Measuring Step Response of Servo Motor
« Reply #8 on: September 11, 2018, 02:39:07 pm »
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 WDD35D4 https://www.aliexpress.com/wholesale?SearchText=WDD35D4
These 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.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf