In detail: do-it-yourself servo motor repair from a real master for the site my.housecope.com.
I recently made a robot arm, and now I decided to add a gripping device powered by a mini servo to it. I decided to make two variations to see how it would work better with a straight or round gear. I liked the round gear option better as it only took 2 hours to make and the gap between the gears was very small.
First, I cut out the parts on a milling machine:
I assembled the parts using 2x10mm screws.
And here's how the mini servo attaches to the gripper:
How the servo gripper works:
And now, when everything is assembled and the mechanical part is also almost ready, I just have to finish the electronic part of the work! I chose an Arduino to control my robot, and made a circuit (it's on the right) to connect the Arduino to the servo.
The circuit is actually very simple, it just sends signals to and from the Arduino. There is also a connector for an infrared receiver and some connectors for the power supply and 4 connections to the rest of the (unused) Arduino pins. Thus, another switch or sensor can be connected.
And here is how the manipulator arm moves:
The purchase by the enterprise of a CNC milling machine for the manufacture of facades from MDF raises the question of the need to overpay for certain mechanisms and power units installed on expensive and high-tech equipment. For positioning the power units of CNC machines, stepper motors and servo motors (servo drives) are usually used.
Video (click to play).
Stepper motors are cheaper. However, servo drives offer a wide range of benefits, including high performance and positioning accuracy. So what should you choose?
A stepper motor is a brushless DC synchronous motor that has multiple stator windings. When current is applied to one of the windings, the rotor turns and then is fixed in a certain position. Sequential excitation of the windings through a stepper motor controller allows the rotor to rotate at a given angle.
Stepper motors are widely used in industry, as they have high reliability and long service life. The main advantage of stepper motors is positioning accuracy. When current is applied to the windings, the rotor will turn strictly at a certain angle.
· High torque at low and zero speeds;
· Quick start, stop and reverse;
· Work under high load without the risk of failure;
· The only wear mechanism affecting the service life is bearings;
· Possibility of resonance;
· Constant power consumption regardless of the load;
· Drop in torque at high speeds;
· Lack of feedback during positioning;
· Poor repairability.
A servo motor (servo motor) is an electric motor with negative feedback control, which allows you to precisely control the parameters of movement in order to achieve the required speed or to obtain the desired angle of rotation. The servomotor includes the electric motor itself, the feedback sensor, the power supply and control unit.
The design features of electric motors for a servo drive are not much different from conventional electric motors with a stator and a rotor, operating on direct and alternating current, with and without brushes.A special role here is played by a feedback sensor, which can be installed both directly in the engine itself and transmit data about the position of the rotor, and determine its positioning by external signs. On the other hand, the operation of a servo motor is unthinkable without a power supply and control unit (aka inverter or servo amplifier), which converts the voltage and frequency of the current supplied to the electric motor, thereby controlling its action.
· High power with small dimensions;
· Fast acceleration and deceleration;
· Continuous and uninterrupted position tracking;
· Low noise level, absence of vibrations and resonance;
· Wide range of rotation speed;
· Stable work in a wide range of speeds;
· Low weight and compact design;
· Low power consumption at low loads.
· Demanding for periodic maintenance (for example, with replacement of brushes);
· The complexity of the device (the presence of a sensor, power supply and control unit) and the logic of its operation.
When comparing the characteristics of a servo drive and a stepper motor, you should pay attention, first of all, to their performance and cost.
For the production of MDF facades in a small enterprise working with small volumes, I think there is no need to overpay for the installation of expensive servo motors on a CNC milling machine. On the other hand, if an enterprise seeks to reach the maximum possible production volumes, then it makes no sense to cheapen on low-performance stepper motors for CNC.
Servo motors are not only used in aeromodelling and robotics, they can also be used in household appliances. Small size, high performance, as well as easy control of the servo motor make them the most suitable for remote control of various devices.
The combined use of servo motors with receiving-transmitting radio modules does not create any difficulties, it is enough on the receiver side to simply connect the corresponding connector to the servomotor, containing the supply voltage and control signal, and the job is done.
But if we want to control the servo motor "manually", for example, using a potentiometer, we need an impulse control generator.
Below is a fairly simple generator circuit based on the 74HC00 integrated circuit.
This circuit allows manual control of servomotors by supplying control pulses with a width of 0.6 to 2 ms. The scheme can be used, for example, to rotate small antennas, outdoor spotlights, CCTV cameras, etc.
The basis of the circuit is the 74HC00 microcircuit (IC1), which consists of 4 NAND gates. A generator is created on the elements IC1A and IC1B, at the output of which pulses with a frequency of 50 Hz are formed. These pulses activate the RS flip-flop, which consists of gates IC1C and IC1D.
With each pulse coming from the generator, the IC1D output is set to "0" and the capacitor C2 is discharged through the resistor R2 and the potentiometer P1. If the voltage across the capacitor C2 drops to a certain level, then the RC circuit transfers the element to the opposite state. Thus, at the output we get rectangular pulses with a period of 20 ms. The pulse width is set by potentiometer P1.
For example, the Futaba S3003 servo drive changes the angle of rotation of the shaft by 90 degrees due to control pulses with a duration of 1 to 2 ms. If we change the pulse width from 0.6 to 2 ms, then the rotation angle is up to 120 °. The components in the circuit are selected so that the output pulse is in the range of 0.6 to 2 ms, and therefore the angle of installation is 120 °. The S3003 servo motor from Futaby has a sufficiently large torque, and the current consumption can range from tens to hundreds of mA, depending on the mechanical load.
The servo motor control circuit is assembled on a double-sided printed circuit board measuring 29 x 36 mm.Installation is very simple, so even a novice radio amateur can easily cope with the assembly of the device.
Valve motors are synchronous brushless (brushless) machines. On the rotor there are permanent magnets made of rare earth metals, on the stator there is an armature winding. The stator windings are switched by semiconductor power switches (transistors) so that the stator magnetic field vector is always perpendicular to the rotor magnetic field vector - for this, a rotor position sensor (Hall sensor or encoder) is used. The phase current is controlled by PWM modulation and can be trapezoidal or sinusoidal.
The flat rotor of the linear motor is made of rare earth permanent magnets. In principle, it is similar to a valve motor.
Unlike synchronous machines of continuous rotation, stepper motors have pronounced poles on the stator, on which the coils of the control windings are located - their commutation is performed by an external drive.
Consider the principle of operation of a reactive stepper motor, in which teeth are located on the stator poles, and the rotor is made of soft magnetic steel and also has teeth. The teeth on the stator are located so that at one step the magnetic resistance is less along the longitudinal axis of the motor, and at the other - along the transverse one. If you discretely excite the stator windings with direct current in a certain sequence, then the rotor with each commutation will turn by one step, equal to the pitch of the teeth on the rotor.
Some models of frequency converters can work with both standard induction motors and servo motors. That is, the main difference between servos is not in the power section, but in the control algorithm and the speed of calculations. Since the program uses information about the rotor position, the servo has an interface for connecting an encoder mounted on the motor shaft.
Servo systems use the principle subordinate management: the current loop is subordinate to the speed loop, which in turn is subordinate to the position loop (see automatic control theory). The innermost loop, the current loop, is tuned first, followed by the speed loop, and last, the position loop.
Current loop always implemented in the servo.
Velocity loop (as well as the speed sensor) is also always present in the servo system, it can be implemented both on the basis of a servo controller built into the drive, or an external one.
Position contour used for precise positioning (for example, feed axes in CNC machines).
If there are no backlashes in the kinematic connections between the actuator (coordinate table) and the motor shaft, then the coordinate is indirectly recalculated according to the value of the circular encoder. If there are backlashes, then an additional position sensor (which is connected to the servo controller) is installed on the actuator for direct coordinate measurement.
That is, depending on the configuration of the speed and position loops, an appropriate servo controller and servo drive is selected (not every servo controller can implement a position loop!).
Positioning
Interpolation
Synchronization, electronic gear (Gear)
Precise control of rotation speed (machine spindle)
Electronic Cam
Programmable logic controller.
In general, a servo system (Motion Control System) can consist of the following devices:
Servo Motor with a circular speed feedback sensor (it can also act as a rotor position sensor)
Servo Gear
Actuator position sensor (e.g. linear encoder for feed axis coordinates)
Servo Drive
Servo controller (Motion Controller)
Operator interface (HMI).
PLC-based servo system (PLC-based Motion Control)
The motion control function module is added to the PLC expansion basket
Standalone servo controller
PC-based servo system (PC-based Motion Control)
Special Motion Control software for tablet PC with user interface (HMI)
Programmable Automation controller (PAC) with motion control
Drive-based servo system (Drive-based Motion Control)
Frequency converter with built-in servo controller
Optional software that is loaded into the drive and supplements it with motion control functions
Option cards with motion functions that are built into the drive.
Compact brushless permanent magnet (valve) servo motors for high dynamics and precision.
Asynchronous
Drives of the main movement and spindles of tool machines.
Direct drive (Direct Drive)
The direct drive does not contain intermediate transmission mechanisms (ball screws, belts, gearboxes):
Linear motors (Linear Motors) can be supplied with profile rail guides
Torque motors (Torque Motors) - synchronous multi-pole machines with permanent magnet excitation, liquid-cooled, hollow shaft rotor. Provides high precision and power at low revs.
High performance, dynamics and positioning accuracy
High-torque
Low-response
High overload torque
Wide control range
Brushless.
Lack of kinematic chains for converting rotary motion to linear:
Micron precision is required in CNC machine tools, and in stackers, a centimeter is enough. The choice of servo motor and servo drive depends on the accuracy.
Positioning Accuracy
Accuracy of speed maintenance
Precision of maintaining the moment.
Articles, reviews, prices for machines and components.
Yaskawa 400 watt servos have an encoder key. The encoder can be supplied in 4 variants, in the encoder there are 4 re-slots. You will disassemble and put labels to make it easier to assemble.
Rather alive. Serva probably worked constantly above par.
Disassemble, but look there. Do not admire this dead engine
When the S-ON signal is applied and the brake is applied, there must be a dedicated output to control the brake.
to a relay or open collector.
If you don't need a brake when turning on the servo, apply the 24v brake and there will be a simple servo
when the machine is turned off so that the axles do not slide under the weight. The brake is slow and it just won't keep up with the CNC operation. In this case, the brake has the same or slightly more torque than the servo itself. That is, if the servo is 5Nm, then the brake can be 7Nm, and since the servo can work with excess torque, the servo itself works as a brake when working in the CNC.
Our services have already been used by more than 1000 enterprises from more than 200 cities from small businesses to public corporations. In just the last year over 2000 units of complex industrial electronics were repaired more than 300 different manufacturers. According to statistics 90% out of order equipment must be restored.
Pay only for the result - working block
The whole unit is guaranteed for 6 months
Repair term from 5 to 15 days
Free preliminary inspection for maintainability
We do not make constructive changes
Component level repair
We divide all servomotors into 4 categories depending on the complexity of the repair:
Allen-Bradley E146578 Servo Motor
Servo motor BRUSHLESS B6310P2H 3A052039
Servo motor YASKAWA SGMP-15V316CT 1P0348-14-6
Servo motor Schneider Electric iSH100 / 30044/0/1/00 / 0/00/00/00
Siemens servomotor 1FK7086- 7SF71- 1EH0
Allen-Bradley BULLETIN 1326 AC SERVO MOTOR
Rexroth servo motor MSK071E- 0200-NN- M1-UG0- NNNN
Servo motor EMERSON Unimotor
Fanuc servo motor L25 / 3000 A06B- 0571- B377
Servo motor INDRAMAT 090B-0- JD-3-C / 110-A-1 / SO1
Siemens servomotor 1FT6134- 6SB71- 2AA0
We can determine the type of servomotor and the approximate cost of repairs from the photo of the nameplate. If you do not know what a nameplate is, then here example .
We will be able to name the exact cost of repairs after a free inspection of the servomotor.
Send equipment for inspection
Pay the bill and start repairs
After 7 days, information to the customer
15 days the equipment is sent to the customer
1. How to determine the type of servo motor and the cost of repair?
Send a photo of the nameplate and the symptoms of the malfunction - we will answer you as soon as possible.
2. When will you tell me the exact cost?
After inspection of the equipment in our laboratory within 1-2 days.
3. How much will the diagnostics cost?
An initial maintainability inspection is free of charge. You only pay for a positive repair result.
4. What happens if you are unable to repair the servo motor?
If during the process of equipment repair it is established that the restoration of operability is impossible, we will refund 100% of the money paid. There is no diagnostic fee.
5. Do you tune the encoder after repair?
Yes, we adjust the position of the encoder relative to the servo. However, in production it is often necessary to adjust the position of the servo itself. This is done by the Customer's specialists using the documentation from the manufacturer.
6. Do you rewind the motor?
We do not rewind.
A servo motor is a unique type of equipment that combines a reliable mechanical part and sophisticated electronic feedback sensors (and, in some cases, control units for the engine itself). Due to such a combination of completely different components, its repair has much more features, in contrast to equipment that has only electronic and software parts. To fully repair the servo motor, it is necessary to restore not only the mechanical and electronic parts, but also to set up their joint functioning, which requires high-precision measurement and correct analysis of the parameters of all the component parts of the motor.
Repair of electronic components that are part of a servo motor requires careful preparation and the availability of special equipment for both tuning and reprogramming - most often an encoder. At the same time, the presence of a serviceable electronic component does not at all mean the correct operation of the motor, since the slightest failure in its positioning inside the motor (for example, due to shock or vibration) automatically entails a malfunction. Often, independent attempts to replace the encoder end in failure, because, in addition to correct installation, it requires positioning, in addition, special tools and software are required for operation.
Most industrial plants use servo motors in the production process. High / low temperatures, significant temperature drops, high humidity, high dynamic loads, chemically aggressive environment, etc.
Topic of section Auto Off-Road in category Car models; Symptom 1: The remote control is turned on, we turn on the board. The servers moved in a chaotic manner and stopped. They do not respond to the remote control. Repair: check the reliability of the power supply for the item.
Symptom 1: The remote control is turned on, we turn on the board. The servers moved in a chaotic manner and stopped. They do not respond to the remote control.
Repair: check the reliability of the power supply for contact bounce, oxidation of contacts or a toggle switch. Perhaps it will be enough to tighten (clean) the contacts, in extreme cases we disassemble the toggle switch and inspect it. The toggle switch contacts tend to burn.
Simpton 2: The remote control is turned on, we turn on the board. It is raining or snowing outside. The servers stand still, they react to the remote control. But periodically the servos tremble when the hand touches the board antenna or the remote control antenna, as well as from wet drops.
Repair: You just need to extend the telescopic antenna on the remote control completely.
Symptom 3: The remote control is turned on, we turn on the board. When you turn the steering wheel to the left or right, the servo very slowly returns to its original state. Or after a short ride, the servo becomes sluggish, for example, it turns badly. And so all the time, take the model out of the house, the battery is fully charged. We ride in damp weather for 10-20 minutes and the servo “falls asleep”. Although the battery has not sat down yet.
Repair: We disassemble the servo, take out the handkerchief. We examine the conductive paths and parts for oxide. It looks like a whitish coating, or like particles of green or dark blue salt crystals. We take white spirit and a toothbrush and remove these electrolysis deposits. After that we dry.
Symptom 4: The remote control is turned on, we turn on the board. For example, press the gas smoothly, the servo moves and at some point, reaching a certain place, it fails.
Repair: The servo contains a potentiometer that provides feedback. That is, when the servo turns the rocker (rocker arm) in the potentiometer, the slider sliding along the graphite track turns. The resistance of the potentiometer changes, the circuit analyzes the movements, etc. Since the potentiometer is not sealed in all servos, water (moisture, ice is already in the frost), sand, dirt, etc. can get into it. the change in its resistance will become incomprehensible to the scheme. Hence the failure. You can dry the servo - if it is from moisture, the malfunction will be eliminated. If drying does not help, perhaps dirt has got in. Then there is a possibility that the graphite layer in the potentiometer has rubbed off and needs to be replaced. You can wash the potentiometer if there are holes in it, then dry it and lubricate it by dripping inside silicone oil (for example, shock absorber). You can even check the potentiometer with a cheap tester, which costs like a pack of cigarettes. Switch the tester to resistance mode, connect the middle and extreme legs of the potentiometer, turn the potentiometer smoothly and look at the tester. The tester should show a smooth change in resistance without any jerks. If there are gaps, then the potentiometer is faulty ...
Guys, tell me .. I got a servo (bitch!) Engine .. which wants to start up and wants to stand. (tag photo below). If it doesn’t start up, keys fly .. sad ..
Its 3 windings are commutated by a servo drive with a corresponding offset of 0 V, 180 V, 310 V, 180 V, and so on .. - the corresponding “coarsely stepped” “sinusoid”.
It was launched separately from the drive, through 2 kW load lamps. in each of the 3 phases 220 V. Sometimes it starts - it turns .. the lamps burn dimly. And sometimes it does not start, all the lamps burn in full heat. The current is correspondingly higher. Pushing “manually” doesn't spin either. If it stays off for a few minutes, it will start again.
They say it is advisable not to disassemble in order to “study” how it works there ..
Maybe someone has come across such a "bitch" .. Tell me .. what can you do with it, except how to throw it out ..
After long and repeated promises to myself and everyone around me, I will finally tell you how to upgrade a servo and turn it into an ubermotor. The advantages are obvious - a gear motor that can be connected directly to the MK without any drivers is cool! And if a servo with bearings, and even metal gears, this is great =)
Excuses Some actions on alteration of servs are irreversible and they cannot be called anything other than vandalism. You can repeat everything that is described below, but at your own peril and risk. If, as a result of your actions, your top-end futaba-brand, titanium-carbot, superintelligent, inertialess, hand-made servo for a hundred of money irrevocably perishes - we have absolutely nothing to do with it 😉 Also, pay attention - the servo gears are quite thickly smeared with grease - you should not disassemble them in a snow-white shirt and on a velvet sofa.
So, they intimidated, now, for reassurance, a little theory =) Serva, as we remember, is controlled by pulses of variable width - they set the angle by which the output shaft should turn (say, the narrowest - all the way to the left, the widest - all the way to the right).The current position of the shaft is read by the brains of the servo from a potentiometer, which is connected to the output shaft by its slider. Moreover, the greater the difference between the current and the given angles, the faster the shaft will jerk in the right direction. It is in this place that the variety of possible alteration options is buried. If we "mislead the servo" =) - we disconnect the potentiometer and the shaft, and make us assume that the potentiometer slider is at the midpoint, then we will be able to control the speed and direction of rotation. And just one signal wire! Now the pulses corresponding to the middle position of the output shaft are zero speed, the wider (from the "zero" width) the faster the rotation to the right, the narrower (from the "zero" width) the faster the rotation to the left.
This implies one important property of serv of constant rotation - they cannot rotate at a certain angle, a strictly defined number of revolutions rotates, etc.(we ourselves removed the feedback) - this is, in general, not a servo, but a gear motor with a built-in driver.
All these alterations have a couple of disadvantages: Firstly - the complexity of setting the zero point - fine tuning is required Secondly, a very narrow adjustment range - a rather small change in pulse width causes a rather large change in speed (see video). The range can be expanded programmatically - just keep in mind that the range of pulse width adjustment (from full clockwise stroke to full counterclockwise stroke) of the converted servo corresponds to 80-140 degrees (in AduinoIDE, Servo library). for example, in the knob sketch, it is enough to change the line: on the and everything becomes much more fun =) And I'll tell you about the roughening of the midpoint and other soldering alterations next time.
Group: Users Posts: 19 Registration: 10/29/2007 From: Moscow Oblast User #: 881
Dear CNC Gurus, help I recently came across two drives with an OS 4 Brushes are connected in parallel, that is, it is powered like a regular DC motor (it turns with a bang) an optical encoder (5 pins) is hidden at the end in a metal glass and rotating disc with notches, pitch approx: 3 notches, per 1 mm
I learned how to turn the steppers, but with these servo motors an ambush someone suggested that it can be moved "in steps" using a PWM, as well as the SM and track the position by the encoder but nothing clever comes to mind from the schemes
who came across, a small schematic diagram or a link where to read about this miracle and also how to manage it I know a little about electronics
In the future, screw these two motors onto a homemade router for milling plastic wood, PP
The PLC stole, the protection there was not even childish - idiotic, the password went from the PLC to the computer in plain text and checked against the one entered already in the software. So the RS232 sniffer is our everything 🙂 I cut the cabbage and decided to spend it somewhere. Caught my eye servo HS-311... So I bought it to show what kind of animal it is.
Serva is the cornerstone of RC model mechanics and, more recently, home robotics. It is a small unit with a motor, gearbox and control circuit. A feed and a control signal are supplied to the input of the servo machine, which sets the angle to which the servo shaft must be set.
Basically, all control here is standardized (if there are RCs here, can you add your own five kopecks?) And servos, for the most part, differ in the force on the shaft, speed, control accuracy, dimensions, weight and material of manufacture of gears. The price ranges from 200-300 rubles for the cheapest and endlessly for ultra-tech-tech devices. As in any fan area, the upper price bar is not limited here, and probably some perforated titanium gears and carbon cases with feedback through a milli-pulse optical encoder are used under the ceiling =) In general, you can always measure yourself with something.
I didn’t show off and took so far the cheapest, most common HS-311... Moreover, I already have plans for its alteration.
Specifications HS-311
Shaft moment: 3kg * cm
Dimensions: 41x20x37mm
Weight: 44.5 gr
Shaft rotation speed at 60 degrees: 0.19 sec
Impulse control
Price: 350-450r
The servo itself, as such, is not particularly necessary to me, but the gearbox from it will do just fine. Moreover, I saw the UpgradeKit for it with metal gears 🙂 However, plastic will do for my tasks.
Constructive: First of all, I took it apart - since childhood I have had such a habit of smoking new toys. The case is about the size of a matchbox, a bit thicker.
If you unscrew the screw from the axle, then the wheel is removed and it becomes clear that the shaft is serrated - it will not rotate.
If you unscrew the four screws, you can remove the gearbox cover:
As you can see, there is a four-stage spur gearbox. The gear ratio will not say, but large.
By removing the bottom cover you can see the control board:
Four transistors are visible, forming an H-bridge that allows you to reverse the engine and logic chip. Mikruha, by the way, is their development. So you will find a datasheet for it figs. It was not possible to make out further. The engine seems to be glued in there, and the board is made of such shitty getinax that I almost broke it in half when I tried to pick it out. Since it was not part of my plans to finally break my own logic, I did not invade the engine compartment. Moreover, there is nothing interesting there.
If you remove all the gears, you can see the shaft of the position feedback resistor:
An approximate construct can be seen on the diagram that I quickly sketched here:
The output shaft is tightly coupled to the shaft of the variable feedback resistor. Therefore, the serva always knows what position it is in at the moment. Of the minuses - the inability to make a full turn. For example, this one can turn the shaft no more than 180 degrees. However, you can break the limit stop, and turn the resistor into an encoder by surgical intervention (who was outraged that the idea of an encoder from a resistor is useless? We're not looking for easy ways, are we? In general, I will soon start upgrading this device and turning a servo into a servo motor.
Control: With the constructive, everything is clear, now about how to steer this beast. There are three wires sticking out of the servo. Ground (black), Power 5 volts (red) and signal (yellow or white).
Its control is impulse, via a signal wire. In order to turn the servo to the desired angle, it needs to send a pulse with the required duration to the input.
0.8ms is about 0 degrees, extreme left position. 2.3ms is about 170 degrees - far right. 1.5ms - middle position. The manufacturer recommends giving 20ms between pulses. But this is not critical and the machine can be overclocked.
Control logic operation How does management work? Simple! When a pulse arrives at the input, it starts a one-shot inside the servo with its leading edge. A one-shot is a block that emits one pulse of a given duration on the triggering edge. The duration of this internal pulse depends solely on the position of the variable resistor, i.e. from the current position of the output shaft.
Further, these two impulses are compared using the dumbest logic. If the external impulse is shorter than the internal one, then this difference will be applied to the motor in the same polarity. If the external impulse is longer than the internal one, then the polarity of the feed to the slider will be different. Under the action of one impulse, the engine jerks towards decreasing the difference. And since the impulses go often (20ms between each), then the dviglo is similar to a PWM. And the greater the difference between the task and the current position, the greater the fill factor and the engine more actively seeks to eliminate this difference. As a result, when the driving and internal impulses are equal in duration, the engine will either stop or, more likely, because the circuit is not ideal - the variable resistor rattles, so there will be no ideal equality, it will start to "scour". Shivering from one side to the other.The more killed the resistor or the worse the driving pulses, the greater these yawing.
In the picture I have depicted two cases when the driving impulse is longer than the internal one and when it is shorter. And below it showed how the signal looks on the engine when it reaches a given point. This is, in fact, the classic case of proportional control.
The pulse repetition rate determines the speed with which the servo will rotate the shaft. The minimum interval, above which the speed stops increasing, and bounce increases, this is about 5-8ms. Below 20ms the servo becomes thoughtfully nerdy. IMHO the optimal pause is about 10-15ms.
In order to play with a sim device, I quickly put a program on my Mega16 core. True, it was a break for me to calculate the full range from 0.8 to 2.3. Calculated for 1 ... 2ms pulse. It's about 100 degrees.
Everything is done on RTOSso I will only describe interrupts and tasks.
The task of scanning the ADC - every 10ms starts the ADC for conversion. Of course, it would be possible to make Freerunning mode (continuous conversion mode), but I did not want the MK to jerk every few microseconds for an interrupt.
After long and repeated promises to myself and everyone around me, I will finally tell you how to upgrade a servo and turn it into an ubermotor. The advantages are obvious - a gear motor that can be connected directly to the MK without any drivers is cool! And if a servo with bearings, and even metal gears, this is great =)
Excuses Some actions on alteration of servs are irreversible and they cannot be called anything other than vandalism. You can repeat everything that is described below, but at your own peril and risk. If, as a result of your actions, your top-end futaba-brand, titanium-carbot, superintelligent, inertialess, hand-made servo for a hundred of money irrevocably perishes - we have absolutely nothing to do with it 😉 Also, pay attention - the servo gears are quite thickly smeared with grease - you should not disassemble them in a snow-white shirt and on a velvet sofa.
So, they intimidated, now, for reassurance, a little theory =) Serva, as we remember, is controlled by pulses of variable width - they set the angle by which the output shaft should turn (say, the narrowest - all the way to the left, the widest - all the way to the right). The current position of the shaft is read by the brains of the servo from a potentiometer, which is connected to the output shaft by its slider. Moreover, the greater the difference between the current and the given angles, the faster the shaft will jerk in the right direction. It is in this place that the variety of possible alteration options is buried. If we "mislead the servo" =) - we disconnect the potentiometer and the shaft, and make us assume that the potentiometer slider is at the midpoint, then we will be able to control the speed and direction of rotation. And just one signal wire! Now the pulses corresponding to the middle position of the output shaft are zero speed, the wider (from the "zero" width) the faster the rotation to the right, the narrower (from the "zero" width) the faster the rotation to the left.
This implies one important property of serv of constant rotation - they cannot rotate at a certain angle, a strictly defined number of revolutions rotates, etc.(we ourselves removed the feedback) - this is, in general, not a servo, but a gear motor with a built-in driver.
Video (click to play).
All these alterations have a couple of disadvantages: Firstly - the complexity of setting the zero point - fine tuning is required Secondly, a very narrow adjustment range - a rather small change in pulse width causes a rather large change in speed (see video). The range can be expanded programmatically - just keep in mind that the range of pulse width adjustment (from full clockwise stroke to full counterclockwise stroke) of the converted servo corresponds to 80-140 degrees (in AduinoIDE, Servo library). for example, in the knob sketch, it is enough to change the line: on the and everything becomes much more fun =) And I'll tell you about the roughening of the midpoint and other soldering alterations next time.