domvpavlino.ru

How to adapt a counter for a winding machine. Homemade winding machine. Components of a winding machine and its operating principle

After reviewing a number of designs of counters for various purposes published in the magazine (for example, ), I decided to develop my own version of a turns counter, which uses the non-volatile memory of a microcontroller. As a result, it was possible to create a simple and easy-to-use winding counter for a winding machine that does not contain scarce parts.

It is capable of counting from 0 to 9999 shaft revolutions, after which the indicator readings are reset and counting begins again. When the shaft rotates in the opposite direction, the indicator decreases the reading by one for each revolution.


Rice. 1

The counter consists of several nodes (Fig. 1). The basis of the design is the microcontroller DD1, to which a four-digit LED indicator HG1 is connected through current-limiting resistors R10-R16. Two optocouplers - an IR emitting diode - phototransistor (VD2VT1, VD3VT2) - forming a speed sensor for the working shaft of the machine, generate low-level pulses, from which the microcontroller determines the direction of rotation and the number of shaft revolutions. There is an SB1 button for resetting the memory, as well as auxiliary circuits: R2C2, which operates as part of the microcontroller’s built-in clock generator, VD1C1, which maintains the supply voltage necessary to switch the microcontroller to SLEEP mode, and R6R8, which monitors the meter’s supply voltage.


It is known that microcontrollers of the PIC family are quite capricious when working with EEPROM (especially when writing to it occurs automatically). Reducing the supply voltage can distort the contents of the memory When the counter is operating, line RB1 (pin 7) of the microcontroller, to which the R6R8 circuit is connected, is polled for the presence of supply voltage, and if it disappears, then thanks to the VD1C1 circuit, the microcontroller manages to go into sleep mode, thereby blocking further program execution and protecting information in EEPROM. During the counting process, the microcontroller will store numbers in memory after each revolution of the machine's working shaft. Each time the power is turned on, the HG1 indicator will display the number that was before the shutdown.
The sensor is a small printed circuit board (22x22 mm), on which two emitting diodes and two phototransistors are mounted, installed so that they form two optical transmitter-receiver channels. The optical axes of the channels are parallel, the interaxial distance is about 10 mm.
A shutter in the form of a disk made of hard, opaque material for IR rays (textolite, getinax, metal, plastic) with a thickness of 1...2 mm is fixedly fixed on the working shaft of the machine. The diameter of the curtain is 35...50 mm, the diameter of the central mounting hole is equal to the diameter of the shaft. The board is fixed on the machine so that the curtain, rotating with the shaft, can block both IR beams.
A cutout in the shape of an incomplete sector is cut into the curtain. The angular width and depth of the cutout must be such that when the shaft rotates, the shutter ensures short-term passage of IR radiation, first only through one channel, then through both, and finally only through the other, as is schematically illustrated in Fig. 2. Channels that are open in one position or another are shown in color. This order of signals from the sensor gives the microcontroller the ability to determine the direction of rotation of the working shaft of the machine
.

The meter is powered by a battery of three AA galvanic cells (R6), but you can use any network unit with a stabilized output voltage of 5 V.
The sensor is mounted on a printed circuit board made of foil-coated fiberglass laminate 1 mm thick. The board drawing is shown in Fig. 3. Current-limiting resistor R3 is soldered on the side of the printed conductors, and emitting diodes and phototransistors are soldered on the other.
The remaining parts (except for battery GB1 and switch SA1) are placed on a second board made of the same fiberglass. Its drawing is shown in Fig. 4. All resistors (except R3) are placed on the surface-mount printing side, and the microcontroller, digital indicator, capacitors, diode, SB1 button and wire jumpers are on the opposite side. The microcontroller is installed in a panel soldered to the board.
The sensor board is fastened to the main one with two brackets, bent from tinned copper wire with a diameter of 1.2 mm and soldered to the edge printed conductors of the boards. To attach the boards to the machine body, homemade holders with an eye for a screw, made of the same wire and also soldered to the main board, were used.


Rice. 4


A general view of one of the design options of the meter installed on a winding machine is shown in the photo in Fig. 5. A battery of voltaic cells with a switch is attached to the back of the machine.

