Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

2 axis servomotor control

Status
Not open for further replies.

Mithrandir2008

New Member
Hi all!

It's been a while since I posted here.

I'm working on this project which involves controlling a antenna with a 2 axis servo motor. Practical considerations aside(I still don't have the actual values like weight of antenna etc. will probably get them next week so I'll update then), I've decided to model it first using MATLAB.

Thing is, I'm not very good at it. Using simulink, I managed to model the motor transfer function, from which I got the direct output in terms of radians. I'm comparing this with a reference signal(Will have to modify this as the desired position will depend on the signal recieved from the antenna).

Then, from the error generated, I would like to use a PWM block to control the servo.

Now here's the problem. I have NO idea how to model a PWM in MATLAB6. So any help here would be much appreciated.

There is also another issue here. When using a PWM controller there are 2 schemes which come to my mind either,

a) If the error is positive or negative (Reference-Actual) the servo rotates by a fixed amount, say 2 degrees(fixed pulse width), direction depending on +/- and waits for the next change

OR

b) The PWM generates a signal based on the error (variable pulse width)


The second may be faster but I'm unsure of the stability aspect. Time is not an issue here and preference is given to stability.

Thanks a Lot!

P.S: For the 2 axis part, the same system repeated twice will suffice hopefully.
 
Just curious ..... Why do you think PWM will be advantageous?
Why can't you just use the error voltage, as a control signal, as an input to a power amplifier, going to the servo-motor? ....
What specific type of motors do you intend to use?
 
Last edited:
Actually I've had that doubt too but I heard(not sure) that PWM control is much more reliable and has lesser chances of instability. Not very sure though..:)
 
I think a lot of the stability issue has to do with the control algorithm design.
When you have a mass, or inertia ... in the case of rotation, you inherently have something called a double pole at zero. ... Left uncorrected, this would be a basic cause of instability.

However, with some effort, you can shift the operating point of the locus to a more advantageous, or rapid response, and stable condition. Generally, this modification involves inserting a correction filter in the transfer function.

If you haven't seen this, look up something called root locus design.
 
Last edited:
Yes actually I've done that before root-locus design is part of our syllabus as such...

Thing is I wanted slower movement of the antenna and hence preferred the degree-by-degree variation to slow continuous motion. It's a mattter of preference actually:p

This is the (badly) designed circuit. I am getting oscillations and I know why.

The switch does not have a final "settled" position. I am unable to figure it out so any experienced MATLAB users please help!

Fig1 is a picture of Scope output. It should be at 90 degree but it oscillates due to previously mentioned problem.
 

Attachments

  • Test1.jpg
    Test1.jpg
    40.5 KB · Views: 397
  • Fig1.jpg
    Fig1.jpg
    112.4 KB · Views: 243
Last edited:
Yes actually I've done that before root-locus design is part of our syllabus as such...

Thing is I wanted slower movement of the antenna and hence preferred the degree-by-degree variation to slow continuous motion. It's a mattter of preference actually:p

This is the (badly) designed circuit. I am getting oscillations and I know why.

The switch does not have a final "settled" position. I am unable to figure it out so any experienced MATLAB users please help!

Fig1 is a picture of Scope output. It should be at 90 degree but it oscillates due to previously mentioned problem.


Are you going to do this project in reality or just trying to simulate in MATLAB ? .... If you really want to do this in practical...there is no need to fiddle with MATLAB.... , in that case stepper motor would be right option...
 
Unfortunately, the organization which I am working with will not provide me with the necessary materials(They are a bit expensive as it is large scale).

This is for my final year project actually and they just want me to simulate it as close to reality as possible.

Of course I still donot have any sort of information on the weights etc. as mentioned before, but I will get them soon.

Once I model the basic working control loop, I will probably have to see what real parts to use to substitute for it.

