| View previous topic :: View next topic |
| Author |
Message |
Zeddicus
Joined: 21 May 2006 Posts: 109
|
Posted: Fri Jun 02, 2006 6:29 pm Post subject: Theory needs to be implemented and tested, help needed |
|
|
Hi,
I wrote a document about automatic control theory from the openservo point of view. It can be found at:
http://www.openservo.com/moin.cgi/Resources
I'll be updating it as I develop the equations further, more controllers/filters are added, errors are fixed, etc
However, I don't have a working openservo hardware yet, so help is needed in testing the control strategies and equations that are explained there. The following should be done at some point:
- Testing of the PID tuning procedure
- Tuning attempts of all controllers, with response graphs to step inputs
- Comparison between the PID controllers
- Testing of the current controller in as wide a range of values as possible
- Testing of the speed controller in as wide a range of values as possible
- Testing of the position controller in as wide a range of values as possible
- Testing of the triple cascade strategy in as wide a range of values as possible
- Testing of the controller sanity checks (rate limiter, value limiter for SP, antiwindup, deadband)
- Digital filter behaviour graphs (raw input vs. filtered input)
Any feedback is most welcome.
Cheers,
Zedd |
|
| Back to top |
|
 |
Zeddicus
Joined: 21 May 2006 Posts: 109
|
Posted: Mon Jun 19, 2006 7:21 am Post subject: |
|
|
Hi,
I'm trying to create a matlab model of the servo. I need values of raw PWM output and ADC input (both for current and position), all measured simultanously. The current should be measured at high speed, hopefully at a couple of KHz. I'll settle for whatever measure frequency for the position (10-100Hz?).
The data should be taken with the servo on the infamous ""torture rack"", with a weight attached, or some similar setup (robot arm?). The position should change from somewhere in [-90 : 0] to somewhere in [+45 : +85].
I don't really need the position/speed controller working, but I guess it shouldn't affect anything if it is.
Can anyone please put this together for me? A realistic matlab model can help test/tune the motion control algorithms without changing the firmware or testing over the TWI over and over again. It can also help design more sophisticated algorithms, and it's safer and easier to play around with.
When the model is realistic enough, it can be posted in the Resources section.
Cheers,
ZZZ |
|
| Back to top |
|
 |
ginge Site Admin
Joined: 14 Jan 2006 Posts: 1029 Location: Manchester, UK
|
Posted: Mon Jun 19, 2006 5:54 pm Post subject: |
|
|
Hi Zed. I didn't have much time to compile this, so hopefully someone else can add to this:-
set position from 200 to 900 (my full range)
All values are integer values converted from the 16 bit servo values
Position against velocity and current:
http://www.headfuzz.co.uk/files/openservo/servos3d.png
http://www.headfuzz.co.uk/files/openservo/servos2d.png
Some raw data.
http://www.headfuzz.co.uk/files/openservo/outdata
The last column is the pwm values read. It jump straight to 100% by the looks of it
i2c went a little funny during the return phase of the servo move - I asked it to go back to 200 after 900.
I'll add some more graphs with a bit more of a load. Looks a lot like this load didn't really make much of a difference to the current.
Barry
Last edited by ginge on Tue Jun 20, 2006 11:30 am; edited 1 time in total |
|
| Back to top |
|
 |
Zeddicus
Joined: 21 May 2006 Posts: 109
|
Posted: Mon Jun 19, 2006 6:49 pm Post subject: |
|
|
Thanks Barry,
the curves look somewhat similar to what I've been getting out of the model, so it seems my equations are not crazy. Just looking at the position and current curves helps a lot. Are you using the ""big"" servos, or one of the standard ones (i.e.: futaba/hitec)?
You're right, some of the values are funny. I plotted the raw data, and there are some strange jumps after the position reaches 900. I cleaned it up somewhat by hand, by replacing the strange values with the immediatly preceding ones. I got much smoother plots this way.
If you have more time, could you get a curve for a position change, where the pwm value doesn't just jump to saturation and back, but changes a bit slower? I'm geussing maybe a small step or something like that. Also, I could use a stabilization time after each movement command, so that the steady state convergence can be observed.
One last question: how was the speed obtained? Using a derivative, or with the estimator?
Thanks again for all this! I really appreciate it!
Z. |
|
| Back to top |
|
 |
Zeddicus
Joined: 21 May 2006 Posts: 109
|
Posted: Mon Jun 19, 2006 7:30 pm Post subject: |
|
|
The curves look quite good. The funny behaviour can actually be explained. The only thing I can't really make sense of is the PWM curve...
I'm going to try some filtering on the speed curve now. |
|
| Back to top |
|
 |
ginge Site Admin
Joined: 14 Jan 2006 Posts: 1029 Location: Manchester, UK
|
Posted: Tue Jun 20, 2006 8:17 am Post subject: |
|
|
The servo used was a Stellservo. It's a heavy duty type that was made specially for a company. It doesn't exibit too many differing characteristics from a standard servo, it's just slightly higher current, and metal geared. If you want some details, I can get somthing together.
The method used was a default OpenServo setup - PID
I left a 200ms delay after each move, but I can adjust that for a longer delay so you can see the servo settle.
Barry |
|
| Back to top |
|
 |
