P-345 T

13
59 Gerard Rushingabigwi* Department of Electrical & Electronics Engineering, KIST, 1 Av. de la’Armée P.O. Box: 3900 Kigali-Rwanda.. E-mail: [email protected] Xiaojuan Ban & Dongxing Wang Department of Computer Science and Technology, University of Science and Tech- nology, Beijing (USTB), Post Code: 100083 Beijing, P.R.China, 30 Xueyuan Road. Problems are encountered in conventional workability such as: long production circle, high production cost as well as low uniformity and instability of quality and performance, which require high accuracy. To minimize such problems in manufacturing engineering, and to experiment the microcontroller as a control tool having advantages of high accuracy, programmability, low cost and small size, this research work was carried out to simulate a control work on the dieless drawing system.The dieless drawing is a method of metal processing, which does not draw using mould like the traditional method, but which, by induction heating is used to partially heat up the metal wires to a higher temperature (Pan and Fan, 2002. By giving the work piece a constant drawing speed, the metal wire will come into deformation at the heated area. Through cool water, the partial deformation can be controlled to obtain the desirable cross-section. During this microcontroller based control work, the user gives digital control commands to the microcontroller which controls the step motor according to the given com- mands, thus controlling the cooling system’s gap against the work piece. The microcontroller must return the control information to the user who, according to that feedback, readjusts the next inputs issued to the microcontroller.Through repetitive inputs by the user and readjustments of the control instructions, the precise positioning of the cooling system is successfully realized to simulate the dieless drawing process. The experiments for this work show that the microcon- troller is good at controlling the step motor when the problems of overshooting and step loosing are properly solved. The gap between the cooling system and the heated work piece was accurately adjusted in such a way that the cooling system run by the step motor is positioned accordingly by manipulating the speed of the motor during coding. Microcontroller, dieless drawing system, 2-phase step motor, embedded systems Microcontroller based motor control system for the dieless drawing process ABSTRACT KEYWORDS KIST Journal of Science and Technology Volume 1 Number 1 KJST 1 (1) pp. 59-71 © 2011 *Corresponding author Cellophone: +250785469187 or 0725032674. E-mail: [email protected]

description

TRE_098

Transcript of P-345 T

  • 59

    Gerard Rushingabigwi*Department of Electrical & Electronics Engineering, KIST, 1 Av. de laArme P.O. Box: 3900 Kigali-Rwanda.. E-mail: [email protected]

    Xiaojuan Ban & Dongxing WangDepartment of Computer Science and Technology, University of Science and Tech-nology, Beijing (USTB), Post Code: 100083 Beijing, P.R.China, 30 Xueyuan Road.

    Problems are encountered in conventional workability such as: long production circle, high production cost as well as low uniformity and instability of quality and performance, which require high accuracy. To minimize such problems in manufacturing engineering, and to experiment the microcontroller as a control tool having advantages of high accuracy, programmability, low cost and small size, this research work was carried out to simulate a control work on the dieless drawing system. The dieless drawing is a method of metal processing, which does not draw using mould like the traditional method, but which, by induction heating is used to partially heat up the metal wires to a higher temperature (Pan and Fan, 2002. By giving the work piece a constant drawing speed, the metal wire will come into deformation at the heated area. Through cool water, the partial deformation can be controlled to obtain the desirable cross-section. During this microcontroller based control work, the user gives digital control commands to the microcontroller which controls the step motor according to the given com-mands, thus controlling the cooling systems gap against the work piece. The microcontroller must return the control information to the user who, according to that feedback, readjusts the next inputs issued to the microcontroller. Through repetitive inputs by the user and readjustments of the control instructions, the precise positioning of the cooling system is successfully realized to simulate the dieless drawing process. The experiments for this work show that the microcon-troller is good at controlling the step motor when the problems of overshooting and step loosing are properly solved. The gap between the cooling system and the heated work piece was accurately adjusted in such a way that the cooling system run by the step motor is positioned accordingly by manipulating the speed of the motor during coding.

    Microcontroller, dieless drawing system, 2-phase step motor, embedded systems

    Microcontroller based motor control system for the dieless drawing process

    ABSTRACT KEYWORDS

    KIST Journal of Science and TechnologyVolume 1 Number 1

    KJST 1 (1) pp. 59-71 2011

    *Corresponding authorCellophone: +250785469187 or 0725032674. E-mail: [email protected]

  • 60

    INTRODUCTION Microcontrollers are found in almost all smart electronic devices. From microwaves to auto-motive braking systems, they are doing jobs that make peoples lives more convenient and safer. Microcontrollers are essentially small comput-ers. Unlike the desktop computer, microcon-trollers interact with other machines rather than humans. A microcontroller might be used to control the temperature of a toast at break-fast and when the temperature reaches a pre-determined measure, the toaster could be au-tomatically turned off. A microcontroller could also be used to count the number of customers entering the ball park through a turnstile, there-by keeping track of ticket sales (Martin, 2002).The microcontroller is utilized in this work to control the speed of a hybrid step motor be-cause the gap between the step motor-driven cooling system and the work piece needs to be precisely controlled. During dieless drawing process, a tube is fixed at one end, heated and cooled at a part. It is then pulled at the other end with a certain tensile force, allowing the heater and cooler to move in the opposite di-rection, with all movements being motivated by the step motor.

    Through repetitive inputs and readjustments of the control instructions, the accurate position-ing of the cooling system is successfully realized. The microcontroller commands the running of the step motor, the communication being made through the proper motor drive. On the other side, the microcontroller communicates with a computer through the RS232 serial ports (Zhou, 2009).

    METHODOLOGYDifferent control methods were reviewed such as intelligent control method, microcontroller control method, etc. Finally a microcontroller control method was chosen to be utilized in this work after assessing different process control modes and finding that On/Off process control mode is suitable for the microcontroller based on the control of the step motor.

    Intelligent control method is any system that is able to effectively access, transmit, process, re-cycle and use information, in any given environ-ment to successfully achieve the intended pur-pose. The intelligent core is a thinking activity based on whats known as inference engine. With the inference engine or simply if .. then state-ment while programming, the purpose of intel-ligent technologies is to design and manufacture the high level of artificial intelligence systems to serve the community according to the needs. Such systems can be used to carry out various tasks even more accurately than human beings (Michael, 2005; Cai, 2003, 2002).

    A microcontroller is a miniature computer that can be found in all kinds of controllable devices. As examples, peoples everyday materials like mi-crowave ovens, digital radio sets, mobile phones, etc have inbuilt microcontrollers. If the device has buttons and a digital display, chances are that it also has a programmable microcontroller.Loading a program into a microcontroller

    This is to demonstrate how programs are loaded into a microcontrollers memory as shown in Fig.

    Fig. 1. The flowchart of a program into a microcontroller

    Gerard Rushingabigwi, Xiaojuan Ban & Dongxing Wang

  • 61

    1. The microcontroller being set to communicate with the personal computer as the first step, a microcontroller program is written and saved as ASCII text, then saved with any name ending with dot c. The written and saved program is compiled to check for errors and if there are no errors, it is translated into microcontroller ma-chine language by the C-programming language known as a compiler. Finally, the program is load-ed by the programmer into a microcontroller which is an integrated circuit on a breadboard; thats when the program loading takes effects and the desired actions are observed on the mi-crocontroller that performs the wanted tasks.

    After choosing STC89C51/RD+Series Micro-controller, the manufacturers recommended users to program this in C language under the environment of Keil Micro vision, or simply Keil Vision IDE (Beijing blue ocean micro-chip tech-nology, 2009). The Vision IDE is the easiest cur-rent way for most developers to create embed-ded applications in C language.

    Survey across the process control modesThe Process Control is an act of measuring in-puts and taking action based on those inputs. The type of reaction that takes place upon evalu-ation of the inputs during such an act defines the process control mode.

    Five common process control modes as men-tioned in the Table 1 are On/Off, Differential Gap, Proportional, Integral, and Derivative; while for the PID is a combination of the three modes (Proportional-integral-Derivative).On-Off control

    On/Off control is the simplest of the five con-trol modes. Full output action is taken based on whether the measured value is above or below the desired value. As a result, the output action drives the measurement back towards the set point. When the measured value passes the set point, the error polarity changes and the out-put is driven fully to the opposite direction. The process cycles back and forth past the set point based on this action. At an incubator for exam-ple, it needs to maintain the temperature be-tween 100C and 110C. To get a median value, a set point of 105C may be used. If temperature falls below 105C, the heater will turn on. At 105C or above, the heater will shut off.On/Off control is suitable for processes that have large capacity, sluggish response, and a rela-tively constant level of disturbance.

    Differential-gap controlDifferential-gap control is similar to On/Off control in that only full output action is taken. Differential gap control does not take this ac-

    Microcontroller based motor control system for the dieless drawing process

    Table1. The fundamental characteristic of the process control modes

  • 62

    tion based on a single desired set point. Instead, it defines an upper and lower tolerable limit. When the measured value goes beyond a limit, full appropriate action is taken and maintained until the measured value is driven to the op-posite limit. Full opposite action is then taken to drive the process back to the other limit. Therefore, the process is cycled between the upper and lower limit. The rate of this cycling is determined by the overall speed of response of the process. The differential-gap mode of con-trol is appropriate when the process is large and sluggish.

    To demonstrate differential gap control in the same incubator example, if a desired set point of 105 2C is defined, the heater will en-ergize when temperature drops to 103C and turn off when temperature exceeds 107C

    Derivative & integral controlDerivative control adjusts the drive based on the rate of change of the error. For the above example, the faster the temperature drops, the greater the amount of drive. Or conversely, the faster it rises the more the drive will be reduced. Derivative control by itself is not useful because output drive is only determined by the rate of error signal, but when combined with propor-tional control the combination can be effective

    at quickly compensating for a disturbance. This is known as proportional plus derivative control (PD control). PD control mode is effective for small capacity, rapidly changing processes where disturbances happen quickly and at high magni-tudes. A rapidly decreasing temperature in the incubator would indicate that the door may have been opened. Derivative control would drive the heater hard in an effort to compensate for the anticipated further drop in temperature. As a programmer, a method must be developed to evaluate the derivative or rate of change of the error signal. This rate is then taken into ac-count in the control evaluation (Carbondale, 1999, 2000). After surveying five common pro-cess control modes, the on-off process control method is suitable for this work.

    The dieless drawing systemDieless drawing forming process is a frictionless thermal processing technology that aims at get-ting enough cross-section shrinkage. This form-ing process is suitable for high-friction, hard ma-terials and wire forming (Kawaguchi, 1991).Looking at an example of optical fiber manu-facturing as illustrated in Fig.2, the process is so complex that it is done into two steps: mak-ing the preform, then drawing (Shotwell, 1999). The size of the fiber is monitored as it is pulled through the neck, and adjustments are made to

    Fig.2. Optical fibers drawing process

    Gerard Rushingabigwi, Xiaojuan Ban & Dongxing Wang

  • 63

    the temperature of the preform and the speed of the drawing so that the size of the fiber is constant.

    Industrial application of the step motor in the dieless drawing process.

    The step motors have found their place in many different applications such as printers, plotters, hard disk drives, medical equipment, fax ma-chines, automotive and many more. Before dis-cussing the role of the step motor for the die-less drawing system, it is important to look at some characteristics of step motors. These in-clude step motors are constant power devices; as motor speed increases, torque decreases; the torque curve may be extended by using current limiting drivers and increasing the driving volt-age; step motors exhibit more vibration than other motor types, as the discrete step tends to snap the rotor from one position to another, although this vibration can become very bad at some speeds causing the motor to lose torque; and, a step motor is a good choice when con-trolled movements are required.

    Fig.3. Image of the dieless drawing water cooling system.

    In this work, the two phase hybrid step motor is utilized for the intelligent dieless drawing sys-tem, and Fig.3 shows how the cooling system shall be moved from one place to another. The cold water that is contained in an elevated water source is pumped down and this pumped water is stored into a container that will be moving towards and backwards to the heated part of the work piece. The heating source generates the heat energy transmitted by a heating resist-ance (heater) surrounding the rod to be drawn or pulled. As the heat energy and the cooling wa-ter are both needed for the quality of the work piece (rod), the gap of about 10 to 20mm must be maintained and this is the core of this work.

    Design of a precise positioning system

    The main objective of this design is to utilize a microcontroller to drive a hybrid step motor that will move forward and backward accord-ing to the needs. The pulses of this motor must be controlled in terms of rotational frequency versus time, and finally the instructions given to

    Microcontroller based motor control system for the dieless drawing process

  • 64

    the microcontroller must be adjusted in order to maintain the wanted gap between the cooler and the work piece.

    It is a simulation control whereby the upper ma-chine of the dieless drawing system is mimicked by the user who gives the hexadecimal digital instruction to the lower system made of the microcontroller system; and the lower machine must process the given instruction to run the motor, then it reports back the results to the user.

    The role of this system is to accurately position the cooling device that needs to be dynamic dur-ing the dieless drawing process and this is done by controlling a step motor. The design of a pre-cise positioning system is shown in Fig.4 where the microcontroller known as lower machine receives programmed instructions and notifies back to the user to have received and processed the offered instructions. Of course the micro-

    controller is on electronic breadboard or simply the printed circuit that facilitates the connection with the step motor through the motor drive. Very quickly as the microcontroller receives the programs instructions, it executes these in-structions by running the step motor and simul-taneously returns the feedback to the user who stands for the upper dieless drawing system during this simulation work. The supervisory computer is there to for modifications of the microcontroller program and for other simula-tion manipulations.

    Through repetitive inputs by the user and re-adjustments of the control instructions, the accurate positioning of the cooling system is successfully realized to simulate the dieless drawing process. From the users inputs, the up-per machine structure or dieless drawing sys-tem which is a constructed intelligent control system, must give the relevant instructions (to run or stop) to the lower machine system, as

    Fig.4. A simulative design of a precise positioning system.

    Gerard Rushingabigwi, Xiaojuan Ban & Dongxing Wang

  • 65

    well as the rotation parameters (rotational or angular direction). The upper-to-lower machine data is always exchanged through the RS232 se-rial port of a PC. The upper machine structure will receive the control instructions and running parameters transmitted by the lower machine structure. After the lower machine structure executes instructions, the feedback information will be given to the upper machine or dieless drawing system.

    Experimental workFirstly there is need to select the electric cur-rent of 2.4A as specified by manufacturers of the step motor. After setting the rated electric current on the motor drive (Chawakorn, 2008), the switches on this motor drive must be set as off-on-off as shown by Fig. 5

    The program allowing communication of the mi-crocontroller with the step motor through the motor drive is simplified by the flow diagram shown in Fig. 6. The connection of the micro-

    Fig. 6. The flow diagram for the communication of the microcontroller with the step motor

    Fig. 5. Setting of the motor drive

    Microcontroller based motor control system for the dieless drawing process

  • 66

    controller to the computer is done through the RS232 serial port. When the program is com-piled and run with the command of 2F given into the command window, the instruction is processed by the microcontroller and a back-report is displayed to the user as 2F (same as the input) followed by 00 to mean the success of a command.

    It is of great importance to show how the micro-controllers programs are coded. This is shown by a code put in appendix; the program cannot run unless some bugs are removed.

    The motor starts accelerating from the initial frequency f0, the current frequency changes once for each pulse in accordance with the frequency-dependent function, until it reaches a stable operating specified frequency which is the end of acceleration process.

    The code running and explanationsWhen the written code is debugged and run, hexadecimal instructions are given to the mi-crocontroller into the command window. The microcontroller must process the commands and in a short while send the feed-back informa-tion to the user; these instructions are the same as those it would communicate with the upper control machine (Carbondale, 1999, 2000).

    A small portion taken from the appendix code helps to understand the digital instructions given to the microcontroller:

    1) case 0x1: P01 = 1; runFlag = 1; break; // The motor runs in forward direction, notably when 1 is followed by a hexadecimal digit put in the command window, 1F for example. 2) case 0x2: P01 = 0; runFlag = 1; break; // The motor runs in opposite or backward direction,

    notably when 2 is followed by a hexadecimal dig-it put in the command window, 2F for example. 3) case 0x3: runFlag = 0; break; // The motor stops, notably when 3 is followed by a hexadeci-mal digit put in the command window, 3F for example.

    The pictured window in Fig. 7 shows the results displayed to the user when the instructions 1), 2) and 3) are respectively given to the microcon-troller. The target is to attain a high speed and a quick response for the basic requirements of On/Off control mode; this is attained when F is given as hexadecimal digit.

    The encountered problems and solutionsDuring the running of the step motor, so as to position the cooling system very well, two prob-lems were encountered. These were: overshoot-ing or vibration as the motor starts or stops; and step-loosing. To solve the problems two methods were utilized: the motor drive micro-stepping technology; and the coding method.

    A. The motor drive micro-stepping technology One eighth (1/8) micro-stepping was chosen ac-cording to the motors specifications in order to reduce the step motors stepping angle, thus reducing the vibration, with the basic concept of step motor drives micro-stepping. The motor drive micro stepping technology, as shown in Fig. 8, is just to minimize the overshooting problem but does not completely remove it. When this micro-stepping technology is not practiced, the overshooting becomes so severe that the step motor looses steps which lead to the unwanted stopping of the motor.

    B. The software methodBy coding, the non-linear pulse control of the

    Gerard Rushingabigwi, Xiaojuan Ban & Dongxing Wang

    Fig. 7 Results displayed

  • 67

    step motor can be achieved so as to get the non-linear speed, especially when the step mo-tor is starting and stopping, as shown in the Fig. 9.

    Here the source code is manipulated, and ac-cording to calculations with reference to the commonly known formula shown in Equation 2 (Hui., 2008; Wang, 2008; Zhou, 2009), the vibra-tion and overshoot problems were completely

    Fig. 8. The step motor drives 1/8th micro-stepping

    Fig. 9. The frequency dependency curve for both speeding up& speeding down processes.

    Microcontroller based motor control system for the dieless drawing process

  • 68

    corresponding to the motors frequency of 7.68 KHz that gives the counter of initial value of:During practices, for example, with the initial value count of 65229 that corresponds to the smallest motor frequency of 3 KHz, the rota-tional speed is so high that the microcontroller gets confused and doesnt obey the commands, which leads to errors in the precise positioning of the cooler especially when the bigger hexa-

    Gerard Rushingabigwi, Xiaojuan Ban & Dongxing Wang

    solved

    The value of 65535 is considered instead of 65536 simply because counting in this work starts from 0 not from 1. After making a number of calculations by the formula shown in Equation 2 above, and trying several times running the motor, a better positioning of the dieless draw-ings cooler is found. The good rotational mo-ment (torque) is obtained with the nth trial; it is

    Let

    Table 2 Data for the step motor speeding up & speeding down processes

  • 69

    decimal instruction (F) is given.

    Observed from data in Fig. 10, the microcontroller runs the stepper motor twice (1F 1F or 2F 2F) be-fore reporting back (00) to the user. This is bad and is not recommended for the precise positioning of the cooler.

    Taking the initial value count of 65413, the speed is moderate: neither low nor high and as the code is run, instructions given in hexadecimal digits, the good wanted speed is observed and the desired gap main-tained. Fig.11 illustrates 4 trials that are made in one direction. The direction is shown by the first digit while for the second digit is talking about the running speed of the step motor. Results are said to be good because the motor runs with a moderate speed, this is testified by the feedback to user given once as 00 by the microcontroller at every offered instruction..

    These results mean that the initial value count in the source code must be fixed to 65415 or 65535-120 corresponding to the frequency of 7.68KHz and the control flags value is fixed to E in both forward and backward rotation.

    RESULTS AND DISCUSSIONA microcontroller is utilized to control the pulses of a two-phase hybrid step motor which plays the role of changing positions of the cooling system so as to ensure efficient operations for the drawing process.

    This is successfully achieved through simulation per-formed with a microcontroller and a step motor as the main materials. The microcontroller is first config-ured with the personal computer through the RS232 serial ports and then a program is written, compiled and run in accord with microcontroller to drive the step motor (Chandy, 2008; Carbondale, 1999, 2000). The microcontroller communicates with the step mo-tor through the motor drive that is properly micro stepped to minimize the problem of overshooting. Though overshooting is normal to the step motors functioning because of inertia, it causes the step loos-ing unless minimized.

    The big challenge is about the problems of overshoot-ing and vibration which are however solved. The vibra-tion is the inevitable working principle of step mo-tors especially while it is stepping to another pulse. It means that the stepper motor rotates according to the initially set angle of rotation. The step-losing phenomenon occurs when the step motor is not nor-mally started. Normally, the speed of stepper motor requires the direct starting just because the corre-sponding frequency must not exceed the utmost limit of the starting frequency (Hui, 2008). The immediate motor start up and the final critical stopping point are the motor running stages certainly characterized by overshooting phenomenon just because of inertia reasons (Wang, 2008).

    To solve the problems, the motor drives micro step-ping technology and coding methods are the two ways

    Fig.10. The bad result in case of extra high motor speed.

    Fig.11. Good results to control the gap of 10-20mm.

    Microcontroller based motor control system for the dieless drawing process

  • 70

    Gerard Rushingabigwi, Xiaojuan Ban & Dongxing Wang

    REFERENCES

    Beijing Blue Ocean Microchip Co., Ltd, 2009. LJD-SY-5100 experimental development boards manual to the user. See more at http://www.bluemcu.com/en/company.asppp.Cai, Z., 2003, Artificial Intelligence and Applications. Tsinghua University Press, pp. 73-121.Carbondale, 1999, 2000. Application of microcontrollers. Electronics management labs. At http://www.technology.heartland.edu/faculty/ chrism/automation and control/siulabs.pdf [Accessed in April 2010] Chawakorn, Y., 2008. Microstepping Bipolar Drive of Two-Phase Hybrid Stepping Motor on TMS320F2808 DSC. Application report. Dallas, Texas 75265. USA. Available online at http:// www.ti.com. [Lastly accessed on 14 October 2011]Hui, T. et al., 2008. Microcontroller and Serial ports communication to drive the step motor. Jianchuan Science and technology. Hubei, Wuhan 430064. ChinaJohn, A., 2008. Microcontroller Introduction. University of Connecticut. Available at http://www.engr.uconn.edu/~chandy/courses/ 110s08/L01/Intro ToMicrocontrollers-012408.pdf. [Lastly accessed on 12 October 2011]Kawaguchi, Y. et al., 1991. Applications of dieless drawing to. Ti-Ni wire drawing and tapered steel wire manufacturing. (Wire Journal International paper available in the Internet)Martin, D., 2002. An introduction to PIC microcontrollers, Available at http://www. many ppt.com/05/An-Introduction-to-PIC- Microcontrollers.html.Spring2002Michael, N., 2005. Artificial Intelligence Intelligent System guide, Beijing Electromechanical & Industrial publisher. Pan, Y. and Fan, L., 2002. Research on shape memory alloys and applications, Masters Thesis. Suzhou Universitys academic journal. China.Shotwell, A., 1999. An introduction to fiber optics, New Delhi: Prentice Hall of India.Wang, Y. et al., 2008. Control System Design of Acceleration and Deceleration curves of Stepping motor and its Applications. Zhao, H. et al, 2009. Design of Micro stepping of the Motor Drive by FPGA, Instrument Technique and Sensor. Available online at http://g.wanfangdata.com.cn. [lastly accessed on 14 October 2011]Zhou, Y., 2009. Research on Step motors positioning technology, Masters Thesis. Dalian Jiaotong University. China

    utilized and as a result by running and observing the motor, its clearly found that the vibration phenom-enon at the beginning and stopping of the step motor is alleviated up to 90%. The speed on the step motor during operation is worthy of discussion: when the run Flags information (or duration of how long and how far the step motor must go) is not big enough, the motor will get so confused that it runs twice, which is not good for the purpose of the precise posi-tioning of the dieless drawing systems cooling system. The speed problem is solved by fixing a hexadecimal digit F to be the runFlag in the coded instructions.

    CONCLUSIONIn this work, a microcontroller was utilized to control the pulses of a two-phase hybrid step motor, the big task being to precisely position the cooling device in the needed location, near or far away from the heated work piece.

    The STC89C51/RD+ Series microcontroller like all the other embedded works are recommended to be programmed in C language under the environment of Keil Micro vision2 IDE Environment.

    The precise positioning system which is designed for the cooler that needs dynamic operation during the dieless drawing process is implemented by controlling pulses of the step motor. The step motor and its drive communicate with the computer through the RS232 serial ports, and the work here was done by simula-tion using the Microcontroller. The precise manipula-tion of the step motor encounters the overshooting and vibration phenomena which severely affect the accurate positioning of the cooling system. These problems were practically solved by both the motor drives micro-stepping technology and the software method (coding) to achieve the non-linear pulse con-trol method.

    From this work, it is evident that various commands can be executed by a small control and simulation unit. As a result, the microcontroller unit can drive a step motor very well. The microcontroller has been an excellent tool at the control of the step motor dur-ing the simulation work on precise positioning of the dieless drawing systems cooler, and the problems of overshooting and step loosing of the step motor due to inertia were properly solved by the micro-stepping technique of the motor drive, and by non-linear pulse

  • 71

    }switch(controlFlag){case 0x10:P01=1; runFlag=1; P02=1; break; // forward directioncase 0x20:P01=0;runFlag=1;P02=1;break; // opposite directioncase 0x30:runFlag=0;FM=1;P02=1;break; //stop the motorcase 0x40:P02=0;FM=1;break; //out of controldefault:;}controlFlag=0;if(time>controlCounter*300){time=0;runFlag=0;SBUF=0x00;FM=1;}if(TF0==1){TF0=0;TH0=(65535-120)/256;TL0=(65535-120)%256;if(runFlag==1){P00=0;time++;FM=0;}}else{P00=1;}}return;}

    APPENDIX:

    Coding for microcontrollerThe code was written with fixed values of: Crystal oscillator: 11.0592MHz; Baud rate 9600.# Include reg51.h # Define uchar unsigned char # Define uint unsigned int sbit FM = P3 ^ 7; sbit ch451_din = P1 ^ 0; sbit ch451_dclk = P1 ^ 1; sbit ch451_load = P1 ^ 2; sbit ch451_dout = P3 ^ 3; sbit P00 = P0 ^ 0; sbit P01 = P0 ^ 1; sbit P02 = P0 ^ 2; sbit P03 = P0 ^ 3; sbit P04 = P0 ^ 4; sbit P05 = P0 ^ 5; sbit P06 = P0 ^ 6; sbit P07 = P0 ^ 7; /*

    This Program is allowing the communication between the present microchip and the PC through the mo-tor drive. It stands for the non-linear speeding up and speeding down process. The timer 0 is a pulse maker. We need the control flag as value that helps to deal with conditional expressions; a control flag is used to determine when the looping process must stop.*/ void initialization(){SCON=0x50;TMOD = 0x21;TH0=(65535-120)/256; //set the initial parameter to timer 0 on the high 8 bitTL0=(65535-120)%256; //set the initial parameter to timer 0 on the low 8 bitTR0=1;T0=1;EA = 1;ES=1;P00=1; //pulses serial portP01=0; //directions serial portP02=1; //out of controls serial port} // this is the main function; it is the systems entrance.void main(){initialization();while(1){if(RI){RI=0;varReciever=SBUF;SBUF=varReciever;controlFlag=varReciever&0xf0;controlCounter=varReciever&0x0f;

    Microcontroller based motor control system for the dieless drawing process