Smart Car Learning (2)---servo learning

Source: Internet
Author: User

Principle and control

I. Brief introduction to the principle of rudder machine



The control signal is entered into the signal modulation chip by the channel of the receiver, and the DC bias voltage is obtained. It has a reference circuit internally, producing a reference signal with a period of 20ms and a width of 1.5ms, which compares the DC bias voltage obtained with the voltage of the potentiometer to obtain a voltage difference output. Finally, the positive and negative output of the voltage difference to the motor drive chip determines the positive and negative rotation of the motor. When the motor speed is certain, through the Cascade reducer gear drive potentiometer rotation, so that the voltage difference is 0, the motor stop rotation.


Servo control generally requires a time-base of about 20ms, the high-level portion of the pulse is generally within the 0.5ms-2.5ms range of angle control pulse part, the total interval of 2ms. Take the 180 degree angle servo as an example, then the corresponding control relationship is this:
0.5MS--------------0 degrees;
1.0MS------------45 degrees;
1.5MS------------90 degrees;
2.0ms-----------135 degrees;
2.5MS-----------180 degrees;

(1) Following characteristics of servo
Assuming that the rudder is stabilized at point A, when the CPU emits a PWM signal, the rudder is shifted at full speed from point A to point B, and in this process it takes a while for the rudder to move to point B.


Hold Time is TW
When Tw≥ T, the rudder can reach the target and have the time remaining;
When Tw≤ T, the rudder can not reach the target;
Theoretically: when tw= T, the system is most coherent and the rudder moves the fastest.
In the actual process w is not the same, the limit T when the coherent motion is difficult to calculate.

When the PWM signal changes in order of the minimum Change (1DIV=8US), the servo has the highest resolution, but the speed slows down.

II. introduction of Servo PWM signal
1. The PWM signal is defined as a PWM signal, which is characterized by the time width between his rising edge and the falling edge. The specific time-width protocol refers to the following. The servos we use today rely mainly on the standard protocols of the model industry, and as the robotics industry becomes more independent, some manufacturers have introduced new servo protocols that can only be used in the robotics industry and cannot be applied to traditional models.
At present, the rudder may be the product of this transition period, it uses the traditional PWM protocol, advantages and disadvantages at a glance. The advantage is already industrialized, the cost is low, the rotation angle is big (at present the production can reach 185 degrees);
The disadvantage is that the control is more complicated, after all, using PWM format.
But it is a digital servo, which has lower requirements for PWM signals:
(1) Do not need to receive instructions at any time to reduce the CPU fatigue level;
(2) can position self-lock, position tracking, this aspect surpasses the common stepping motor;

Several points to note in its PWM format:
(1) The rising edge is at least 0.5mS, which is between 0.5mS---2.5mS;
(2) HG14-M Digital servo drop time is not required, the current use of 0.5Ms on the line; that is, the PWM waveform can be a periodic 1mS standard square wave;
(3) HG0680 is a plastic gear analog servo, which requires continuous supply of PWM signal, it can also input a cycle of 1mS standard square wave, the performance of the following performance is very good, very close.


2. PWM Signal Control Accuracy development
If the 8-bit single-chip microcomputer AT89C52CPU, the data resolution is 256, then the limit parameters of the rudder test, it should be divided into 250 parts.
So the 0.5mS---2.5Ms width is 2mS = 2000uS. 2000us÷250=8us, then: PWM control accuracy is 8us. We can control the steering wheel rotation and positioning in 8uS increments.
Steering gear can be rotated 185 degrees, then 185 degrees ÷250=0.74 degrees, then: servo control accuracy of 0.74 degrees.

