The CNC machine I made works similar like other machines of this type. It is connected to serial port of IBM compatible personal computer and controlled by program written for MS WindowsĹ˝ operating system. The program transmits data from PC to machine and checks if it’s responding. The machine replies every time when operation is done or when computer asks it if it is powered on.
The program first sends coordinate for X axes, then for Y and finally for Z. After sending last coordinate also the command is sent which tells the machine what to do with drilling head. That command can send head towards PCB, it can drill a hole of certain depth, which means that the head will go down for certain distance and then move back up. It can also move head up or initialize it.
The core of machine is simple micro controller AT89C2051, which is fully filled with program, written with Bascom-8051. (By the way, thanks to mr. Mark Alberts for his wonderful program) The mcu has a lot to do. It takes care of receiving and sending data, motor direction and pulses needed by motor controller, current through motors and driller power. It also calculates it’s relative coordinates from absolute ones, sent by computer. In fact it’s really busy.
CIRCUIT DESCRIPTION
The core of our circuit is well known micro controller AT89C2951. It works at 12MHz, which isn’t ideal for baud rate generator, but it works fine. Most of I/O pins have external pull-ups except P1.1 which is used to control current flow through motor windings. Reason for this are interference’s generated by motor current control. The capacitors C13, 18 and 23 are therefor the same reason. P3.1 and P3.2 are used for PC communication.
C24 (470n) is used as reset capacitor who’s pull down resistor is in already in micro controller. I thought it makes no sense to put external electrolytic capacitor and pull down resistor in such cases. The MAX232 is also well known RS232 level converter. These two circuits are powered from +36V line via 15V zener diode and 78L05 voltage regulator. I decided for this because translators L297 generate much noise in their power line. +5V power supply for L297 must be connected externally.
I also included drilling machine’s power supply in my circuit. It is configured for 12V motor. If you use other motor voltages you should adjust components in this circuit, specially RE1, C1 and power transformer.
At the end there are motor controllers which are well described in ST’s data sheets. I should mention that JP1, JP3 and JP4 are used to set step mode of motors; half step or full step. With half step we double motor’s resolution and exclude spurious resonance, but we also loose some torque. There are also two points marked with SP1 and SP2. These are spare connections and are not used yet.
Micro controller also takes care of motor current. The voltage divider is made with resistor 2k2, and trimmer 470R. When P1.1 is low the divider is additionally pulled low via 180R resistor. This way we reduce standby current to 1/3 of full current. This way motors stay cool when the machine isn’t in use. The current through each motor is controlled with 470R trimmer potentiometers TP1, TP2 and TP3. The power loss on output chips depends on motor currents and chopper frequency. Probably you will need a smaller cooler and maybe a little fan on top of it.
The power of power supply required by our circuit depends on motors we use. In most cases the 36V/2A and 5V/0.3A PS will do fine. The cable between PC and driller is usual with two DB9 connectors, male and female. The initialization switches are normal mechanical. I decided so, because they aren’t sensible to light or dust like IR.
HOW TO CONNECT A STEPPER MOTOR?
As we know, there are two basic groups of stepper motors, looking from point of coil connections. Unipolar motor has four coils (or two coils with center connection, if you wish) and 6 wires on outside. Some of them have center of coils connected together and have only 5 wires on the outside. Bipolar stepper motors have only two coils and four wires on outside. Considering that our circuit is intended for driving bipolar motors we will have no problem connecting bipolar motor to our circuit. If we want to connect a unipolar motor then things get a little different.
Since unipolar motor has center connection on each coil, we can leave this connection free (NC) and, as you se on schematics of motor, by doing so, we transformed this motor to bipolar. Only problem is coil resistance, so we should choose this option when coil resistance is low and motor is made for low voltages (3 to 5V). If it is too high, the current won’t reach it’s nominal level and the torque will be lost (Variant 1). In this case we can disassemble motor and brake connection on middle terminal and then connect coils parallel, as it’s visible on picture, variant 3. If you don’t need motor’s full torque, you can connect it on one of the side wires and on center wire, as you can see on variant 2. Maybe someone will ask why don’t we just connect the side wires together and we would get lower resistance for variant 3 without disassembling the motor. But this won’t work, since the coils are winded bifilar and magnetic flux would be compensated.
IMPORTANT!
When disassembling motor NEVER pull the rotor out of stator! This way you will partially demagnetize the permanent magnet in rotor and motor will no longer have specified torque.
Increasing current over specified point, when the magnetic core is saturated, no longer increases torque but only thermal losses in motor, resulting in motor’s overheating and damage.
Source: arnes.si/~sspslavr/cnc_eng/cnc_eng.html CNC Drilling Machine circuit board schematic pcb code files alternative link:
Password: 320volt.com
Published: 2010/03/07 Tags: avr project, microcontroller projects
Lux Meter Circuit Atmel ATtiny26 Light Measurement
Lux meter circuit microcontroller based on Atmel attiny26-16 lux value on the LED display LED displays driven by 2sk1061 MOSFETs. An interesting application of all the source files (PCB, schematics, code) shared circuit calibration information is also given in
Lux meter circuit