For the sensor, in addition to those indicated in the diagram, you can use emitting diodes SEP8706-003, SEP8506-003, KM-4457F3C, AL144A, AL108AM and others, and phototransistors - SDP8436-003, KTF102A. Optocouplers from old ball point computer mice - mice - are also very suitable; For emitting diodes, the short lead is the cathode, and for phototransistors, the short lead is the emitter.
It should be noted that it is better to use phototransistors in an opaque (black) case - in this case, the likelihood of failures and errors in counting due to light interference from external bright sources hitting the photodetectors will be minimal. If the available phototransistors are transparent, a piece of black PVC tube with a hole opposite the lens should be placed on each of them, and the entire sensor should be covered from extraneous light with a black paper cover. If the curtain is made of light-reflecting material, it is recommended to cover it with matte black paint.
Instead of “surface” resistors, you can use MLT-0.125 or S2-23 with a power of 0.062 W. Button SB1 - any button suitable for the mounting location on the board. Instead of E40281-L-O-0-W, the digital indicator FYQ-2841CLR is suitable.

The microcontroller program was developed and debugged in the Proteus environment, after which it was loaded into the microcontroller using the ICProg programmer. After installing the microcontroller in the panel, the first and subsequent times the meter is turned on, the indicator will display a minus sign in all familiar locations. After about two seconds, zeros will appear on the display - this is a sign that the meter is ready for operation.

The program provides an emergency memory reset function in case it receives erroneous information and the microcontroller freezes (this happens extremely rarely, but it can happen). To return the microcontroller to operating mode, you need to turn off the power to the meter, press the “Reset” button and, without releasing it, turn on the power. As soon as the display displays zeros, you can continue to work, but information about the previous number of turns will, of course, be lost.
A properly assembled device does not require any adjustment.

Option 1: ATmega8 + Nokia 5110 LCD + 3V power supply

The circuit uses Atmega8-8PU (external quartz with a frequency of 8MHz), Nokia 5110 LCD and a transistor for processing pulses from a reed switch. The 3.3V voltage regulator provides power to the entire circuit.

All components were mounted on the breadboard, including connectors for: ISP programmer (USBAsp), 5110 Nokia LCD, power (5V supplied to 3.3V regulator), reed switch, reset button and a 2-pin connector used to read winding polarity machine drive motor to know whether to increase or decrease the counter.

Purpose of connectors:
J1: Power. 5V is supplied to the connector and then to the L7833 stabilizer to obtain the 3.3V voltage used by ATmega8 and LCD.
J2: LCD connector for Nokia 5110 LCD.
J3: Reed switch. Pulse input for counting by microcontroller.
J4: Polarity connector. It must be connected in parallel with the motor winding. The tracking circuit was designed for a 12-volt motor, but it can be applied to other motor voltages by adjusting the values ​​of the voltage dividers formed by R3-R4 and R5-R6. If the motor is connected to straight polarity, PD0 will have a high log. level, if the motor is connected to reverse polarity, then PD1 will have a high log. level. This information is used in the code to increment or decrement the counter.
J5: Counter reset. When you press the button, the counter will be reset.
ISP Connector: This is a 10-pin connector for the USBAsp AVR programmer.

Device diagram

Photo of the finished device


Option 2: ATmega8 + 2x16 HD44780 LCD + 5V power supply

Some of my readers have asked for a version of the counter that uses a 2x16 HD44780 display (or a smaller 1x16 variant). These displays require a 5V supply voltage, so a 3.3V stabilizer is not relevant.

Device diagram

Microcontroller configuration bits for both options: LOW - 0xFF, HIGH - 0xC9.

Archive for the article "Coil counter for winding machine"
Description:

Source code (C), firmware files for the microcontroller

File size: 111.35 KB Number of downloads: 257

In amateur radio practice, there is often a need to wind/rewind various windings of transformers, chokes, relays, etc.
When developing this machine, the following tasks were set:

1. Small dimensions.
2. Smooth spindle start.
3. Counter up to 10,000 turns (9999).
4. Winding with automatic wire laying. Laying pitch (wire diameter) 0.02 - 0.4mm.
5. Possibility of winding sectional windings without reconfiguration.
6. Possibility of fastening and winding frames without a central hole.

