Electronic projects

Speed ​​controller for microdrill on ATMEGA88PA.

Speed ​​controller for microdrill on ATMEGA88PA.

drill

A simple speed controller for a micro drill on the ATMEGA88PA.

– rotation speed control (PWM), smooth start;

– backlight brightness control (PWM), smooth on / off;

– manual and automatic control;

– Automatic shutdown when idle.

The regulator was designed to control the speed of rotation of a microdrill, but can also be used in other devices in which the load is powered by direct current.

The basis for the development was a desktop drilling machine V1.8 without a regulator (see photo).

Specifications:

  • constant supply voltage, 5-18 V
  • three-jaw chuck with a range of clamping diameters: 0.3-4 mm
  • spindle speed: 2000…8000 rpm
  • maximum current consumption: 3A
  • spindle travel: 20mm
  • overall dimensions: 220 x 160 x 80 mm
  • machine weight: 1.0 kg

The design of the machine makes it easy to mount the regulator under the work table. And by installing a microswitch under the lowering / lifting mechanism, you can get automatic control.

The controller is based on the ATMEGA88 microcontroller . LED indicator, 3 digits. The choice of indicator type (common anode or cathode) is available programmatically.

Schematic circuit.

schema

Work description.

1. Desktop illumination.

1.1. The backlight has two modes of operation: automatic (default) and manual.

1.2. The choice of operating mode manual / automatic is made in the settings, menu LA (Auto), Lr(manual mode).

1.3. Automatic backlight on/off mode.

1.3.1. When power is applied, the desktop backlight smoothly turns on to the brightness specified in the settings.

1.3.2. If during the time specified in the settings (parameter t ) no actions are performed (limit switch actuation or pressing the regulator buttons), the backlight turns off smoothly. This also turns off the indicator.

1.3.3. Any impact on the controls leads to a smooth turn on of the backlight and indicator.

1.4. Manual mode for turning on/off the backlight.

1.4.1. Manual backlight control is available in the menu: Lon – enabled, LoF – disabled.

1.4.2. The backlight is turned on by pressing the PLUS button , and the backlight is turned off by MINUS .

1.5. The rate of increase/decrease in brightness of the backlight is set in the settings (parameter c ).

1.6. The brightness is adjusted using the PLUS / MINUS buttons in the settings (the symbol L in the highest order ).

2. The operation of the speed controller.

2.1. The choice of operating mode manual / automatic is made in the settings, menu PA (auto mode), Pr(manual mode). By default, the automatic mode is set.

2.2. Automatic mode of turning on/off the speed controller.

2.1.1. When the START limit switch is closed, the rotation speed controller will smoothly supply voltage to the electric motor.

2.1.2. When the START button is opened , the power to the electric motor is turned off.

2.2. Manual mode of turning on/off the speed controller.

2.2.1. Switching on / off is done from the menu Pon – enabled, PoF – disabled.

2.2.2. Switching on is done by pressing the PLUS button , switching off – MINUS .

2.2.3. The status of the START limit switch of the speed controller is ignored.

2.3. The rate of increase in revolutions is set in the settings, parameter r .

2.4. The rotation speed is set with the PLUS / MINUS buttons from the mode of displaying the output power of the regulator (symbol P in the most significant digit).

3. Customization.

3.1. The parameter to be adjusted is selected by pressing the SET button in a circle.

3.2. Parameters for customization:

3.2.1. Turnover regulation. The most significant bit is the symbol P . Setting range 0 ÷ 99.

3.2.2. Operating mode rotation speed controller. The most significant bit is the symbol P . In the least significant digit, if the mode is automatic – the symbol A , if manual – the symbol r .

3.2.3. Manual speed control. The most significant bit is the symbol P . In the least significant digits, if enabled – symbols on , if disabled – symbols oF .

3.2.4. RPM slew rate when turned on. In the most significant bit, the character is r . Setting range 0 ÷ 99. The larger the parameter, the lower the speed.

3.2.5. Backlight brightness control. In the most significant bit, the symbol is L . Setting range 0 ÷ 99.

3.2.6. Backlight mode. In the most significant bit, the symbol is L . In the least significant digit, if the mode is automatic – the symbol A , if manual – the symbol r .

3.2.7. Manual backlight control. In the most significant bit, the symbol is L . In the least significant digits, if enabled – symbols on , if disabled – symbols oF .

3.2.8. The rate of increase / decrease in brightness when turned on / off. The most significant bit is c . Setting range 0 ÷ 99. The larger the parameter, the lower the speed.

3.2.9. The time until the backlight and indicator turn off. The most significant bit is the symbol t . Setting range 1 ÷ 99 minutes.

3.3. After 10 seconds from the last pressing of the buttons, the new parameters will be written to the memory. If the parameter is flashing on the indicator, the device switches to the main mode (output power).

4. Features of the scheme.

4.1. To select the indicator type (common anode or cathode), press and hold down the PLUS button , if the indicator is with a common anode, or MINUS , if with a common cathode, before applying power. Serve food. If the indicator type is correct, the indicator will display the symbols CC for a common cathode indicator and CA for a common anode. Release the button. If there are unclear characters on the indicator, then the wrong indicator type is selected. You need to repeat the operation.

4.2. When flashing the MK, you should install FUSE to work from the internal clock generator with a frequency of 8 MHz.

4.3. The PWM control frequency is about 32 kHz.

4.4. Power switches can be of a different type depending on the required current and load voltage.

4.5. Diode D 2 is designed to protect against reverse polarity of the supply voltage. Installed by surface mounting – in the break of the power wire.

4.6. Structurally, the regulator is assembled on two boards. The main board contains a microcontroller, an indicator, buttons and power switches. On the second board there are LEDs for desktop illumination and a microswitch. The second board is fixed next to the electric motor in such a way that the light is directed to the working area of ​​the table, and the microswitch contacts close when the drill is lowered.

4.7. The circuit and boards were developed for the parts available. The scheme is not critical to the ratings of parts and does not require adjustment.

and after revision.

P8080031P8080030

In the archive , the project in Proteus (aka the circuit), firmware, description, FUSE (internal 8 MHz generator), printed circuit boards in Proteus.

Added firmware for ATMEGA48

Fixed a bug with the indicator and light automatically turning off when the drill is turned on in manual mode.

Added tachometer and rotation speed stabilization algorithm. Functions that turned out to be useless were removed from the program (smooth overclocking, brightness control, some modes …). Detailed description in the archive. The main scheme is unchanged. An optocoupler was used as a rotation sensor (origin unknown). The photodetector receives the reflected light from the photodiode. The reflector is a strip of white self-adhesive glued around the ring on the drill chuck. Part of the strip is painted over with a black marker. The simplest comparator on the op-amp generates a signal. To connect to the main board, it uses the same connector as for the MK firmware. In the archive , the circuit and printed circuit board of the shaper.

For a more accurate measurement of rotational speed, it is advisable to set the quartz to 8 MHz and configure the FUSE accordingly.

Taho

For discussion, as well as wishes for improvement, a topic has been created on the forum .

Related Articles

Leave a Reply

Back to top button
error: Content is protected !!