1 DIV = 8us; The values in the 250div=2ms time Base register are: (#01H)----(#0FAH) 250.
A total of 185 degrees, divided into 250 positions, each position is called 1DIV. Then: 185÷250 = 0.74 degrees/DIV
PWM Rising edge function: 0.5ms + nxdiv
0us≤nxdiv≤2ms
0.5ms≤0.5ms+nxdiv≤2.5ms

Two The method of dragging and adjusting speed of single servo drive
1. The servo is a follower (1) that rotates at full speed to the target position when it is not transferred to the target position.
(2) The position is automatically maintained when it reaches the target position. So for digital servos, the PWM signal provides the target location, and the tracking motion depends on the rudder itself.
(3) analog servos such as HG0680 need to supply the PWM signal at all times, and the rudder cannot lock its target position. So our control system is a target planning system.
(1) Position control method of Hg14-m servo system
Steering gear angle of 185 degrees, due to the use of 8 for the CPU control, so the maximum control accuracy of 256 parts. At present, after the actual testing and planning, divided into 250 copies. Divide the 0-185° into 250 parts, 0.74 degrees per copy. The PWM width required for the control is 0.5ms-2.5ms, Width 2ms.
2ms÷250=8us: the PWM signal = 1 degrees/8us;

(2) Motion Protocol of Servo motor

When the movement can be larger rotation load, the rudder output torque is large, and the resistance is very good, the linearity of the potentiometer is high, reach the limit position will not deviate from the target.

2, the characteristics of the target planning system
(1) Following characteristics of servo


① servo stability at A Point does not move;
The ②CPU emits a PWM signal with the position coordinates of the B point;
③ steering gear at full speed from point A to point B;
Ф=фb-фa T = ф÷ω
After the ④CPU emits a B-point PWM signal, it should wait for a period of time before the steering wheel can be rotated to point B. So, how to maintain (wait) the time to calculate, the following explanation:
Order: Hold Time is TW
When Tw≥ T, the rudder can reach the target and have the time remaining;
When Tw≤ T, the rudder can not reach the target;
Theoretically: When tw= T, the system is most coherent and the rudder moves the fastest.
The actual process due to 2 factors:
① 1 robots have a plurality of servos, the load is not the same, so ω is different;
② the external environment load of a certain rudder is different at different time, so ω is different;
The limit T in coherent motion is difficult to calculate.
The current approach is to select the Ω value from experience.
(2) Measurement of Ω value of rudder
The Ω value of the rudder changes at any time, so it is possible to measure only one average, or the point at which the probability is highest.
Basis
The experience value of ① manufacturers;
② the use of hg14-m specific testing;
Test experiment:
① will be CPU open, and start delay TW;
② when the delayed TW arrives, observe whether the rudder reaches the target;
A double pendulum procedure is used to measure the relationship between TW and T with the naked eye.
(3) Servo Ω value calculation
General Rudder set for 0.16--0.22 second/60 degrees;
Take 0.2 seconds/60 degrees > > 1.2 seconds/360 degrees > > 0.617 seconds/185 degrees
Then ω is 360 degrees/1.2 seconds, 2π/1.2 seconds
Ω=300 Degrees/sec
Then the 185 degree rotation time is 185 degrees ÷ 360 degrees/1.2 seconds = 0.6167 seconds.
(4) The double pendulum test is used to verify

3. The definition of DAV divides the 185-degree corner into 250 average small parts.
Then: Every small part is 0.74 degrees.
The definition is as follows: DAV = 0.74 degrees
Due to: ω= 0.2 sec/60 degrees
Then: the time required to run 1 DAV is: 0.72 degrees * 0.2 seconds/60 degrees = 2.4 ms;
4. The DIV defines a servo circuit that supports a PWM signal of 0.5ms-2.5ms with a total interval of 2ms.
If it is divided into 250 small parts, then 2ms÷250 = 0.008 ms = 8us.
The definition is as follows: DIV = 8us.

5. The speed regulation algorithm of single rudder machine


Test content: Drag the back of the falling edge of time to 30ms no problem, the rudder still works.
Pull the back of the falling edge to 10ms no problem, the rudder still works.
Pull the back of the falling edge to 2.6ms no problem, the rudder still works.
Pull the back of the falling edge to 500us no problem, the rudder still works.
The practical test shows that the falling edge time parameter can be done very little. At present the experiment drops to 500uS, still working normally.
The reasons are:
(1) The servo circuit automatically detects the rising edge, which is triggered on the rising edge to monitor the PWM pulse width "Head".
(2) The servo circuit automatically detects the falling edge, when the falling edge is triggered, to monitor the PWM pulse width "tail".

(1) Limit drop along PWM pulse width when steering wheel


The questionable place for the 1.1ms when the performance, the resulting tw≈ T;
That is to say 1.1ms = 2.467ms, there is obviously a problem.
After considering the re-observation of the PWM waveform, the actual starting point of the motor is:

In fact, the movement time from A to B is: T = tw + (b point) PWM implementation mode

Smart Car Learning (2)---servo learning

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.