Picture 1.
External view of the winding machine.

Composition of the winding machine.

1. Feed reel (reel of wire).
2. Braking (brake mechanism).
3. Stepper motor for bobbin centering.
4. Ball furniture guides.
5. Shutter of optical sensors of the reel centering mechanism.
6. Handle for moving the positioner to another section when winding sectional windings.
7. Buttons for manually switching the laying direction.
8. LEDs for laying direction.
9. Positioner stepper motor.
10. Shutters of optical winding boundary sensors.
11. Positioner screw.
12. Ball furniture guides.
13. Winding reel.
14. Winding motor.
15. Turn counter.
16. Setting buttons.
17. Optical synchronization sensor.
18. Speed ​​controller.

Device and principle of operation.

Feeding unit.

The feeding unit is designed to attach a reel of wire of various sizes to it, and provide tension on the wire.
It includes a bobbin fastening mechanism and a shaft braking mechanism.

Figure 2.
Feeding unit.

Braking.

Without braking the feed reel, the winding of the wire on the frames will be loose and high-quality winding will not work. Felt tape “2” slows down drum “1”. Turning the lever “3” tightens the spring “4” - adjusting the braking force. For different wire thicknesses, its own braking is adjusted. Off-the-shelf VCR parts are used here.

Figure 3.
Braking mechanism.

Bobbin centering.

The small dimensions of the machine and the location in close proximity of the winding reel and the feed reel with wire required the introduction of an additional mechanism for centering the feed reel.


Figure 4, 5.
Centering mechanism.

When winding the coil, the wire from the reel acts on the shutter “5”, made in the form of a “fork” and the stepper motor “3”, through a gearbox with division 6 and a toothed belt, along roller guides “4”, automatically moves the reel in the desired direction.
Thus, the wire is always in the center, see Fig. 4, Fig. 5:

Figure 6.
Sensors, rear view.

Composition and design of sensors.

19. Optical sensors for the bobbin centering mechanism.
5. A curtain covering the sensors of the reel centering mechanism.
20. Curtains covering the positioner direction switching sensors.
21. Optical sensors for switching the direction of the positioner.

Positioner.

Curtains “20” fig. 6 - the winding boundary is set. The stepper motor moves the stacker mechanism until the curtain blocks one of the sensors “21” fig. 6, after which the laying direction changes.
You can change the laying direction at any time using buttons “1” fig. 7.

Figure 7.
Stacker.

Rotation speed of stepper motor “9” fig. 7, synchronized using sensor “10”, “11” Fig. 8, with the rotation of the wound coil and depends on the diameter of the wire set in the menu. The wire diameter can be set to 0.02 - 0.4mm. Using knob “8” fig. 7, you can move the entire positioner to the side without changing the winding boundaries. In this way, it is possible to wind another section in multi-section frames.

Figure 8.
Optosensor.

Composition of the positioner and opto-sensor (Fig. 7-8).

1. Buttons for manually switching the laying direction.
2. LEDs for laying direction.
3. Curtains covering the positioner direction switching sensors.
4. Linear bearing.
5. Caprolon nut.
6. Lead screw. Diameter 8mm, thread pitch 1.25mm.
7. Ball furniture guides.
8. Handle for moving the positioner to another section when winding sectional windings.
9. Stepper motor.
10. Optical timing sensor.
11. Disk covering the synchronization sensor. 18 slots.

Receiving node.

Figure 9.
Receiving node.


Figure 10, 11.
Receiving node.

1. Turn counter.
2. Commutator high-speed motor.
3. Reducer gear.
4. “Counter reset” button.
5. Speed ​​adjustment.
6. “Start winding” switch.
7. Fastening of the winding reel.

The rotation of the wound coil is produced by a high-speed commutator motor through a gearbox.
The gearbox consists of three gears with a total pitch of 18. This provides the necessary torque at low speeds.
The motor speed is adjusted by changing the supply voltage.


Figure 12, 13.
Fastening a frame with a hole.

The design of the receiving unit allows you to fasten both frames with a central hole and frames without such holes, which is clearly visible in the figures.


Figure 14, 15.
Fastening a frame without a hole.