On another note, I have absolutely no idea on communication(I'm a pure electrical/power) student. So any help on how an antenna can tell how much the error is by the recieved signal will really be useful. Sorry if I am being unclear on this, but I really have no idea:eek::confused:
 
Just looking at the factors of the denominator, the partial fraction expansion seems to give a constant term, and also a quadratic term. Apparently, the quadratic term is the source of the oscillation. You might take a look at the components of the quadratic term, and see if by changing component values, you can generate real roots, as opposed to the imaginary pair... That is, without adversely changing anything else.
 
@User88

Well I can't change that block, it's actually the standard transfer function of a DC motor. I see what you mean though, but since I don't have the practical values yet, I wont tinker with it.

The main problem lies in the switch design. It works fine till 90 degree is reached, however I don't have the option to make it 0 volts at that point. Hence it rotates a little more till a negative error is reached and it switches to -50v and it rotates backwards.

Any idea how to modify the switch diagram?

Although mind you this is completely ignoring the original plan of PWM control!
 
Last edited:
You might be right about modifying anything within the servo block.
It may be that all the circuit requires is a slightly greater damping coefficient... to reduce the oscillation amplitude.
... Not quite sure how to add damping to the oscillation, and nothing else though.

Let me rephrase that ... back up a step ....

The non-decaying oscillation is the characteristic that you would see when you have a classic double pole at zero. If this is in fact what you are seeing in your output plot, then to compensate, you will have to place an appropriate compensator in the control loop... I think that would be a lead compensator. The idea is to attract the root locus path to the left ... which is the stable quadrant of the plane. ...

If you can provide some data values, things might look a little more definite ... precipitate out.
 
Last edited:
@Rajneesh

I dont really have the option of using a stepper motor here as it's not really preffered for smooth motion and large loads. Thanks for the idea though!


@User88

Sorry if I am repeating myself, but the problem lies in the switch design.

The condition for switch is if U>0 then +50v is applied and if U<0 -50v is applied. Where U is error in degrees.

Hence I gave only 2 states either it moves forward or it moves backward. What I really need is a 3rd state i.e at say -2<U<2 the applied voltage is zero. I cant seem to find a block which specifies that.
 
Last edited:
I would use a DC gearmotor with a high gear ratio, something like a windscreen wiper motor works well on a budget. Then put a potentiometer on the output shaft and rotate the motor slowly until the pot reads that it is in the correct position.

Antenna's don't need to be moved fast (actually fast is bad) so you won't need PID or anything complex like you would for moving fast loads or variable loads. Turn the motors slow, stop when they are correct. Add in a proportional factor if you must but it's probably not needed. Most of the electric-aligning satellite dishes just use a small DC constant speed motor with a lot of gearing.
 
I would use a DC gearmotor with a high gear ratio, something like a windscreen wiper motor works well on a budget. Then put a potentiometer on the output shaft and rotate the motor slowly until the pot reads that it is in the correct position.

Antenna's don't need to be moved fast (actually fast is bad) so you won't need PID or anything complex like you would for moving fast loads or variable loads. Turn the motors slow, stop when they are correct. Add in a proportional factor if you must but it's probably not needed. Most of the electric-aligning satellite dishes just use a small DC constant speed motor with a lot of gearing.


Boss......

He is looking for a help in simulating the thing in MATLAB....not fiddle with any DC ,servo...n stepper motors.... hope you have read the earlier thread properly
 
@Rajneesh
Thanks a lot!

I was getting a lot of advice but not the required ones....:(

Still getting nowhere :sigh: I'll keep updating about this project. Oh and does anyone have tutorial links for PWM model?

I've decided to scrap the switch model because even if I do figure that one out, the organization was specific about using a PWM.
 
I'm working on this project which involves controlling a antenna with a 2 axis servo motor.
...

... I've decided to model it first using MATLAB.
...

I read it well enough to offer real world advice on a good way to do it.

If he did it the way I suggested (the way I have seen professional antennas do it) there is little need for wasting time with MATLAB.
 
@Mr RB

Sorry man, didn't mean to offend you or anything...

It's just that I'm not in a position to forsake MATLAB, it's necessary to simulate it first so that they will provide the parts as they are expensive.

Arguments aside, seriously is there anyone with experience in MATLAB here?:confused:
 
Status
Not open for further replies.

Latest threads

Back
Top