Zeddicus
Joined: 21 May 2006 Posts: 109
|
Posted: Wed Jun 21, 2006 10:01 pm Post subject: |
|
|
Barry,
actually, I could use more details. I've tried using the results of what you gave me, after cleaning up the values and fixing the signed/unsigned wraparound I mentioned to you, but it seems I can't really do much unless I get a better read from the PWM output. I find the values you got really strange. They don't really make much sense to me from a control point of view. I'm starting to suspect there is something wrong with them...
Cheers,
ZZZ. |
|
| Back to top |
|
 |
ginge Site Admin
Joined: 14 Jan 2006 Posts: 1029 Location: Manchester, UK
|
Posted: Wed Jun 21, 2006 10:48 pm Post subject: |
|
|
I am currenty invstigating the issue with the pwm readings. I will get some more data to you as soon as I get reliable readings.
Barry |
|
| Back to top |
|
 |
ginge Site Admin
Joined: 14 Jan 2006 Posts: 1029 Location: Manchester, UK
|
Posted: Wed Jun 21, 2006 11:29 pm Post subject: |
|
|
OK, with Mike's help I think I have cracked it. I misinterpreted the function of the registers PWM_CW and PWM_CCW, thinking they were a 16 bit values.
It turns out these are 2 8 bit registers, one for each pwm output.
I apologise for this obvious mistake, and will provide you with some real pwm values.
Barry |
|
| Back to top |
|
 |
Zeddicus
Joined: 21 May 2006 Posts: 109
|
Posted: Thu Jun 22, 2006 3:39 pm Post subject: |
|
|
Barry,
great news! For a moment there I thought I was going crazy... Just wanted to point out that both pwm values will be needed to show the complete output. It doesn't really matter to me if you get them as separate curves, I can put them together myself if needed.
Again, I'll send you the results.
Actually, now that I think of it, I can probably play around with the data I already have. I'll let you know...
Thanx!
Z. |
|
| Back to top |
|
 |
Zeddicus
Joined: 21 May 2006 Posts: 109
|
Posted: Mon Jun 26, 2006 3:58 am Post subject: |
|
|
Nope, didn't get anywhere with the data I already have. The PWM values change between 3 or 4 values, and that's it, so it's no good.
Barry, when you have time, could you get another data set for me? I think I can do a lot with this...
Cheers,
Z. |
|
| Back to top |
|
 |
ginge Site Admin
Joined: 14 Jan 2006 Posts: 1029 Location: Manchester, UK
|
Posted: Mon Jun 26, 2006 2:56 pm Post subject: |
|
|
No problem.
I recently moved all my equipment into another room, and now nothing works. As soon as I get over my total comms failure issues (probably by getting rid of my spaghetti wiring) I will get these values for you.
Barry |
|
| Back to top |
|
 |
Zeddicus
Joined: 21 May 2006 Posts: 109
|
Posted: Mon Jun 26, 2006 8:58 pm Post subject: |
|
|
Barry,
together with the dataset, I could also use the following, if possible:
-motor supply voltage
-stall current
-servo gear ratio
-weight that was attached (approximate)
-distance between the weight and the rotation axis
-data sampling frequency
I can use this to know if I'm getting sane results from my algorithms.
Thanks!
Z |
|
| Back to top |
|
 |
ginge Site Admin
Joined: 14 Jan 2006 Posts: 1029 Location: Manchester, UK
|
Posted: Mon Jun 26, 2006 11:37 pm Post subject: |
|
|
Hi Z, I hope you are ready for this, I went a little crazy with the samples for you
And the data:
http://www.headfuzz.co.uk/files/openservo/outdataextended.csv
you wanted some samples of shorter runs:-
And the data:
http://www.headfuzz.co.uk/files/openservo/outdatashort.csv
Weight on end of test rig:
15g
Weight of armature:
7.5g
Distance between the weight and the rotation axis:
135mm
Motor supply voltage:
+5V monitored
Sample frequency:
unknown, can be derived from timed speed and my samples.
move of 200-900 takes 2.20 seconds
I don't have my gear ratio, but I will see if I can calculate it for you.
Can you clarify ""Stall current"" for me?
Cheers,
Barry |
|
| Back to top |
|
 |
Zeddicus
Joined: 21 May 2006 Posts: 109
|
Posted: Tue Jun 27, 2006 12:13 am Post subject: |
|
|
This looks VERY good! Thanks, I'll check it against my current model, and run it through my algorithms.
The stall current is the motor current with the motor axis clamped. It's a bit dangerous to measure for the rated motor voltage (depending on the motor), because it could theoretically burn the motor winding. What I really need is the motor winding resistance, if you have it. Either value is ok.
What was the range of movement for this? I mean the real start/end angles.
Question: How do I show my results, without publishing the pictures/files on some weird server somewhere at the end of the universe?
I'll send you an email with what I have now anyway. It may take me a while to process the nice new shiny dataset you just got
Cheers,
Z. |
|
| Back to top |
|
 |
|