Electrical diagram.

Figure 16.
Electrical circuit of the winding machine.

All processes of the machine are controlled by a PIC16F877 microcontroller.
Indication of the number of turns and diameter of the wire is displayed on a four-digit LED indicator. When the “D” button is pressed, the diameter of the wire is displayed; when pressed, the number of turns is displayed.
To change the wire diameter, press the “D” button and use the “+”, “-” buttons to change the value. The set value is automatically saved in the EEPROM. Button “Zerro” - resets the counter. The “ISCP” connector is used for programming the microcontroller.

P.S. There are no mechanical drawings because the device was manufactured in one copy, and the design was formed during the assembly process.
In this design, disassembled elements and assemblies (not marked) from VCRs and printers were used.
In no case do I insist on the exact repetition of this design, but only on the use of any nodes from it in my designs.
Reproduction of this device is possible by experienced radio amateurs who have skills in working with mechanics and are able to change the design to suit their existing mechanical parts.
The mechanical part, accordingly, can be implemented differently.
Gearboxes on engines may have a different division.

Critical elements:

For the program to work correctly, a number of conditions must be met, namely;
Optical sensor “17” Fig. 1., may be of a different design, but must have 18 holes.
The positioner screw must have a pitch of 1.25 mm - this is a standard pitch for a screw with a diameter of 8 mm.
Positioner stepper motor 48 steps/revolution, 7.5 degrees/step - these are the most common motors in office equipment.

Demonstration video of the machine:

Below in the attachment (in the archive) all the necessary files and materials for assembling the winding machine are collected.
If anyone has any questions regarding assembly and setup, please ask them on the forum. I will try to answer and help if possible.

I wish you all good luck in your creativity and all the best!

Archive "Winding machine"

Many household appliances and industrial automation devices of relatively recent production years have mechanical counters installed. They are products on a conveyor belt, turns of wire in winding machines, etc. In the event of a failure, finding a similar meter is not easy, and it is impossible to repair due to the lack of spare parts. The author proposes to replace the mechanical counter with an electronic one.

An electronic counter, developed to replace a mechanical one, turns out to be too complex if it is built on microcircuits with a low and medium degree of integration (for example, the K176, K561 series). especially if a reverse account is needed. And in order to maintain the result when the power is turned off, it is necessary to provide a backup battery.

But you can build a counter on just one chip - a universal programmable microcontroller that includes a variety of peripheral devices and is capable of solving a very wide range of problems. Many microcontrollers have a special memory area - EEPROM. Data written into it (including during program execution), for example, the current counting result, is saved even after the power is turned off.

The proposed counter uses a microcontroller Attiny2313 from the Almel AVR family. The device implements reverse counting, displaying the result with cancellation of insignificant zeros on a four-digit LED indicator, storing the result in EEPROM when the power is off. An analog comparator built into the microcontroller is used to timely detect a decrease in supply voltage. The counter remembers the counting result when the power is turned off, restoring it when turned on, and, similarly to a mechanical counter, is equipped with a reset button.

The counter circuit is shown in the figure. Six lines of port B (РВ2-РВ7) and five lines of port D (PDO, PD1, PD4-PD6) are used to organize dynamic indication of the counting result on the LED indicator HL1. The collector loads of phototransistors VT1 and VT2 are resistors built into the microcontroller and enabled by software that connect the corresponding pins of the microcontroller to its power supply circuit.

An increase in the counting result N by one occurs at the moment the optical connection between the emitting diode VD1 and the phototransistor VT1 is interrupted, which creates an increasing level difference at the INT0 input of the microcontroller. In this case, the level at the INT1 input must be low, i.e., the phototransistor VT2 must be illuminated by the emitting diode VD2. At the moment of a rising differential at the INT1 input and a low level at the INT0 input, the result will decrease by one. Other combinations of levels and their differences at the inputs INT0 and INT1 do not change the counting result.

Once the maximum value of 9999 is reached, counting continues from zero. Subtracting one from the zero value gives the result 9999. If counting down is not needed, you can exclude the emitting diode VD2 and phototransistor VT2 from the counter and connect the INT1 input of the microcontroller to the common wire. The count will only continue to increase.

As already mentioned, the detector of a decrease in supply voltage is the analog comparator built into the microcontroller. It compares the unstabilized voltage at the output of the rectifier (diode bridge VD3) with the stabilized voltage at the output of the integrated stabilizer DA1. The program cyclically checks the state of the comparator. After the meter is disconnected from the network, the voltage on the rectifier filter capacitor C1 drops, and the stabilized voltage remains unchanged for some time. Resistors R2-R4 are selected as follows. that the state of the comparator in this situation is reversed. Having detected this, the program manages to write the current counting result to the EEPROM of the microcontroller even before it stops functioning due to the power being turned off. The next time you turn it on, the program will read the number written in EERROM and display it on the indicator. Counting will continue from this value.

Due to the limited number of microcontroller pins, to connect the SB1 button, which resets the counter, pin 13 was used, which serves as the inverting analog input of the comparator (AIM) and at the same time as the “digital” input of PB1. The voltage divider (resistors R4, R5) here sets the level perceived by the microcontroller as high logical. When you press the SB1 button, it will become low. This will not affect the state of the comparator, since the voltage at the AIN0 input is still greater than that at AIN1.

When the SB1 button is pressed, the program displays a minus sign in all digits of the indicator, and after releasing it, it starts counting from zero. If you turn off the power to the meter while the button is pressed, the current result will not be written to the EEPROM, and the value stored there will remain the same.

The program is designed in such a way that it can be easily adapted to a meter with other indicators (for example, with common cathodes), with a different printed circuit board layout, etc. A slight correction of the program will also be required when using a quartz resonator for a frequency that differs by more than 1 MHz from the specified one.

When the source voltage is 15 V, measure the voltage at pins 12 and 13 of the microcontroller panel relative to the common wire (pin 10). The first should be in the range of 4...4.5 V, and the second should be more than 3.5 V, but less than the first. Next, the source voltage is gradually reduced. When it drops to 9... 10 V, the difference in voltage values ​​at pins 12 and 13 should become zero and then change sign.

Now you can install the programmed microcontroller into the panel, connect the transformer and apply mains voltage to it. After 1.5...2 s you need to press the SB1 button. The counter indicator will display the number 0. If nothing is displayed on the indicator, check the voltage values ​​at the AIN0.AIN1 inputs of the microcontroller again. The first must be greater than the second.

Thread counter for winding machine

Someday you get tired of winding transformers by hand, and now you are already crookedly sawing the boards of a former cabinet to build a winding machine. These machines come in different types: manually or electrically driven, with or without a coil stacker. But they all have one thing in common: the need for a coil counter. This wonderful addition will allow you to comfortably wind multi-turn windings, such as, for example, network windings - under 1000 turns or primary output transformers - under 3000. A good meter should be able to count in both directions: if you decide to wind some turns, it should subtract them from the counted quantities. And if you decide to reel a little every day, then you need to remember how much you have already reeled, so that you can then continue from the same point. Well, and, of course, the entire design should be the simplest, using the most accessible parts.

Do you think we found one quickly? That's right, no. Of course, all sorts of things have been done on Atmegs with two-line LCD displays, but this is not an on-board computer! In addition, some coil counters simply cannot count backwards.

And finally, the desired design was found! It was invented and implemented by Vladimir, page with the author’s description:


The counter is built on the popular PIC16F628A microcontroller. Four digits of the number of turns are displayed by a seven-segment indicator. Thus, you can wind up to 9999 turns, which is important when winding output transformers. There are two buttons: reset and remember. Two reed switches are used as sensors. You just need to attach a magnet to the machine shaft.


The author's version uses an indicator with a common cathode of some unknown pinout. We had to remake both the board for a wider indicator and the firmware for an indicator with a common anode. But the author's version was tested in the simulator, and it works well.

This counter has one feature: it counts at a rate of at least one change in the state of the reed switches per five seconds. Therefore, if you slowly and carefully wind something up, then there is a chance that he will not count this turn. But the likelihood of this happening is small, so you can use it.

Probably, the design can be converted from reed switches to optics, if anyone needs it, or even to mechanical contacts - bounce is suppressed by software.

Loading...