Login| Sign Up| Help| Contact|

Patent Searching and Data


Title:
CONTROL AND PROTECTION METHODOLOGIES FOR A MOTOR CONTROL MODULE
Document Type and Number:
WIPO Patent Application WO/2007/044930
Kind Code:
A3
Abstract:
A motor control module 100 designed to control operation of a plurality of different motors in a plurality of different tools. A power tool may be integrated with a switch. The control module may use an electronic clutch in the module 100 in conjunction with a mechanical clutch in the tool to protect the tool against an overload event. The module is adapted to implement methods to provide aural and /or tactile feedback to a tool user as a warning of an impending or current fault condition in the tool. The module can preven power from inadvertently turning on either after an overload event has cleared with the tool plugged in and its power switch on, or aft plugging in the tool with the power switch on. The control module is adapted to provide torque control for the power tool, to estimate tool motor temperature and to inform a tool user when a servicing need in the tool is required.

Inventors:
WOODS SAMUEL G (US)
FORSTER MIKE (US)
KONONENKO GEORGE O (US)
LEH JASON K (US)
BRADUS ROBERT (US)
BEARS DAVID (US)
VANKO JOHN C
PRIVETT ZOLLIE W (US)
Application Number:
PCT/US2006/040254
Publication Date:
December 27, 2007
Filing Date:
October 12, 2006
Export Citation:
Click for automatic bibliography generation   Help
Assignee:
BLACK & DECKER INC
WOODS SAMUEL G (US)
FORSTER MIKE (US)
KONONENKO GEORGE O (US)
LEH JASON K (US)
BRADUS ROBERT (US)
BEARS DAVID (US)
VANKO JOHN C
PRIVETT ZOLLIE W (US)
International Classes:
H02P7/00; H02H3/00; H02H7/00; H02H7/08; H02K17/32; H02K23/68; H02K27/20; H02K27/28; H02K27/30
Foreign References:
US6017354A2000-01-25
Other References:
See also references of EP 1961109A4
Attorney, Agent or Firm:
KEY Joseph F. et al. (701 E. Joppa RoadTowson, MD, US)
Download PDF:
Claims:

What is claimed:

1. A power tool, comprising: a tool motor, a control module integrated with a switch, wherein the control module is configured and arranged to be programmable to control the tool motor for more than one different power tool.

2. The power tool of claim 1 , wherein the control module includes an electronic clutch for detecting a fault condition in the tool signifying an overload event, and including a microcontroller for controlling the electronic clutch and for initiating a protective action to remove or reduce power to the tool motor based on the detected fault condition.

Description:

CONTROL AND PROTECTION METHODOLOGIES FORA MOTOR CONTROL

MODULE

PRIORITY STATEMENT

This application claims the benefit under 35 U. S. C. §119(e) to United States Provisional Patent Applications Serial No. 60/726,011 , filed October 12, 2005 to Samuel G. WOODS et al. and entitled "UNIVERSAL CONTROL MODULE", and Serial No. 60/817,085, filed June 29, 2006 to Samuel G. WOODS et al. and entitled "CONTROL AND PROTECTION METHODOLOGIES FOR A MOTOR CONTROL MODULE". The entire contents of each provisional application are hereby incorporated by reference herein.

BACKGROUND

Technical Field

[0001] Example embodiments in general relate to control and protection methodologies provided by a control module designed to control operation of a motor and implemented as part of a switch, so as to protect the motor and an associated electrical device such as a power tool that is powered by the motor. Description of the Related Art

[0002] Typically, motors are controlled by dedicated analog or digital circuitry controlling the motor for a given application. For example, a dedicated circuit may be required to control a given motor utilized in an application for an electrical device such as a power saw application, while another dedicated circuit may be required to control a different motor utilized in another power tool application such as a drill application. The dedicated analog or digital control circuit is typically constructed of different components. These components often have differing values, tolerances and/or control software to create a unique operational characteristic profile for a given motor and/or given motor application.

SUMMARY

[0003] Example embodiments are directed to control and protection methodologies of a motor control module which controls operation of a motor, such

as a tool motor of a corded power tool, and where the functionality of the control module are implemented as part of a switch, for example, the switch of the power tool. In one example, the control module includes an electronic clutch for protecting the tool against an overload event. The electronic clutch in the module is usable with a mechanical clutch in the tool to protect the tool against an overload event. Other protection methodologies in the module include methods to provide aural and/or tactile feedback to a user of the tool as a warning of an impending or current fault condition in the tool. This may be done by pulsing the tool motor, or by folding back voltage applied to the tool motor (motor foldback). Pulsing and motor foldback may be invoked by a microprocessor in the control module controlling a triac in the module to alter or change the voltage applied to the tool motor. [0004] Another protection methodology of the control module prevents power from inadvertently turning on either after an overload event has cleared with the tool plugged in and its power switch on, or after plugging in the tool within the power switch on. A further protection methodology in the module provides torque control for the power tool using motor foldback if a measured torque reaches a given setpoint.

[0005] In another example, control methodologies in the control module can estimate tool motor temperature, including tool motor temperature upon tool startup, or can inform a tool user when a servicing need in the corded power tool is required. In a further example, the control module is configurable to control a plurality of different motors in a plurality of different tools. The control module includes a microprocessor configured to execute a plurality of different protection or control functions to control a tool motor, and includes at least one memory for storing a plurality of soft-coded coefficients which can be set so as to enable or disable selected ones of the different protection or control functions in the module. The soft- coded coefficients include a plurality of different selectable inputs that can be set as the input to a given selected function, and include a plurality of different selectable outputs that can be set as the output from a given selected function. [0006] The module includes a controller and a triac for controlling current to the given tool motor. The module can implement a plurality of control methodologies,

including methodologies related to synchronizing the module to the AC input signal, estimating average current flowing through the triac, compensating for amplifier offset to improve accuracy of current measurements in the module, and providing speed measurement and control for the tool motor using principles of hysteresis in a comparator of the controller. Additionally, the controller is configured to calibrate an oscillation calibration register therein.

BRIEF DESCRIPTION OF THE DRAWINGS

[0007] Example embodiments will become more fully understood from the detailed description given herein below and the accompanying drawings, wherein like elements are represented by like reference numerals, which are given by way of illustration only and thus are not limitative of the example embodiments herein. [0008] FIG. 1A is a partial plan view of a power tool illustrating the control module within the tool housing, in accordance with an example embodiment. [0009] FIG. 1B is a view of a switch illustrating the control module integrated with a switch, in accordance with an example embodiment.

[0010] FIG. 1C is a view of a switch illustrating the control module integrated with a switch, in accordance with an example embodiment.

[0011] FIG. 2 is an isometric view of selected components of the tool motor within the power tool to illustrate the relation of the control module, pick-up coil assembly, auxiliary board and speed dial, in accordance with an example embodiment. [0012] FIG. 3 is an isometric view of the control module in accordance with an example embodiment.

[0013] FIG. 4 is a block diagram of an electronic component arrangement within the control module in accordance with an example embodiment. [0014] FIG. 5 is a flowchart for illustrating functionality of the absolute clutch mode, in accordance with an example embodiment.

[0015] FIG. 6 is a flowchart for illustrating functionality of the DI/DT clutch mode, in accordance with an example embodiment.

[0016] FIG. 7 is a flow chart illustrating a no-volt activation routine in accordance with an example embodiment.

[0017] FIG. 8 is a graph to illustrate tactile feedback to a power tool user as a warning mechanism of an impending or present fault condition therein.

[0018] FIG. 9 is a graph to illustrate foldback of motor voltage in a power tool.

[0019] FIG. 10A is a flow diagram illustrating a motor temperature estimation algorithm in accordance with an example embodiment.

[0020] FIG. 10B is a flow diagram to illustrate how the temperature register value

B is estimated after a loss of power or upon initial tool power-up.

[0021] FIG. 11 is a graph comparing the estimated motor temperature as calculated by the algorithm of FIG. 10A with actual measured motor field temperature for a 120V small angle grinder configured with the example control module 100.

[0022] FIG. 12 is an overview of the relationships between coefficient inputs, protection/control methodologies and devices, and coefficient outputs in accordance with the example embodiments.

[0023] FIG. 13A is a front view of a portion of gear case 16 in FIG. 1A.

[0024] FIG. 13B is a cross sectional view of line A-A in FIG. 13A to illustrate details of the mechanical clutch.

[0025] FlG. 14 is a block diagram of an electronic component arrangement within the control module in accordance with an example embodiment.

[0026] FIG. 15 is a flow diagram for illustrating a method of detecting whether the triac 1420 needs to be re-fired in the control module 100 following an initial firing of the triac 1420 from a given control methodology.

[0027] FIG. 16A is a block diagram to illustrate a zero-cross detection circuit portion of the control circuit 1400 for implementing zero cross detection.

[0028] FIG. 16B is a flow chart describing a method of detecting zero crossings of the AC supply signal to synchronize the control module 100 with the tool motor.

[0029] FIG. 17 illustrates an example circuit used in motor control module 100 to determine motor speed.

[0030] FIG. 18 illustrates an example positive half cycle of an AC voltage waveform and corresponding sampled motor current data points. [0031] FIG. 19 illustrates a positive AC voltage half-cycle and the associated half- cycle of current in the AC waveform for a purely inductive load. [0032] FIG. 20 illustrates voltage and sampled current waveforms in the positive AC half cycle for a slightly inductive load to describe a method of estimating average current in accordance with an example embodiment.

[0033] FIG. 21 illustrates voltage and the absolute value of the sampled current waveforms in the positive AC half cycle for a pure inductive load to describe a method of estimating average current in accordance with another example embodiment.

[0034] FIG. 22A is a flowchart for illustrating a method for estimating average current through the triac of the motor control module in accordance with an example embodiment.

[0035] FIG. 22B is a flowchart for illustrating a method for estimating average current through the triac of the motor control module in accordance with another example embodiment.

[0036] FIG. 22C is a flowchart for illustrating a method for estimating average current through the triac of the motor control module in accordance with another example embodiment.

DETAILED DESCRIPTION OF THE EXAMPLE EMBODIMENTS [0037] U.S. Patent No. 7,102,303 and U.S. Published Application No. 2005/0237011 are hereby incorporated by reference herein. [0038] In one exemplary implementation, a control module may be configured to provide controls for multiple different platforms. For example, the control module may be configured to operate multiple, different motors that are used in different applications. The control module may be universal such that the same structured control module may be programmable to operate in the multiple, different motors. The control module may be programmed to control a motor according to different characteristics. For example, one control module may be programmed to control a

miter saw motor, whereas another control module may be programmed to control a sander motor. The control module, however, remains the same. The control module or at least the functionality of the control module, described more fully below, may be integrated with a switch.

[0039] As to be described in detail hereafter, example embodiments are directed to control and/or protection methodologies implemented by the electronic circuit within a motor control module of an electronic device. In one example, the electronic device may be a corded power tool having a tool motor powered by an AC source voltage for driving a work piece or accessory of the power tool. The example embodiments hereafter describe control or protection methodologies as related to and including, but not limited to: power tool startup, overload or fault events which exceed one or more of a voltage, speed, current, torque and/or temperature threshold, and warning mechanisms which may alert a tool user of an impending fault and/or overload condition. In order to provide context for the example methodologies described hereafter, the inventors initially provide an overview of an example power device with control module, and an example block diagram of the control module's electronics.

[0040] FIG. 1 A is a partial plan view of a power tool illustrating a control module within a housing of the tool, in accordance with an example embodiment. Referring to FIG.1 , power tool 10 is shown embodied as a rotary, corded power tool 10, it being understood that the example embodiments are applicable to power tools other than rotary, corded power tools. In the example of FIG. 1A, power tool 10 is shown as an angle grinder powered by AC line power via a power cord 21. The angle grinder 10 includes a knurled clamp nut 12 within an accessory guard 14 for receiving a tool workpiece or accessory powered by the tool motor. In this example, the accessory may be a rotary accessory such as grinding disc (not shown). The grinding disc is attachable via a spindle to gear case 16, which is secured to tool housing 18.

[0041] Gear case 16 also includes a mechanical clutch (not shown in FIG. 1A for clarity) for removing inertia in the system upon some detected fault condition. In one example, the mechanical clutch may be embodied as a cone clutch which rides

inside a cone washer, and may include a thrust washer. The mechanical clutch is configured to remove inertia within gear case 16. In an example, the mechanical clutch actuates based on torque exceeding some set point, such as 100 in-lb for example. A detailed explanation of mechanical clutch operation is omitted for purposes of brevity.

[0042] FIG. 13A is a front view of a portion of gear case 16, and FIG. 13B is a cross sectional view of line A-A in FIG. 13A to illustrate details of the mechanical clutch. In FIG. 13A, a front view of the gear case 16 is shown with a gear case cover removed so as to illustrate gears 1304. Additionally, a spindle lock button 1302 is provided on the side of the gear case 16. The spindle lock button 1302 engages a spindle lock used to lock the spindle of the power tool 10 to allow for accessories to be replaced or removed thereon.

[0043] Referring to FIG. 13B, which is the sectional view across section A - A in FIG. 13A, the spindle 1308 is shown penetrating the gear case 16 through outer spindle bearings 1320 and inner spindle bearings 1322 to terminate at a nut 1318. The spindle bearings 1320, 1322 enable radial movement of the spindle 1308 as is known in the art. The mechanical clutch 1310 may be comprised of the cone clutch 1312, a pair of Belleville springs 1314, a washer 1316 and nut 1318. The mechanical clutch 1310 actuates in the event of a fault, such as a sudden stall of the tool, which could be due to an overload condition, bound accessory, etc. The mechanical clutch 1310 thus protects the user by loading down the gears 1304 so as to remove or release inertia from the system. Also shown in FIG. 13B is the spindle lock 1306, which may be engaged through a pin 1305 by actuation of the spindle lock button 1302. In FIG. 13B, the spindle 1308 is shown in an unlocked position. [0044] The cone clutch 1312 is a double D fit (i.e., lock) and has side surfaces with a slightly inclined angle. Although not shown in FIG. 13B to illustrate the components of the mechanical clutch 1310, the gear 1304 is slip fit over the spindle 1308. When a load is applied to the spindle 1308 (such as in the event of a fault such as sudden stall due to an overload condition, bound accessory, etc.) the cone clutch 1312 becomes biased against the Belleville springs 1314, compressing the Belleville springs 1314 against the washer 1316 and nut 1318. This provides a force

against the gear 1304 so as to load down the gear 1306 in order to release or remove inertia from the system. As the operation of a mechanical clutch for a power tool is known in the art, further detailed discussion is omitted for purposes of brevity. [0045] Referring to FIG. 1A, tool housing 18 is shown with part of the outer shell removed, so as to illustrate a universal control module 100 ('control module') in proximate relationship to a magnetic collar 22 and a commutator ring 24 of a motor armature 20. The control module 100 is designed for controlling the operation of a plurality of motors and/or configured for a plurality of different motor applications (e.g. different power tools).

[0046] Additionally in FIG. 1A, there is shown an auxiliary board 200 supporting a pick-up coil assembly 250 and a variable speed dial wheel 270. As part of an assembly connected to the control module 100 within the power tool 10, the auxiliary board 200 may be included within the tool housing 18. One function of the auxiliary board 200 is it allows custom configuration of pick-up coil and variable speed dial as dictated by power tool design requirements. The pick-up coil assembly 250 is attachable to the auxiliary board 200 and configured to detect motor speed. The variable speed dial wheel 270 is operable by the user in order to set and/or change to the desired motor speed.

[0047] Referring to FIGS. 1 B and 1C, a control module 100 and/or the functionality of the control module may be the control module may be integrated with a switch 193 (FIG. 1B) or 195 (FIG. 1C). One benefit would be a single electrical component which would require less space and also dramatically simplify the wire up of a power tool application. Another benefit would be that all of the features of the control module would be available to allow an integration of the control module functionality into tools that don't have room for a separate control module (i.e., a control module that is separate from the switch).

[0048] In one exemplary implementation, the switch may include a finger- operated switch, which can be a trigger switch but is not limited to being solely a trigger switch, is a user input device, but can also be a device to provide feedback to the user of a power tool.

[0049] The finger-operated switch (FOS) can be a switch with physical movement (translational or rotational, or a combination of both, in one plane or in three dimensions) or a non-moving switch. If it is a switch with physical movement, its motion can be sensed by the variation of resistance of a resistive element and a moving wiper (or vice versa), a linearly variable differential transformer, a variable capacitor, an optical means of sensing position, or any other means of sensing position and translational or rotational movement in one dimension, two dimensions, or three dimensions.

[0050] The FOS might be a non-moving switch with a pressure sensor, a strain gage, or some other force sensor. It might be molded in a soft or pliable plastic, or it might be a 'gel' switch with a gelatinous substance inside. It might be molded from a two-shot process using two different kinds of plastic, opaque and transparent, for instance.

[0051] The FOS may contain feedback to the user in the form of illumination (LEDs, lamps, laser diodes, infra-red diodes, thermoluminescence, electroluminescence, or any other means of generating light of various and sundry colors), thermal heating (a resistive heating element, to indicate the user should reduce pressure on the switch, for instance), vibration (tactile feedback to indicate some condition to the user), or audible signals (sounds as alarms, for instance), or any other kind of feedback to the user. Tool feedback may also include, but is not limited to, motor temperature, motor current, tool torque, or tool malfunction. [0052] FIG. 2 is an isometric view of selected components of the tool motor within the power tool to illustrate the relation of the control module, pick-up coil assembly, auxiliary board and speed dial, in accordance with an example embodiment. FIG. 2 illustrates the relationship between the auxiliary board 200 and its components (pickup coil assembly 250 and speed dial 270), the control module 100 and the tool motor 15, which may be comprised of a tool motor armature 20 rotating within a tool motor field 30. In an example, the auxiliary board 200, pick-up coil assembly 250 and dial wheel 270 may be collectively referred to as an 'auxiliary circuit board assembly. The auxiliary circuit board assembly is attached to the control module 100 of FIG.

1A 1 for example, with the control module 100 being adapted to control operation of the tool motor.

[0053] The tool motor armature 20 includes the magnetic collar 22 attachable via armature shaft 29 to the commutator ring 24 of the motor armature 20. The motor armature 20 output is translated to the gear case 16 via ball bearing 27 and spindle 28. Multiple magnets may be provided on the magnetic collar 22 of the motor armature 20. As the armature 20 rotates, the magnetic field from the magnets is picked up by the pick-up coil assembly 250 to give an accurate reading of motor speed. As discussed above, the complete tool motor 15 consists of tool motor armature 20 rotating within tool motor field 30.

[0054] The auxiliary board 200 may also include the variable speed dial wheel 270, which acts as a potentiometer as is known in the art. In an example, a portion of the dial wheel 270 may include a plurality of rigid detents which sit on points of a leaf spring, so as to provide aural feedback to the user. In an example, the detents contact the leaf spring to provide a tactile feedback to the user. This also serves to prevent the dial wheel 270 from moving during any tool vibration. Additionally, the use of detents may prevent the user from inadvertently changing speed, providing a readily discernible tactile feedback to the user.

[0055] FIG. 3 is an isometric view of the control module 100 in accordance with an example embodiment. Referring to FlG. 3, the control module 100 includes a top cover 110, a bottom cover 120, a spacer 130 and a printed circuit board 140 (not shown in FIG. 3). In one example, the top cover 110 may be made of a material that provides heat sinking for active power components within the control module 100, and may be cast for that function, for example. The bottom cover 120 may be configured to support control module 100 interior components and to permit potting so as to create a sealed enclosure. Additionally, the bottom cover 120 provides an area of electrical insulation for an active power device within the control module 100. [0056] The spacer 130 may be configured to hold through-hole electronic components within the control module 100 in place, such as during assembly of the control module 100. The control module 100 also may include a fastener 115 (e.g., a screw) that fastens the top cover 110 to a nut (not shown) within the module 100.

The fastener 115 may be fastened to an active power device such as a switch, a triac, electronic valve, etc., within control module 100. The top and bottom covers 110, 120 may therefore be secured together via a single fastener 115 such as a screw and nut assembly.

[0057] The control module 100 also includes a pair of quick-connect power tabs 150 and an input/output connector 160 connected to the printed circuit board 140. The quick connect power tabs 150 are sequenced to the control module 100 and may be of a different size and different length to prevent improper connection to other components, for example. In an example, the input/output connector 160 may be configured in a 12-pin arrangement, in which four (4) pins 162 are empty and not used (to provide spacing), five (5) of the pins 162 may be input/output pins, one (1) pin 162 may be a hot-wire pin and one (1) pin 162 may be a circuit ground/neutral pin. This is merely one terminal pin arrangement for input/output connector 160; other arrangements are foreseeable to the skilled artisan in accordance with the example embodiments herein.

[0058] As discussed above, the spacer 130 holds through-hole electronic components in place during assembly of the control module 100. During fabrication, there is a plurality of electronic components attached to the PCB 140. One function of the spacer 130 is to maintain components in place during wave soldering to eliminate hold down fixtures. Accordingly, the spacer 130 may be placed over the power tabs 150 during assembly to provide tolerances and also to provide electrical insulation while maintaining these tolerances between components. [0059] The spacer 130 includes a shroud portion 136 which mates onto a tab 122 of the bottom cover 120 so as to seal and enclose the input/output connector 160. The shroud portion 136 of spacer 130 may be designed to prevent debris and dust shavings from entering the control module 100's active components. [0060] Additional isolation may be provided by potting (not shown) in the spacer 130. In addition to holding active components within control module 100 in place, the potting material may have a VO flammability rating. Suitable potting materials include but are not limited to one or more of an epoxy-based encapsulant, a single or

multi-component urethane or urethane gel encapsulant, a single or multi-component silicon or silicon gel encapsulant, etc.

[0061] Accordingly, having potting as an insulator distinguishes the control module 100 with a single layer of isolation versus a non-isolated control module, for example. Additionally, thermal grease may be applied to the top surface of an active electronic component such as a FET or triac within the module 100; this is standard in the industry. In an alternative, a thermal pad (not shown) may be provided instead of the thermal grease. The thermal grease or thermal pad may be used to prevent the potting from seeping between a given active electronic component and the top cover 1 10, and may be sized as a function of active component height, for example. [0062] FIG. 4 is a block diagram of an electronic component arrangement within control module 100. One or more of the components in FIG. 4 may be integrated with a switch. The electronic components described hereafter may be arranged on the PCB 140 within the control module 100. The control module 100 includes memory 434, 436 for storing one or more soft-coded function coefficients used during execution of various functions or algorithms. Since a given soft-coded function coefficient may be specific to a particular tool application, the control module 100 may be suitable for controlling the operation of a plurality of motors and/or for a plurality of different motor applications (e.g. different power tools). The soft-coded coefficients can be understood to include coefficient inputs into a given function or algorithm to be performed by the control module 100, and include function coefficients that may be changed or varied for a given tool or tool application. The soft-coded coefficients also include coefficient outputs related to a protective action to be taken by the control module 100 as a result of implementing the given function or algorithm performed by the control module 100. Coefficient inputs to, and coefficient outputs from a given function may be changed or linked as desired for a given application. This is illustrated in more detail below in FIG. 12. [0063] Control module 100 is connectable to an AC power source (AC Mains) and the motor armature 20 and tool motor field 30. In an example, the tool motor armature 20 and the tool motor field 30 may comprise an AC motor 15. The control module 100 includes a control circuit, generally indicated by element 400. In one

example, the control circuit 400 determines a position of a motor control switch 402 and controls the control module 100 if power is provided to the motor armature 20 and motor field 30 based on the position of the motor control switch 402 when the AC power source is applied.

[0064] The control circuit 400 includes a power supply 405 that supplies power to a microcontroller 430 programmed to control certain operations and/or to direct certain functions or protective actions within module 100. The power supply 405 may supply a VCC of 5V for example. A supply voltage monitor 415 monitors the VCC and provides a sensed input to microcontroller 430.

[0065] The microcontroller 430 can control the electronic valve 420 by providing controls signals via a control input line 418 to the triac 420. In one example, this may be a triac, although the electronic valve may be embodied as any of a field effect transistor (FET), an insulated gate bipolar transistor (IGBT), a silicone- controlled rectifier (SCR), a voltage control device, etc. Generally, the control module 100 controls the operation of the motor 15 by switching the motor current on and off at periodic intervals in relation to the zero crossing of the AC current or voltage waveform, via the microcontroller 430 and control signals applied to a control input 418 of the electronic valve 420. These periodic intervals are caused to occur in synchronism with the AC waveform and are measured in terms of a conduction angle, measured as a number of degrees.

[0066] The conduction angle determines the point within the AC waveform at which the electronic valve 420 is fired, thereby delivering electrical energy to the motor 15. For example, a conduction angle of 180° per half cycle corresponds to a condition of full conduction, in which electronic valve 420 is fired such that the entire, uninterrupted alternating current is applied to the motor 15, i.e., the electronic valve 420 is fired such that current flows through the electronic valve 420 for the entire half cycle of the AC input signal. Similarly, a 90° conduction angle corresponds to developing the supply voltage across the motor 15 commencing in the middle of a given half cycle, and thus the electronic valve 420 is fired so that approximately half of the available energy is delivered to the motor. Conduction angles below 90°

correspond to firing of the electronic valve 420 later in a given half cycle so that even lesser quantities of energy are delivered to the motor 15. [0067] Hereafter the electronic valve 420 is referred to as a triac 420, unless otherwise described below, In an example, the triac 420 may be a single-isolated triac, where isolation is internal to the part. More specifically, operation of the motor armature 20 and motor field 30 which constitute the motor 15 is controlled by the control circuit 400 within control module 100. To control operation of the motor armature 20 and motor field 30, the microcontroller 430 controls the current flowing through or voltage applied to motor armature 20 and motor field 30, or both, via electronic cycling of the triac 420. The control circuit 400 can determine when to open or close the triac 420 based on soft-coded coefficients that can be stored in look-up tables, or from control equations based upon measured factors or parameters such as voltage, speed, current, torque, other external inputs (456, 458 etc.) or any combination of the above. The control module 100 controls the operation of the motor 15 when the motor control switch 402 is placed in a closed (i.e., 'on ' ) position, thereby allowing current to flow through. A function of the control circuit 400 is to monitor the position of the motor control switch 402 and prevent starting of the motor 15 if power is applied to motor 15 with the motor control switch 402 in a shut (i.e. On ' ) position.

[0068] Microcontroller 430 may include program ROM 436 (alterable ROM) such as flash memory, a CPU core such as a microprocessor 432, on-board peripherals, and non-volatile memory such as RAM 434 or SRAM on a single chip construction, for example. The non-volatile memory is adapted to retain stored information even when not powered. Examples of non-volatile memory include RAM (DRAM, SRAM, SDRAM, VRAM, etc.), magnetic and optical-based memory. Types of alterable solid-state ROM may include Erasable Programmable Read-Only Memory (EPROM) and Electrically Erasable Programmable Read-Only Memory (EEPROM). EPROM can be erased by exposure to ultraviolet light then rewritten via an EPROM programmer, and is identifiable by a circular 'window' in the top which allows the UV light to enter. EEPROM such as Flash memory allows the entire ROM (or selected

banks of the ROM) to be electrically erased (flashed back to zero) then written to without taking the banks out of the computing device.

[0069] In an example, the microcontroller 430 may be one of the ATMEL AVR® 8- bit RISC microcontrollers, such as the ATmegaδ flash microcontroller with 8-Kbyte self-programming Flash Program Memory (EEPROM). However the module 100's intelligent control is not limited to the example microcontroller 430. The intelligent control device could be embodied in hardware and/or software as another microprocessor, an analog circuit, a digital signal processor or by one or more digital ICs such as application specific integrated circuits (ASICs), for example. [0070] The control circuit 400 with the tool motor 15 (motor armature 20 and motor field 30) is connected in series with motor control switch 402, triac 420 and a shunt resistor 440 between hot and neutral (common) sides of the power source. In FIG. 4, one side of tool motor 15 is connected to the power source, such as to the hot side of AC mains 407 via the power cord 21 (FIG. 1A) through the motor control switch 402. The other side of the tool motor 15 is connected through triac 420, shunt resistor 440 and power cord 21 to the neutral side 408 of the AC mains 407. [0071] Shunt resistor 440 may be embodied as an analog current sensor which senses current and provides a signal that is amplified at amplifier 445. Amplifier 445 has a first input coupled to one side of shunt resistor 440 and a second input coupled to the other side of shunt resistor 440. An output of amplifier 445 is coupled to a given port of microcontroller 430. A shunt 440 is merely one example of a current sensor, alternative current sensors include current transformers, digital sensors, hall- effect sensors, etc., for example.

[0072] The microcontroller 430 includes an analog to digital converter (ADC) therein which converts the received analog signals from various sensors to digital representations for processing by microprocessor 432. The ADC is not shown in microprocessor 430 for purposes of clarity, it being understood that the analog inputs from amplifier 445, monitors 415, 425, 427, power supply 405, temperature sensor 410 and any analog input data received over additional control input/output lines 456, 458 are converted to digital representations in ADC for processing by the microprocessor 432.

[0073] The control circuit 400 further includes a voltage divider circuit 450 having resistors 451 , 452, 454, and clamping diodes 455 and 457 utilized by microcontroller 430 to sense one or more zero crossings of the AC voltage, A voltage zero-cross may be defined as the point in time where the AC voltage signal crosses the zero- axis and switches from either positive-to-negative or negative-to-positive voltage. This point is used for timing purposes inside the microcontroller 430. The voltage divider circuit 450 is coupled via a circuit line 460 to microcontroller 430 at a given port (not shown for clarity). The resistors 451, 452 and 454 divide the AC source voltage to a voltage level usable by microcontroller 430. The clamping diodes 455 and 457 protect microcontroller 430 from damage if a voltage spike occurs in the AC source voltage. In an example, all or part of the voltage divider circuit 450 may be included in the control circuit 400 or within microcontroller 430. In one example, the microcontroller 430 may include internal clamping diodes 455 and 457. [0074] Control circuit 400 may include one or more temperature sensors 410 designed to sense a temperature and to input a sensed signal via a port to microcontroller 430. Temperature sensor 410 may be embodied as an NTC or PTC thermistor, temperature sensing IC or thermocouple, for example. The temperature sensor 410 may communicate the temperature of the control module 100, or the temperature of a specific component such as the triac 420 or microcontroller 430, which can be used for determining certain overload events/fault conditions. As the function of such temperature sensors 410 are known, a detailed explanation of its functional operation is omitted for purposes of brevity. Multiple temperatures sensors 410 could be placed in module 100 as required.

[0075] Additionally, the control circuit 400 includes two voltage monitors for monitoring voltage of the triac 420, a gate voltage monitor 425 which is used to determine if the triac 420 is conducting during a negative voltage half cycle and a positive half cycle voltage monitor 427 which is used to determine if the triac 420 is conducting during the positive voltage half cycle. Both monitors 425, 427 are necessary since the controller 430 can only detect positive voltages. During the negative half wave of the AC cycle, no voltage would be detected by monitor 427.

[0076] The control circuit 400 may include one or more input / output (I/O) lines 456, 458 for communicating with users. These I/O lines 456 and 458 can digital or analog inputs or digital outputs and can be connected to devices such as potentiometers, switches, LED's, or other forms of a user interface (such as a speed dial, tool trigger, on-off switch, etc), so as to add some variability to the system. [0077] In general, the control circuit 400 as illustrated in FIG. 4 is designed to provide tool motor control and/or protection as related to one or more of power tool startup, overload or fault events which exceed one or more of a voltage, speed, current, and torque and/or temperature threshold. The control circuit 400 is designed to implement methodologies to control or provide warning mechanisms which alert a tool user of an impending fault and/or overload condition. Accordingly, as the general structure and electronic circuitry of the control module 100 has been described, example methodologies implemented by the control circuit 400 are discussed in more detail below.

Overload Control

[0078] In one example, the control circuit 400 of control module 100 may employ a software-based electronic only clutch (EOC) under control of the microprocessor 432 within microcontroller 430, independently and/or in conjunction with a mechanical clutch in the tool to provide motor overload control. The mechanical clutch may be embodied as the mechanical clutch 1310 shown in FIG. 13B, for example. Hereafter, the mechanical clutch is referred to as 'MC [0079] In an example, implementation of an EOC function in conjunction with the microcontroller 430 either turns off the tool motor 15 or reduces the motor voltage to a lower speed and torque value. Further, by employing an EOC in the control module 100 in conjunction with a MC in the gear case 16, a less expensive MC may be used and still have a relatively long lifetime. For example, operational cycles with the use of the combination of EOC/MC may increase cycle life from 200 cycles to more than 2000 cycles. This is only exemplary, use of the combination EOC/MC improves the cycle life of the MC by at least 25%. The EOC functionality detects an overload/fault event as will be discussed in more detail below, upon which the

microcontroller 430 removes power to the tool 10 completely by disabling the triac 420, or controls the triac 420 in a way that reduces power to the tool 10. [0080] Although power is lost in the case where the tool is shutdown, inertia still remains in the system. This inertia may cause the motor armature 20 as well as any attached accessory to continue to rotate. This can cause damage to the accessory (such as a grinding disc) as well as gears and other internal components. Using a MC in conjunction with an EOC removes the remaining inertia in the system (such as tool 10) after power is completely cut-off by the microcontroller 430 disabling firing of the triac 420. This combination of EOC turning off current to the motor and the MC removing the remaining inertia in the system acts to increase cycle life of the clutch and/or accessory.

[0081] The EOC may be internal to the control module 100 and as discussed above may a software program or routine stored in memory such as alterable ROM 436. For example, either on a half-line cycle or a full-line cycle basis, an algorithm implemented by the microcontroller 430 may continuously monitor a given parameter of the tool, such as current, motor speed, voltage, motor temperature, etc. In one example, the parameter monitored is current; thus as loading increases, current increases. Thus, the microprocessor 432 samples half-cycle positions of the AC current waveform and digitizes the samples in order to calculate a given current value, such as an instantaneous current, an average current and/or root mean square (RMS) current. In another example, the algorithm implemented by the microcontroller 430 may continuously monitor motor speed of the tool motor. [0082] The EOC may be embodied in one example in an absolute clutch mode, in which a threshold such as an average current, RMS current or maximum instantaneous current value (or if motor speed is being monitored, a motor speed threshold) is set. If the calculated or measured current value (e.g., instantaneous current, average current or RMS current) reaches this threshold, the EOC functionality detects a fault or overload condition. In another example, the threshold may be set by microprocessor 432 over a given time duration such as X cycles, in order to avoid transient or spurious protective actions.

[0083] Upon this detection, the microcontroller 430 initiates a protective action based on an output coefficient that has been stored in non-volatile memory, which in an example may be embodied as EEPROM or flash memory (as examples of a ROM 436) in FIG. 4. For example, if a particular soft-coded coefficient stored in ROM 436 for the EOC function in the absolute clutch mode is an output to turn the motor 15 off, violation of the threshold will cause the microcontroller 430 to turn the motor 15 off. Thus, the tool 10 may be placed in a shut-down mode where the microcontroller 430 does not allow the triac 420 to conduct any longer. This is accomplished by electronically opening the triac 420 through a control signal that is sent from the microcontroller 430 over a control input line 418 to the triac 420. This turns the triac 420 off; current is not allowed to pass through the motor armature 20 until power is re-applied to the system.

[0084] Alternatively, if different soft-sided coefficients are stored in ROM 436 which alter the protective action taken in the absolute clutch mode, violation of the threshold could cause the microcontroller 430 to control the triac 420 so as to pulse the tool motor 15, which would warn the user of a fault condition, or power to the tool 10 may be folded back by reducing the output voltage sent to the tool motor 15. [0085] In another implementation, protective functions such as shutdown, pulsing or foldback may be based on a detected change in current over time by the EOC, i.e., a DI/DT clutch (δi/δt). In this example, a change in a current value (such as average current, peak current, or RMS current) is measured over time and if the change in current (δi) exceeds a given limit or threshold, one of the above actions (shut-down, pulse, foldback) may be initiated. Thus, an EOC utilized in a DI/DT mode, which is an algorithm iterated by microprocessor 432, can look at N cycles where N = 1 , 2, 3, etc. In another example, the threshold may be set by microprocessor 432 over a given time duration such as X cycles, in order to avoid transient or spurious protective actions.

[0086] Accordingly, the use of an EOC may provide overload control based on exceeding a given threshold in one of the absolute threshold mode or DI/DT threshold mode, where one of several protective actions can take place upon detection of the fault condition by the EOC functionality or algorithm. The

microprocessor 432 retrieves certain soft-coded coefficients from memory (such as ROM 436) and executes a particular protective action based on the retrieved soft- coded coefficients. The soft-coded coefficients which direct which protective action to take are referred to as coefficient outputs.

[0087] The selected coefficient outputs indicate the protective action to be performed. For example, ROM 436 can include coefficient outputs that indicate that the microcontroller 430 initiate (i) tactile feedback, in which the motor 15 is pulsed by the microcontroller 430 cycling the triac 420 to provide a warning to the user of a fault condition in the power tool 10; or (ii) foldback, in which the microcontroller 430 reduces the conduction angle of the triac 420 to reduce the power to the motor 15; or (iii) motor shut-down , in which the triac 420 is completely disabled as the microcontroller 430 electronically opens the triac 420; or (iv) activation of an electronic brake, where the electronic brake is an algorithm or software routine implemented by the microcontroller 430; and/or one of (i) through (iv) in combination with (v) illuminating a warning LED on the tool housing exterior to alert the user of an impending or present fault condition. These are example protective actions that could be taken upon detection of an overload event by the EOC, for example. [0088] As the EOC is software-based, it has no mechanical parts reducing cost and eliminating wear-out components. The EOC has been described in use with a mechanical clutch; however, it may be used with an electronic brake that behaves similar to a mechanical clutch. The EOC may react to changes in speed or current over time or absolute levels reached by speed or current. For example, an 8A increase in 32msec (2 line cycles at 60Hz) could cause EOC activation. Or, a decrease in motor speed from 8k rpm to 6k rpm in 16msec (1 line cycle at 60Hz) could cause electronic clutch activation. Absolute level examples of current (35A) or speed (4,000 rpm) (when no load speed is 10,000 rpm) may cause electronic clutch activation.

[0089] The lower speed and torque value behavior is similar to a mechanical clutch. The EOC may be used in combination with a mechanical clutch or an electronic brake.

[0090] FIG. 5 is a flowchart for illustrating functionality of the absolute clutch mode, in accordance with an example embodiment. Fig. 5 illustrates functionality of the EOC in an absolute clutch mode, which may or may not be used with a mechanical clutch (MC) or electronic brake within the control module 100. [0091] Referring to FIG. 5, in an absolute clutch mode (500), the microprocessor 432 receives a sensed parameter (in this example sensed current samples) (510) from current sensor 440 via amplifier 445. Accordingly, the EOC function in the absolute clutch mode is described as configured to sample current; this is due to the soft-coded coefficients (coefficient inputs) being set in ROM 436 (i.e., EEPROM, flash memory) for current as the input for the EOC function in absolute clutch mode. Of course, the EOC function in the absolute clutch mode could be configured to sample a different parameter, which would be compared to a different threshold other than one based on a current (i.e., voltage, motor speed, motor temperature, etc.) Thus, the coefficient inputs stored in ROM 436 (i.e., EEPROM/Flash memory) could be directed to other parameters as inputs to the EOC function instead of current, such as speed, temperature, voltage or other sensor parameters. [0092] In the present example, these current samples may be samples of half- cycle positions or full line-cycle positions of the AC voltage waveform (i.e., on a line- cycle basis) which are digitized in order to calculate a given current value, such as an instantaneous peak current, an average current and/or root mean square (RMS) current. The calculated current value is compared to a threshold (520), which as discussed above may be a threshold based on an average current, RMS current or max current. If the calculated current value (e.g., instantaneous current, average current or RMS current) exceeds this threshold, (output of 520 is 'YES'), the algorithm increments a timer counter (530); otherwise, the timer counter is cleared (540). The timer counter increment provides a delay to avoid a spurious protection action by the microcontroller 430 for a transient condition.

[0093] The timer count is then compared to a timer coefficient (550). If the timer count is equal to or exceeds the timer coefficient (output of 550 is υES'); this is indicative of a fault condition as detected by the EOC in the absolute clutch mode.

[0094] As shown in FIG. 5, upon detection of the fault condition (here an overload event based on the output of 550 being YES), the control module 100 initiates a protection action. In this example, the microcontroller 430 disables triac 420 firing (560) by sending a control signal via control input 418 (FIG. 4) to electronically open the triac 420 and hence shut the tool motor 15 off.

[0095] However, different coefficient outputs for the EOC function could be set in ROM 436 for retrieval by the microprocessor 432 such that the microcontroller 430 takes a different protective action, i.e., using the phase control system of control circuit 400 to invoke tactile feedback or motor foldback, or to simply illuminate an LED on the tool housing to indicate the overload state to the user, for example, rather than opening the triac 420 to removing voltage (and current) from the tool motor 15. For the purposes of explanation in FIG. 5, the coefficient output for the EOC function (absolute clutch mode) is set to motor shutoff by disabling triac 420. [0096] In the absolute clutch mode, the algorithm determines whether a no-volt activation feature is enabled or not (570). As to be described in detail below, the no- volt activation feature may be provided as part of the functionality of the control module 100 in an effort to prevent an attached electrical device (such as a power tool) from turning on either: (a) upon the plug in of the cord of the power tool with the power switch in the "ON" position and the cord unplugged from an AC outlet; or (b) the power switch is "ON" the tool is plugged in and powered, but the tool has reached an overload event that has caused a shutdown (while still plugged in), and the overload event has cleared with the power switch still in the "ON" position. [0097] Implementation of the no-volt activation protection feature ensures that an electronic valve, such as triac 420 within the control module 100, will not fire in one of the above situations (a) or (b). Thus, with the no-volt feature enabled, the microprocessor 432 will initiate a no-volt activation routine 700, as will be described in more detail below. Otherwise, with no-volt activation disabled (the output of 560 is 'NO 1 ), the algorithm disables interrupts at 580 and enters an infinite loop. This prevents the triac 420 from firing, e.g., the algorithm runs the same instruction over and over.

[0098] The action of either running the no-volt activation routine 700 or entering the infinite loop (at 580) will only occur if the soft coefficient output is set to shut down the motor 15 in the event of an absolute clutch mode fault. As described earlier, the soft-coded coefficients include coefficient outputs related to a protective action to be taken by the control module 100 as a result of implementing the given function or algorithm performed by the control module 100. Coefficient inputs to, and coefficient outputs from a given function may be changed or linked as desired for a given application. Thus, if some other coefficient output is set which does not require motor shutdown, i.e., foldback, tactile feedback, LED, etc., a separate action will occur.

[0099] If the timer count from 530 is less than the timer coefficient (output of 550 is 'NO'), the normal iteration of the absolute clutch mode proceeds with monitoring current samples in the next line cycle or half-line cycle (590), and the algorithm proceeds back to 510.

[00100] FIG. 6 is a flowchart for illustrating functionality of the DI/DT clutch mode, in accordance with an example embodiment. Fig. 6 illustrates functionality of the EOC in a DI/DT clutch mode, which may or may not be used with a mechanical clutch (MC) or electronic brake within the control module 100. Referring to FIG. 6, in the DI/DT clutch mode (600), the microprocessor 432 receives sensed parameters. In this particular example, the parameters are current samples (610) from current sensor 440 via amplifier 445, it being understood that the sampled parameters could be motor speeds of the tool motor at two separate timings motor These may be samples of half-cycle positions or full line-cycle positions of the AC voltage waveform (i.e., on a line-cycle basis) which are digitized in order to calculate a given current value, such as an instantaneous peak current, an average current and/or root mean square (RMS) current, for example.

[00101] The algorithm implements a difference function (620) to calculate a difference value. In this example, the calculated current from the previous line cycle (Current (X-1 )) is subtracted from the calculated current value for the present line cycle (Current (X)). The difference value is compared to a set threshold (625), which as discussed above may be a threshold based on an average current, RMS current

or max current If the difference value exceeds this threshold (i.e., the output of 625 is 'YES'), the algorithm determines whether a no-volt activation feature is enabled or not (630). Functions 635, 640 and 700 may be implemented as described in FIG. 5, thus a detailed explanation is omitted for purposes of brevity. [00102] Although current is being used in the example of FIG. 6, it would be evident to use another parameter such as motor speed, and a threshold based on motor speed, in order to determine whether a fault condition has been detected so as to initiate a protective action. Accordingly, in another example a difference value can be determined for motor speed at two different timings.

[00103] If the difference value is less than or equal to the threshold (i.e., the output of 625 is 'NO'), the algorithm compares the difference value to the threshold divided by a factor (650), which in the example of FIG. 6 is threshold/2. If the difference value exceeds the threshold (i.e., the output of 650 is 'YES'), a cycle counter is incremented (655) by the microprocessor 432; otherwise, the cycle counter is cleared (660). In an example, a fault condition such as an overload event is detected if the difference value exceeds threshold/2 for at least N consecutive line cycles, where N is > 2.

[00104] The cycle counter increment provides a delay to avoid a spurious protection action by the microcontroller 430 for a transient condition. From function 655, the algorithm as shown in the example of FIG. 6 determines whether the cycle count is equal to or exceeds 3 (at 665), indicating that the difference value from 650 has exceeded the threshold for 4 consecutive line cycles, it being understood that this is merely one example, this count could be sent to 2, 3, 4, N as needed to trigger a protective action for motor overload. In other words, three consecutive difference values exceeding threshold/2 will span 4 line cycles. In this case, no-volt activation is evaluated as described above in functions 630, 635, 645 and 700. The output of functions 660 and 665 returns the microprocessor 430 to normal operations 670 where the Dl/DT clutch mode proceeds with monitoring current samples in the next line cycle or half-line cycle.

[00105] The purpose of comparing the difference value to a threshold divided by a factor over multiple line cycles is to help predict the occurrence of an overload event

before it happens. For example, if the difference threshold is set to a 30 amperes average between two consecutive line cycles, the measured average current will also be compared to 15 amperes (30/2) between consecutive cycles. If this occurs multiple times in a row, even though the current has not exceeded 30 amperes, this is still considered an overload event.

[00106] The use of a combination EOC/MC may have certain benefits. For example, in a cutting application, if a piece collapses on the cutting wheel, the EOC will turn off the motor 15 (i.e., the motor armature 20 and motor field 30) immediately. Shortly thereafter, the mechanical clutch will slip after the EOC shuts off the power, dumping any remaining inertia. This may prevent tool 10 destruction or prevent gears from breaking or coming apart, for example.

No-VoIt Activation

[00107] FIG. 7 is a flow chart illustrating a no-volt activation routine in accordance with an example embodiment. As described above, the no-volt activation routine may be provided as part of the functionality of the control module 100, so as to prevent an attached electrical device such as a power tool from turning on either; (a) upon the plug in of the cord 21 of the power tool 10 with the power switch in the "ON" position and the cord unplugged from an AC outlet; or (b) the power switch is "ON" the tool 10 is plugged in and powered, but the tool 10 has reached an overload event that has caused a shutdown (while still plugged in), and the overload event has cleared with the power switch still in the "ON" position. The implementation of a no- volt activation protection routine may prevent an electronic valve, such as the triac 420 within the control module 100, from firing in one of the above situations (a) or (b).

[00108] In one example, a series of consecutive voltage checks may be made at 90° phase positions of the AC waveform in each line cycle, in order to look for voltage across the triac 420 immediately after the control module 100 receives power. If the tool switch 402 is closed when power is applied, the microcontroller 430 will detect a presence of voltage across the triac 420. If the switch 402 is open when power is applied, the microcontroller 430 will not detect any voltage across the triac 420. If there is an indication of AC voltage at these checks, the triac 420 will not

fire until there is an indication of no voltage in a given line cycle, i.e., the user has cycled the power switch to "OFF" prior to restarting the power tool 10. Multiple consecutive checks are required to eliminate any random noise in the system due to electrical spikes, surges, suppressions etc. which can cause brief periods of voltage across the triac 420.

[00109] In the example of FIG. 5 above, the microprocessor 432 of the microcontroller 430 compares current feedback to a threshold (at 520) for the EOC. If the EOC is configured with an absolute threshold and the feedback current value exceeds the threshold, two actions could occur. In a case where no-volt protection is not activated in a system (disabled/inactive, output of 560 is 'NO'), the algorithm (under microprocessor 432 control) disables interrupts in an infinite loop (at 580) to prevent the triac 420 from firing, and stays in this loop to effectively shut-down the power tool 10. Thus, all power to the tool motor 15 is terminated. [00110] If the no-volt activation routine is enabled in the control module 100 (output of 570 is 'YES'), the microprocessor 432, in iterating the functions of the no-volt activation routine 700, looks for whether the switch 402 is opened or closed. In this example, the no-volt activation methodology does not disable the interrupts, but triac 420 firing is disabled (at 560) based on the no-volt methodology of FIG. 7. [00111] In the example of FIG. 6, the microprocessor 432 measures current over time and stores the current values in RAM 434 for past and current cycles. In one example, the algorithm as iterated by microprocessor 432 calculates a DI/DT value as a change in instantaneous current divided by the cycle time (DI/DT = I 2 - li/ δT). This DI/DT value or difference value, which may be referred to as a variable Y, may be compared to the threshold. If Y exceeds the threshold (output of 625 is 'YES'), the same protective action sequence (630, 635, 640/700) may be initiated by microprocessor 432 as for the absolute threshold scenario of FIG. 5; otherwise Y may be compared to a factor of the threshold such as threshold divided by 2 (at 650).

[00112] If Y is greater than the threshold divided by 2, then a counter may be incremented up to 3 or 4 times (655, 665) to confirm that no spurious event is taking place. On the other hand, if Y is less than the threshold divided by 2, then the

counter is cleared (660). Should the counter reach 3 or 4, the counter is set and the same protections (630, 635, 640/700) are performed as in the absolute threshold scenario described above. For example, if the counter equals 3, this indicates that 4 consecutive line cycles of data have exceeded the reduced threshold value of the threshold divided by 2.

[00113] Referring now to FIG. 7, one of the situations (a) or (b) described above triggers initiation (705) in which the algorithm detects (at 710) whether the AC voltage waveform is at a negative zero cross (i.e., voltage half-cycle is crossing through zero to the negative half cycle). This is a synchronization step for the algorithm as it waits for the zero cross, and will loop until a negative zero cross is detected. Once the positive zero cross is detected the microprocessor 432 of controller 430 can start checking the position of the switch 402 (715). This synchronization to the positive half cycle is only necessary if the controller 430 can only sense voltage in that particular half-wave. However, sampling during the negative half is possible using the other voltage monitoring circuit 425. [00114] Once both zero crosses are detected (output of 715 is 'YES'), a checkpoint value is set to phase point 1 (720). Phase point 1 may be at 130° conduction angle of the triac 420, or based on a given time (100 msec). Function 725 is a looping process until it is determined that the checkpoint has been reached, upon which the voltage across the triac 420 is checked (730). Sampling voltage across the triac 402 is used in this example, it being understood that this is merely one example parameter that could be checked; current through the triac 402 may be the sampled parameter instead of voltage. If some positive voltage is detected at 730, it is assumed that the switch 402 is closed. The routine then returns to function 710 and repeats not allowing the triac 420 to conduct, otherwise there is no voltage detected across the triac 420.

[00115] In this case (output of 730 is 'NO'), the algorithm queries whether a given number of N consecutive line cycles (N > 2) of the voltage waveform have been tested. In the specific example of FIG. 7, the algorithm queries whether three consecutive line cycles of the AC voltage waveform have been tested (735). If YES, it is determined whether voltage across the triac is high (at 740) and if so, the

algorithm inserts a delay at 745 to wait for the switch 402 (which also may be referred to as a trigger or ON/OFF switch) to close. If voltage across triac 420 is still high after the wait time (output of 750 is 'YES'), switch 402 closes and the no-volt activation routine 700 is terminated at 780; the power tool 10 may be turned on for normal operations. Functions 740, 745 and 750 thus address a situation where the tool 10 has shutdown due to some overload condition, but where switch 402 is still ON.

[00116] If, on the other hand, three consecutive line cycles of the AC voltage waveform have not been tested, the algorithm queries (at 755) whether all checkpoints have been tested. This routine can have multiple checkpoints per line cycle. The more checkpoints tested, the more immune the system is to random noise. For example, if there are three separate checkpoints at 130, 70 and 30 degrees of conduction, and these three points have been checked for three consecutive line cycles, and then the routine effectively guarantees that the switch 402 is in fact open at nine consecutive discreet points along the AC sine wave. If only a single discreet point is checked, noise could adversely influence the system. [00117] Thus, if the output of 755 is YES, the algorithm returns to checking the negative zero cross of the next line cycle at 710. If not all checkpoint were tested, then it is determined whether checkpoint 2 has been tested (at 760), and either checkpoint 2 is loaded (770) or checkpoint 3 is loaded 765 based on the determination at 760. Thereafter an AC cycle counter (temp2) is incremented at 775, and processing returns to the checkpoint test at 725. This AC cycle counter (temp2) is how the microcontroller 430 knows that all three consecutive cycles have been tested. If at any checkpoint no voltage is present across the triac 420, the microcontroller 430 assumes the switch is closed and restarts the entire routine at 705.

[00118] The above example has been described where the parameter being sensed is voltage across the triac 420 in order to determine if the switch 402 is either open or closed. However, instead of checking voltage, checks of current (i.e.,, average, RMS, peak current, etc.) during the AC cycle may be performed. If current is determined as flowing through the triac 420, it can be assumed that the switch 402

is closed; otherwise, no current is detected and the switch 402 is open. Again, multiple checks can be performed across multiple AC cycles to increase noise immunity during detection as described above.

Service Required Algorithm

[00119] In another example, the microprocessor 432 may iterate a service required algorithm in order to indicate whether power tool 10 service is required. An example required service may be to replace the brushes in the tool motor 15, or to re-apply grease to the gears in gear case 16. Power tools may use universal motors with commutator brushes. For example, the commutator ring 24 of FIG. 1A may have commutator brushes thereon. These brushes typically require replacement before the end of life of the tool. Determining when to replace brushes may be based on a threshold coefficient which is set through time calculation, motor current measurement, applied motor voltage, speed, switch cycles, or some combination of these parameters. Indication of service required to the user may be performed through a light indicator on the tool housing 18 such as an LED. Alternately, the user may be alerted to a required service by tactile feedback at some particular vibratory pattern, or the tool may be set to shutdown until the service is complete, for example. [00120] In one example, and upon start-up of the microprocessor 432, the microprocessor 432 calculates how long the tool 10 has been running and compares it to the threshold coefficient. In this example, the threshold coefficient may be set based on time, such as 100 hours. If the tool run time has exceeded 100 hours, a light indicator on the tool housing 18 such as an LED (not shown) may illuminate to alert the user that service is required. The LED may remain "ON" until reset at a service center or by the user, for example.

[00121] In this example, the required service is brush replacement. After brush replacement has been performed one of several methods of indicator reset may be used. For example, in order to reset the threshold coefficient, a service center representative or the user may physically remove the brushes and power the tool 10. As no brushes are in the tool, there is no detection of current, thus the microprocessor 432 detects a low current (i.e., a low current as compared to a threshold) and assumes the "no-current" reading. If no current is sensed for at least

one second, the microprocessor 432 may implement a reset routine. In one example, the reset routine may include multiplying the threshold coefficient (100 hours) by some factor (such as 2) and/or extending it for a fixed or variable reset period. As the new service required run time is set, the LED is de-energized and the brushes are replaced back into the tool motor 15.

[00122] In another example, an external reset may be used. The brushes are replaced then the tool is plugged into an external reset module that is powered. Then, power is applied to the tool and the tool switch is activated. The reset module limits motor current to a very low value, low enough that the motor does not turn. The controller 430 recognizes this as a service required reset command and resets the indicator. The external reset module could be used at the service center or purchased by the tool user.

[00123] In another example, a code may be input from the tool user. After brush replacement, the tool is powered. This code input may be combinations of speed dial settings, variable speed switch settings, switch cycles within a period of time, etc. In other words, this code can be a sequence and/or timing of operations or activations of user inputs to the tool control. For example, a drill reset may require the user to activate the power switch on/off 5 times in 10 seconds, wait 10 seconds, and then re-activate the power switch on/off 5 times in 10 seconds to implement the reset.

Tactile Feedback

[00124] FIGS. 8 and 9 are graphs to illustrate tactile feedback to an AC corded power tool user as a warning mechanism of an impending or present fault condition therein. Before shutting down the power tool 10 for some fault condition, or as opposed to shutting down, it may be desirable that some kind of warning be provided to the operator of the power tool 10. Similar to a scenario when a fault condition occurs, or is in the process of occurring, in an owner's car, the owner may be given a warning light on the dashboard for a given duration of time before the engine breaks down because of the fault condition (i.e., piston damage due to a lack of oil). [00125] In one example, a detected under-voltage and over-temperature condition could be used as a cut-off mechanism, i.e., the control module 100 ceases to output

current once a threshold is reached. However, before a fault condition trigger such as an under-voltage or over temperature threshold is reached, a warning mechanism in the tool 10 may warn the operator that the operator is approaching an impending operating limit that may automatically shutdown the power tool 10. The warning mechanism could be audible (with a horn or buzzer) or visible using a desired illumination scheme such as LEDs, for example.

[00126] Commonly assigned U.S. Patent No. 6,479,958 to Thompson, et al. describes a method of breakthrough torque control for a power tool. In one example in the '958 patent, power tool control may be provided by sensing a given motor parameter which is indicative of the onset of some fault condition, such as a stall condition. In response to the impending stall condition, while the power switch to the tool remains active, the motor is pulsed a number of times at a frequency that is harmonically related to the natural resonant frequency of the motor. This is done in order to deliver a series of torque pulses which have a peak torque that is greater than the average torque delivered during the series. This is called "breakthrough torque", and allows a user of a power tool to finish a given job so that the motor does not burn out or stall completely.

[00127] However, in another configuration as to be described herein, the motor 15 may be pulsed not using breakthrough torque to complete a job, but as a warning for a user of the tool 10 that the tool 10 is approaching or at an impending fault (i.e., shut-down or stall condition). In an example, the pulse may be customized for a given power tool. The pulse acts as a physical, tactile sensation or warning mechanism to the user.

[00128] Thus, as the control module 100 is a phase-controlled, time-based system, any logic may trigger an output pulse as a warning mechanism. For example, parameters such as a given speed, torque, temperature, current or change in current over time are parameters which can be measured by the microprocessor 432 and compared to some threshold in order to initiate tactile feedback, whereby the tool motor 15 is pulsed on reaching or exceeding a given threshold. [00129] FIG. 8 illustrates a result of tactile feedback in which the triac 420 drops from full "ON" to full "OFF". Referring to FIG. 8, area A shows the triac 420 firing at

full conduction (i.e., the microprocessor is maintaining the conduction angle at 180 degrees for full conduction). A pulsing period B consists of a series of "ON/OFF" firings of the triac 420. The triac 420 is "ON" for a time period C and "OFF" for a time period D. The period C + D represents one period B. Period B then repeats a set amount of times E. Accordingly, FIG. 8 is provided to illustrate tactile feedback with full "ON/OFF" pulsing.

[00130] In another example, tactile feedback may be implemented with a varying conduction angle. Referring to FIG. 9, the pulse diagram illustrates the result of tactile feedback in which the triac 420 can drop from a higher conduction angle down to a lower conduction angle or from a lower conduction angle up to a higher one, instead of full "ON/OFF". Once the microprocessor 432 of controller 430 detects that then the control module 100 should pulse the output, the microprocessor 432 can either decrease the conduction angle from full at point A down to a lesser conduction angle at points B or C or can increase the conduction angle from a low point such as C and increase the conduction up to point A (full on). This implementation may utilize the same coefficients as in FIG. 8 during full "ON/OFF" tactile feedback. Accordingly, parameters such as duty cycle (ratio of parameter D to C in Figure 8), pulsing time (parameter E in Figure 8), non-pulsing time (parameter A in Figure 8) etc. may be varied as desired for a given power tool or application. [00131] In one example, alerting the user of an impending fault condition in the power tool 10 can utilize the phase controlled nature of the control module 100 to setup soft coded parameters in ROM for tactile feedback (A, B, C, D, E of Figure 8) to create a "warble" effect in the speed of the motor 20. This mild cyclic change in motor speed may be selected so as to not adversely affect tool performance but provide the user with both audible and tactile feedback on the impending or current fault condition.

Foldback

[00132] In general, the control circuit 400 in the control module 100 may be configured to reduce the maximum power output capability of the tool 10 so as to produce a "fold back" condition. The operator would both hear and feel this condition as a 'weakening' of the tool 10 performance. The operator would be prompted to

back off and avoid an impending fault condition (e.g., under-voltage, over- temperature, over-current, etc.).

[00133] For example, foldback could be implemented based on motor temperature exceeding a given setpoint or threshold. Upon reaching a fault condition (over- temperature limit, setpoint or threshold) the controller 430 issues control signals via signal input line 418 to reduce the conduction angle at which triac 420 fires in proportion to the increase in temperature. This lower conduction angle is held to reduce motor voltage applied to the tool motor 15 as temperature rises past the threshold or set point.

[00134] In this particular example, foldback is intended to protect the motor 15 and inform the user when the tool 10 is too hot. If temperature continues to increase, motor voltage continues to decrease until either the motor voltage becomes 0 or a minimum voltage is reached and the voltage no longer decreases with increased temperature. By folding back motor voltage, temperature should begin to decrease below the threshold or setpoint, at which motor voltage may again be increased. The foldback function may be maintained until the temperature has reduced below the setpoint, or the temperature no longer decreases, or a low tool speed setting has been reached.

[00135] Foldback may be employed by controller 430 as a protective action for violations of inputs other than temperature. Foldback may be employed to reduce torque or to assist with user loss of control (e.g., tool rotating about the bit tool or accessory).

[00136] FIG. 9 is a graph to illustrate an example of foldback of motor voltage in a corded AC power tool. Initially, when a given measured parameter (voltage, current, temperature, torque, etc.) of the system is below some coefficient threshold, the triac 420 is firing at full conduction (point A). As the parameter increases above this threshold, the conduction angle begins to decrease (from point A to point B). If the parameter being measured continues to increase further above the threshold, the conduction angle will continue to decrease (point B to point C). This process will continue until either some set minimum conduction angle is reached (an example being 30 degrees). This minimum conduction angle is held constant until the

measured parameter decreases. Alternatively, the module 100 may be configured to shutoff the tool 10 after this set minimum conduction angle is reached. If the triac 420 is firing at point C and the measured parameter begins to decrease, the conduction angle will then increase from point C back to point B. As the measured parameter continues to decrease below the threshold, the conduction angle will continue to increase from point B back to full conduction at point A.

Torque Control

[00137] The control module 100 may be configured to provide torque control for the tool motor. Torque control may be somewhat analogous to speed control, for example. On a cycle-by-cycle basis, the microprocessor 432 reads the current value off the shunt 440 and compares it to a reference voltage in order to determine a representative voltage reflective of the current value. The representative voltage value, as compared to one or more values, that may be stored in a suitable look-up table within memory 434 or 436 or determined with a hard-coded equation in order to determine the torque value. The calculated or looked-up torque value may then be compared to a torque set point. If the calculated torque value exceeds the torque set point, the microprocessor 432 regulates torque by reducing the output voltage. This can be done using foldback, for example. In one example, a microprocessor 432 can change the conduction angle at which the triac 420 fires, which changes the motor voltage to reduce the torque value below the torque set point.

Motor Temperature Estimation

[00138] Figure 10A is an overview of a motor temperature estimation algorithm. This example uses average current as an input, but other measurements such as RMS current, peak current, temperature from thermistors or thermocouples, or speed can be used as an input to a motor temperature estimation function. [00139] The algorithm is based on a principle that the temperature of a motor is proportional to the square of the RMS current times resistance. Assuming resistance is constant in the tool motor 15, estimating temperature can be accomplished by accurately measuring current over time. Initially, n current samples are taken by microcontroller 430 at specific intervals over a period of time or time increment M (n and M can be varied for each tool 10) to determine an average

current which is squared at 1002. This squared value of current can be represented as an integer parameter A. The squared current term A represents an estimate of what the motor temperature will be at the end of a given time period P into the future (where P is much greater than increment M), assuming that the current remains constant.

[00140] The term A is to be compared to a temperature register value B (shown input at 1004). B is a fluctuating value representing an estimate of the motor temperature at a present point in time, and which is to be updated at each time increment M. For instance, a temperature register value B=O indicates that motor temperature is at ambient (i.e., room temperature) while a temperature register value B=1300 can represent a motor temperature of 130 degrees C. Each of the parameters A and B are integer values.

[00141] The difference between A and B at 1006 represents how much difference there is between the estimated temperature at the present time and what temperature the motor 15 is estimated to be at after time period P has elapsed. This difference C (an integer value which may be referred to as a pre-scaled adjustment C) is divided by a scalar E (also an integer value) at 1008. The scalar E may be understood as a variable scalar adjustment which varies the rate at which the temperature register responds to changes in current and can be considered the time constant for the motor 15. Since each motor has a different time constant E, this value can vary from tool to tool. The result of C/E represents a temperature adjustment value F for the motor 15. This temperature adjustment value F represents how much the temperature has either increased or decreased in the time increment M.

[00142] At 1010, F (a signed value) is then either added or subtracted back into the temperature register value B to create a new temperature register value H to be used in a next iteration at 1012. If the current remains constant, as time approaches P the value of H should correspond to or equal the value of A, such that the new estimated motor temperature approximates or is substantially equal to the estimate of what the motor temperature would be at the end of time period P.

[00143] Thus, the greater the distance between the current measurement as reflected by A (i.e., the estimate of what the motor temperature will be at the end of time period P based on a constant square of average current over that time increment) and the temperature register value B, the greater the increase/decrease of the temperature register value B must be after calculations. If the integer values for A and B are equal, this represents no change in motor temperature. Thus, the temperature register value B always wants to equal the square of the current over time (i.e., A) and will increase/decrease as needed over time to maintain this relationship. At any point in time, looking at temperature register value B will give a proportionate estimate of what the motor temperature is at that given instant of time. [00144] As an example, if the average current increases over the interval M from 5 to 20 amps (which increases parameter A, as it is a function of current squared), the temperature register value B will increase very quickly, representing a sharp increase of motor temperature since current has dramatically increased. If the average current then drops from 20 amps to 10 amps (A drops), over time the temperature register value B will decrease, signifying a drop in motor temperature. [00145] The following equations illustrate calculations for parameters A, B, C, D, E, and H of FIG. 10A. In a perfect or ideal system, current squared times resistance gives a temperature. However, in an actual system, other factors such as fan speed, motor speed, as well as how current is measured will affect the outcome of the system. In the equations below, the parameter A is represented by the term FinalAveragβ n \ and represents the estimated temperature that the motor will get to over time (i.e., over the given time period P in this example). The register value B is expressed by the term 7erøpReg [n -i ] , and the updated or new temperature register value determined for a number of current measurements n over time interval M is expressed as TempReg n

[00146] To accommodate these system parameters, equations for estimating motor temperature can be slightly modified. For example, in calculating parameter A (a function of average current squared), a voltage compensation term or multiplier referred to as Vfactor is added to accommodate 230V tools as well as 120V tools. Since the average current seen by a 230V tool is roughly half that seen by a 120V

tool, a multiplication factor is needed for the system to operate correctly. The multiplier Vfactor may be set at "1" for 120V tools and "2" for 230V tools. [00147] There is a current level threshold (referred to herein as 'midpoint threshold') related to fan speed. At a specific current level, the amount of heat removed from the system via a fan in the power tool 10 degrades as the fan speed decreases. A factor is added to compensate for this loss of heat removal due to decreased fan speed. The value calculated for A (FinalAverage n ) differs depending on whether the average current is above or below this midpoint threshold. If the average current is above the midpoint threshold, the following factor is added, (Javg n -Midptf, which is simply the square of the calculated average current minus the threshold current value Midpt. This factor will cause currents above the midpoint to result in a higher temperature being estimated than currents below the midpoint. The amount of temperature increase is directly proportional to the amount of current increase above the midpoint.

[00148] Further, a variable may be added to compensate for lower motor speeds. This may be reflected by the expression {MaxDial -DialSetpoint)*SpdF actor. The parameter MaxDial is an A/D reading read by the microprocessor 432 which corresponds to the maximum setting on the speed dial wheel 270, and the parameter DialSetpoint is an A/D reading corresponding to the actual speed setting on the dial wheel 270. If these are equal, this speed compensation variable is 0. The parameter SpdFactor is a constant coefficient that varies from tool to tool and provides the compensation when the dial setting is set at a speed other than the maximum setting.

[00149] The above compensation for motor speed is necessary when taking average current measurements, since the conduction angle of the triac 420 affects the accuracy of the average current measurement. At lower conductions (lower speeds), the average current measurement is not as precise as at a full conduction angle (full speed), so the measurement must be compensated. This process changes depending on which measurement scheme is used. When using average current, all compensation factors are used. If RMS current is used, not as many

compensation factors are needed. If a thermistor or thermocouple is used, none of the compensation factors are required.

[00150] Accordingly, the value of A-Final Average,, , which is calculated for n current measurements taken by microcontroller 430 at specific intervals of a period of time M to get a final average current, may be calculated by one of the following two mathematical equations, depending on whether the average current is above or below the midpoint threshold. Equation (1) is where average current is below the threshold level, Equation (2) is where the average current is equal to or above the current level at which fan loss must be compensated for by {Iavg n -Midptf.

FinalAverage = DialSetpo int) * SpdFactor (1) 16-bit max

+ (MaxDial- DialSetpάni) * SpdFactor

(2)

[00151] Accordingly, the calculation of H in FIG. 10A is reflected in Equations (3) and (4) below. The value H is the new or revised temperature register value, and reflects the updated estimate of the motor temperature. Equations (3) and (4) reflect the parameters B, C, E and F shown in FIG. 10A, essentially showing that H = B + F, where F = C/E and C=A - B. Thus, the terms in Equations (3) and (4) map as follows. H = B + (A-B)/E. Equation (3) incorporates the FinalAverage n result from Equation (1), where the average current is below the midpoint threshold, and Equation (4) incorporates Equation (2) for the calculation of FinalAverage (where the average current is equal to or above the midpoint threshold):

(FinalAvg n -TempRs,gγ n _ λ ^)

TenφεLsg H = TempReg [n _ l] + V p S n ff "1 " (4) 16-bit max

(lαvg n - Midpt)

HighCurDivisor 2551im tt

[00152] The numerator in the second part of each equation (3) and (4) is the parameter C of FIG. 10A, which represents (A - B) or how much difference there is between our estimated temperature at the present time and what temperature the motor will get to after time P. The scalar E, which is the denominator term in each second part of the equations (3) and (4), is different in equation (3), a constant coefficient called Divisor, as compared to equation (4), which has denominator term that accounts for a measured average current exceeding the midpoint threshold (compensation for fan losses), and divides that factor by a scalar called HighCurDivisor. These scalars Divisor and HighCurDivisor are compensation coefficients which are set to vary the time it takes for the new estimate of temperature H to be determined so that it reaches A. Two different divisors are used since at higher currents, the heating/cooling rate of the motor 15 changes due to loss of fan speed. Thus, the Divisor scalar is used in Equation 3 at lower currents and the HighCurDivisor scalar is used in equation (4) for higher currents. [00153] Thus, the scalar E is a variable scalar adjustment which varies the rate at which the temperature register responds to changes in current. This can vary from tool to tool. In this example, the shape of the cooling/heating curves will change as the current exceeds the midpoint. The result of C/E (i.e., the second, entire quotient part of equations (3) and (4)) represents the temperature adjustment value F for the motor 15. In other words, the result of C/E indicates how much the temperature has either increased or decreased in the time increment M.

[00154] FIG. 10B is a flow diagram to illustrate how to determine the estimated temperature of the motor at startup, i.e., the initial value B in the temperature register. Once tool 10 loses power, the controller 430 loses memory of what has previously transpired, unless information is saved on a periodic basis. Because of this, there should be a way to determine what temperature the motor 15 is at when

the tool 10 is first powered up. Without this determination, a motor 15 which has been running for some time at heavy loads can be turned off and back on again rapidly and the controller 430 will reset the temperature register back to zero, indicating a room temperature tool 10. If this occurs, the tool 10 will most likely burn- up.

[00155] To prevent the potential for tool burn-up, a routine is provided beginning at 1014. Every time the microcontroller 430 updates either the temperature register value B or thermistor (i.e., sensor 410) measurement of controller 430 temperature, these values are stored in non-volatile memory (RAM 434). On startup, the latest temperature register value and sensor 410 value of controller 430 temperature which were stored just prior to the last tool shutdown are retrieved (1014) to get a picture of the state of the motor 15 just prior to last power-down. A time delay is added (1016) to obtain a measurement of estimated motor temperature as well as controller temperature at power-up of the tool. After the pre-defined delay on startup (1016) the controller 430's onboard temperature sensor (410) is read to estimate the controller temperature which is relative to motor temperature, i.e., if the controller 430 temperature is substantially high, it can be assumed that the motor 15 temperature is hot as well as long as the controller 430's temperature time constant is not much higher than the temperature constant of the motor 15. [00156] After this delay, the microprocessor 432 measures this controller temperature off of sensor 410 and determines one of 4 states: (1) microcontroller 430 is at room temperature, (2) microcontroller 430 has not changed temperature, (3) microcontroller 430 is warm, and (4) microcontroller 430 is hot. These states are determined by comparing present temperature data to the last saved data. [00157] If it is determined that the temperature did not change since last power-up (output of 1018 is NO, the module 100 is not first powered), and the sensor 410 value is greater than ambient (output of 1022 is NO), but within a defined margin to the previous temperature, i.e., close to the startup temperature (less than 12% difference, output of 1026 is YES), the old value B in the temperature register (i.e., TempReg [n .i ] in Equations (3) or (4)) is restored (1024) to indicate the motor temperature did not change (1024, 1026). If it is determined from sensor 410 that the

controller 430 temperature is less than room temperature as the module 100 is first powered, the value of B in the temperature register is reset back to zero (1022) indicating room or ambient temperature (1020), i.e., a cold power tool 10. [00158] If the controller 430 is determined to be either warm (output of 1030 is NO) or hot (output of 1030 is YES), new values for the temperature register value B are pre-loaded at steps 1028 or 1032 from non-volatile storage such a EEPROM (ROM 436). In an example, a warm controller 430 could be at 8O 0 C and a hot controller 430 (and hence hot tool 10) could be at 15O 0 C. With the same value of B or revised value of B loaded in the temperature register, the motor temperature estimation function is implemented as described above with respect to FIG. 10A. [00159] In an alternative, another method of determining if a tool is cold, warm, or hot at power-up in order to determine the initial temperature register value B is to measure the gate voltage of the triac 420 or other power device in the module 100 or tool 10. The temperature of an active device can be determined through its junction voltage. These devices may include triacs, transistors, diodes, or any other silicone device containing a PN or NP junction. Therefore, electronic module 100 or microcontroller 430 temperature can be estimated without using an additional sensor 410 such as a thermistor. The junction of the gate drive transistor of triac 420 may be used to determine temperature instead of using thermistor 410. This may be explained by the following relationships below.

[00160] The temperature to voltage relationship of a junction may be defined as shown in Equation (5) below.

V γ (T x ) - V γ (T o ) = k τ (T ι - T o ) Equation (5)

Where: T 0 = 25°C

T 1 = junction temperature ( 0 C) *><To) = junction voltage at 25°C V r (T r ) = junction voltage at T 1 k τ = temperature coefficient of junction

Example values for the above are:

T 0 = 25 0 C T x - I ( 0 C) V r (T 0 ) = 0.7V V γ {T x ) = 0.65V k τ = -2.OmW 0 C

Transposing equation (5) to solve for ^device temperature gives:

V r iTl ) ~ V r (To) +T 0 = T 1 r, = 50°C

[00161] Actual values may vary depending upon the device used within the circuit 400 of module 100. Accordingly, a potential benefit of determining if a tool is cold, warm, or hot during power-up as an input to the temperature estimate algorithm is to sense voltage of an already existing component, like the transistor at the gate drive of triac 420, in order to estimate or determine module 100 temperature/controller 430 temperature at start-up. Accordingly, module 100 or microcontroller 430 temperature can be estimated without using an additional sensor 410 such as a thermistor. [00162] Employing a motor temperature estimation routine in the module 100 versus placing a thermistor or thermocouple directly on the motor 15 may reduce cost and provide ease of use. The described method requires no additional sensors or wires to implement since all required signals and peripherals are built directly into the module 100. The task of placing thermocouples, thermistors, or wires on or around a motor 15 is not easy to accomplish and there is a risk of wires melting or shorting together. The above algorithm provides an inexpensive, efficient, and easy way to estimate motor temperature without physically accessing the motor 15. [00163] Additionally, the estimated motor temperature(s) determined from the motor temperature estimation algorithm as described in FIG. 10A may serve as an input to the microcontroller 430 so as to trigger a warning-type of protection mechanism, such as through tactile feedback, motor foldback, etc. As motor temperature begins to closely approach a motor overload condition, such as a high temperature setpoint the user can avoid reaching an overload state (due to reaching an over-temperature limit) since the microcontroller 430 initiates tactile feedback or foldback via control of the triac 420's conduction angle, or initiates a combination of

foldback with LED illumination as a warning (i.e., that tool motor is approaching an over-temperature limit), or initiates a combination of tactile feedback with LED illumination as a warning on the housing 18. . Therefore, the motor temperature algorithm may be employed to estimate motor temperature at different points in time in an effort to avoid or to detect an impending motor overload condition. [00164] FIG. 11 is a graph comparing the estimated motor temperature as calculated by the algorithm of FlG. 1OA with actual measured motor field temperature for a 120V small angle grinder configured with the example control module 100. The plotted data evaluates motor temperature algorithm estimations to actual motor temperature. As can been seen from FIG. 11 , the test to generate the plot results tested increases or decreases in motor load, and turned the tool motor on/off/on in an effort to exercise all aspects of the motor temperature algorithm. The algorithm results substantially mimic actual measured motor temperature, with a worst case difference at any one data point of about 13 degrees. [00165] FIG. 12 is an overview of the relationships between coefficient inputs, control and protection methodologies within the control module 100 and/or user inputs, collectively represented as functions in the center column of FIG. 12, and coefficient outputs from these functions in the right-hand column. In the right hand column, the output coefficient ALC refers to the breakthrough torque described above to allow a user of a power tool to finish a given job so that the motor does not burn out or stall completely.

[00166] FIG. 12 is provided to demonstrate how a single generic control module 100 can be re-programmed via non-volatile memory storage such as EEPROM or flash memory to meet the needs of a variety of different tools. [00167] The protective or control functions discussed thus far, such as the motor temperature estimation algorithm, overload control (absolute and Di/Dt clutch modes), tactile feedback, etc. may be enabled or disabled via this non-volatile memory storage. Additionally, coefficient inputs and outputs may be changed for each enabled control or protection methodology based on whether a particular soft- coded coefficient is stored in non-volatile memory such as EEPROM or FLASH memory.

[00168] FIG. 12 shows example coefficient inputs on the left, which may be input to certain functions. As shown, these functions may include the EOC functions, a torque limiting function as described above, a motor overload function (which may incorporate the motor temperature estimation algorithm in FIGS. 10A-B). The functions may also include inputs which can configured as either analog, digital, active high or active low all by changing these soft-coded coefficients in non-volatile memory as opposed to changing firmware

[00169] Different inputs and outputs may be set for different functions, and different functions may be enabled or disabled in control module 100. For example, an absolute clutch mode for the EOC can be set up in a given corded power tool using current as the input, and with the output of the function being too! shut down if the threshold is exceeded. A different tool can have a Di/Dt clutch mode setup using speed as the input to the function and turning on an LED as an output of the function if the threshold rate is exceeded. Thus, two separate tools having the same generic control module 100 inside may be configured with different functions that sample different parameters and output different results (i.e., different protective actions based on different output coefficients).

[00170] The soft-coded coefficients in non-volatile memory (which can be RAM 434, flash memory or EEPROM if alterable ROM 436 is configured as EEPROM) provide the ability to change how the module 100 interacts with a tool 10 without changing the firmware or base-code inside the microcontroller 430. By altering only the non-volatile memory of a microcontroller 430, tool performance can be altered where before this was not possible.

[00171] FIG. 14 is a block diagram of an electronic component arrangement within control module 100. One or more of the components of FIG. 14 may be integrated with a switch. The electronic components described hereafter may be arranged as part of a control circuit 1400 on the PCB 140 within the control module 100. The control circuit 1400 of the module 100 includes memory 1434, 1436 for storing one or more soft-coded function coefficients used during execution of various control functions or algorithms. Since a given soft-coded function coefficient may be specific to a particular tool application, the control module 100 may be suitable for controlling

the operation of a plurality of motors and/or for a plurality of different motor applications (e.g. different power tools).

[00172] The soft-coded coefficients can be understood to include coefficient inputs into a given function or algorithm to be performed by the control module 100, and can include function coefficients that may be changed or varied for a given tool or tool application. The soft-coded coefficients also include coefficient outputs related to a control and/or protective action to be taken by the control module 100 as a result of implementing the given function or algorithm in the control module 100. Coefficient inputs to, and coefficient outputs from a given function may be changed or linked as desired for a given application.

[00173] Control module 100 is connectable to an AC power source (AC Mains 1407) and to the motor armature 20 and tool motor field 30. In an example, the tool motor armature 20 and the tool motor field 30 may comprise an AC motor 15. The control module 100 includes the control circuit 1400 therein. The control circuit 1400 determines a position of a motor control switch 1402 and controls the control module 100 if power is provided to the motor armature 20 and motor field 30 based on the position of the motor control switch 1402 when the AC power source is applied. [00174] The control circuit 1400 includes a power supply 405 that supplies power to a microcontroller 1430 programmed to control certain operations and/or to direct certain functions or protective actions within module 100. The power supply 1405 may supply a VCC of 5V for example. A supply voltage monitor 1415 monitors the VCC and provides a sensed input to microcontroller 1430. [00175] The microcontroller 1430 can control the triac 1420 by providing a gate firing signal via line 1418 to the triac 1420. Although shown as a triac 1420, this type of electronic valve may be embodied as any of a field effect transistor (FET), an insulated gate bipolar transistor (IGBT), a silicone-controlled rectifier (SCR), a voltage control device, etc. Generally, the control module 100 controls the operation of the motor 15 by switching the AC supply voltage 1407 to the motor at periodic intervals in relation to the zero crossing of the AC current or voltage waveform, via the microcontroller 1430 and gate firing signals applied to the gate of the electronic valve 1420 via line 1418. These periodic intervals are caused to occur in

synchronism with the AC waveform (i.e., the AC supply signal input from AC mains 1407) and are measured in terms of a conduction angle, expressed as a number of degrees.

[00176] The conduction angle determines the point within the AC waveform, for both positive and negative half-cycles, at which the electronic valve 1420 is fired, thereby delivering electrical energy to the motor 15. For example, a conduction angle of 180° per half cycle corresponds to a condition of full conduction, in which triac 1420 is fired such that the entire, uninterrupted alternating current from AC mains 1407 is applied to the motor 15, i.e., the triac 1420 is fired such that current flows through the triac 1420 for each positive and negative half cycle of the AC input signal. Similarly, a 90° conduction angle corresponds to developing the AC supply voltage across the motor 15 commencing in the middle of a given half cycle, and thus the triac 1420 is fired so that approximately half of the available energy is delivered to the motor. Conduction angles below 90° correspond to firing of the triac 1420 later in a given half cycle so that even lesser quantities of energy are delivered to the motor 15.

[00177] In an example, the triac 1420 may be a single-isolated triac, where isolation is internal to the part. More specifically, operation of the motor armature 20 and motor field 30 which constitute the motor 15 is controlled by the control circuit 1400 within control module 100. To control operation of the motor armature 20 and motor field 30, the microcontroller 1430 controls the current flowing through or voltage applied to motor armature 20 and motor field 30, or both, via electronic cycling of the triac 1420. In one example, the control circuit 1400 can determine when to open or close the triac 1420 based on soft-coded coefficients that can be stored in look-up tables, or from control equations or control methodologies based upon measured factors or parameters such as voltage, speed, current, torque, other external digital inputs (1456a, 1458a etc.) or any combination of the above. A triac 1420 is one type of controlled switching device which cannot be 'opened' or turned off by the control circuit 1400. However, other devices such as FETs, IGBT's etc, can be turned off. The turn-off of the triac 1420 is decided by the AC and motor 15, which causes the current to reduce to zero to thereby allow the triac 1420 to turn-off

at each AC half-cycle. This does not reduce the control capability of the triac 1420 relative to the methodologies referred to herein.

[00178] The control module 100 controls the operation of the motor 15 when the motor control switch 1402 is placed in a closed (i.e., ' on') position, thereby allowing current to flow through. A function of the control circuit 1400 is to monitor the position of the motor control switch 1402 and prevent starting of the motor 15 if power is applied to motor 15 with the motor control switch 1402 in a shut (i.e. On ' ) position.

[00179] Microcontroller 1430 may include one or more memory elements.

Microcontroller 1430 may include program ROM 1436 (alterable ROM) such as flash memory, a CPU core such as a microprocessor 1432, on-board peripherals, and volatile memory such as RAM 1434 or SRAM on a single chip construction, for example. Examples of volatile memory include RAM (DRAM, SRAM, SDRAM,

VRAM, etc. Non-volatile memory such as Electrically Erasable Programmable

Read-Only Memory (EEPROM) and Flash memory allows the entire ROM (or selected banks of the ROM) to be electrically erased (flashed back to zero) then written to.

[00180] In an example, the microcontroller 1430 may be one of the ATMEL AVR®

8-bit RISC microcontrollers, such as the ATmegaδ flash microcontroller with 8-Kbyte self-programming Flash Program Memory (EEPROM). In the examples described hereafter, ROM 1436 may be referring to as non-volatile memory such as flash memory EEPROM or simply EEPROM 436.

[00181] However the module 100's intelligent control is not limited to the example microcontroller 1430. The intelligent control device could be embodied in hardware and/or software as another microprocessor, an analog circuit, a digital signal processor or by one or more digital ICs such as application specific integrated circuits (ASICs), for example.

[00182] The control circuit 1400 with the tool motor 15 (motor armature 20 and motor field 30) is connected in series with motor control switch 1402, triac 1420 and a shunt resistor 1440 between hot and neutral (common) sides of the power source.

In FIG. 14, one side of tool motor 15 is connected to the power source, such as to

the hot side of AC mains 1407 via the power cord 21 (FIG. 1) through the motor control switch 1402. The other side of the too! motor 15 is connected through triac 1420, shunt resistor 1440 and power cord 21 to the neutral side 1408 of the AC mains 1407.

[00183] Shunt resistor 1440 may be embodied as an analog current sensor which senses current through the triac 1420 and motor 15 and provides a representative low-voltage signal that is amplified at amplifier 1445. Amplifier 1445 has a first input coupled to one side of shunt resistor 1440 and a second input coupled to the other side of shunt resistor 1440. In an example, amplifier 1445 may be biased (i.e., a bias voltage may be applied at the input so as to shift the amplifier output). An output of amplifier 1445 may be coupled to a given port of microcontroller 1430. Shunt 1440 is merely one example of a current sensor, alternative current sensors include current transformers, digital sensors, hall-effect sensors, etc., for example. [00184] The microcontroller 1430 may include an analog to digital converter (ADC) 1433. ADC 1433 may be embedded as part of the circuitry of microprocessor 1432 and converts analog signals received from various sensors or sources to digital representations for processing by microprocessor 1432. As shown, example analog inputs include inputs from amplifier 1445, monitors 1415 and 1425, power supply 1405 and temperature sensor 1410. These inputs may be converted to digital representations in the ADC 1433 as is known for processing by the microprocessor 1432. The output from the RC filter formed by 1451/1452 is a digital input to the microcontroller 1430, as is the input from voltage monitor 1427. Lines 1456 and 1458 represent digital outputs from the microcontroller 1430, and lines 1456a and 1458a can be digital inputs, analog inputs or even digital outputs. The microcontroller 1430 outputs a digital gate firing signal (control signal) via line 1418 to control firing of the triac 1420.

[00185] The control circuit 1400 further includes a voltage shaping circuit 1450 clamped by diodes 1455 and 1457 and including an RC filter represented by resistor 1451 and capacitor 1452. The resulting signal input 1460 that is output of the voltage shaping circuit 1450 is utilized by microcontroller 1430 to sense a point in time where the theoretical, ideal sinusoidal AC voltage signal (the AC supply from

AC mains 1407) crosses the zero-axis and switches from either a positive-to- negative or negative-to-positive voltage. This point is used for timing and synchronization purposes inside the microcontroller 1430 of control module 100. [00186] The clamping diodes 1455 and 1457 protect microcontroller 1430 from damage if a voltage spike occurs in the AC source voltage. In an example, all or part of the voltage shaping circuit 1450 may be included in the control circuit 1400 or within microcontroller 1430. In one example, the clamping diodes 1455 and 1457 are internal to the microcontroller 1430.

[00187] Control circuit 1400 may include one or more temperature sensors 1410 designed to sense a temperature and to input a sensed signal via a port to microcontroller 1430. Only one sensor 1410 is shown for clarity. Temperature sensor 1410 may be embodied as an NTC or PTC thermistor, temperature sensing IC or thermocouple, for example. The temperature sensor 1410 may communicate the temperature of the control module 100, or the temperature of specific components such as the triac 1420 or microcontroller 1430. As the function of such temperature sensors 1410 are known, a detailed explanation of its functional operation is omitted for purposes of brevity. Multiple temperature sensors 1410 could be placed at designated locations within module 100 as required. [00188] Additionally, the control circuit 1400 includes two voltage monitors for monitoring voltage of the triac 1420, a gate voltage monitoring circuit (monitor 1425) for monitoring a gate voltage of the triac 1420 to determine if the triac 1420 is conducting during a negative AC half-cycle of the AC waveform applied to triac 1420, and a positive VAC half cycle monitoring circuit (monitor 1427) which is used to monitor triac voltage to determine if the triac 1420 is conducting during the positive AC half cycle.

[00189] The triac gate voltage monitor 1425 includes circuitry for monitoring both the positive and negative AC half cycles, yet software in the microcontroller 1430 doesn't utilize the gate voltage monitor 1425 in the positive half cycle due to measurement functions performed in the ADC 1433. Accordingly, both monitors 1425, 1427 are used as the microcontroller 1430 cannot use the gate voltage monitor 1425 during the triac 1420/motor current measurement, which is fully

utilizing ADC 1433 during the positive half cycle. During the negative half wave of the AC cycle, no voltage would be detected by monitor 1427, which inputs a digital signal to microcontroller 1430. Additionally, both monitors 1425, 1427 are used for detecting whether triac 1420 is conducting following firing, as will be described in further detail below.

[00190] In general, the control circuit 1400 of FIG. 14 is designed to enable module 100 to provide control for the tool motor 15. Accordingly, as the general structure and electronic circuitry of the control module 100 has been described, example control methodologies are discussed in more detail below. [00191] Triac Conduction Detection

[00192] In traditional analog triac AC motor controls, re-firing of the triac 1420 is required to ensure that the triac 1420 is turned back on if the current to a tool motor momentarily goes to zero (either due to a fault event in the electrical supply system (such as a voltage disturbance on the AC supply from AC Mains 1407) or due to the motor commutator interrupting current for a brief interval) during a particular AC half- cycle. This occurrence can happen frequently, if the motor (such as motor 15) is a typical universal motor having a commutator where the motor current can quickly decay to zero during the commutation process, or if the brushes bounce away from the commutator.

[00193] A conventional analog AC motor control system for determining whether the triac 1420 has turned off after being fired only monitors the triac gate voltage to determine whether the triac is 'on' or 'off (i.e. 'on' when the voltage is positive and above some threshold, or negative and below a threshold). However, in a conventional digital system where resources are limited (as in the case of control circuit 1400) it is typically not possible to monitor the triac gate voltage for the entire AC cycle. For example, during the positive AC half-cycle, the triac AC current needs to be measured, and as a result, the gate voltage for determining whether the triac has re-fired cannot be measured by the same analog-to-digital converter (ADC) 1 such as ADC 1433. During the negative AC half-cycle, the triac gate voltage can be monitored by the same ADC, as the current is negative and does not need to be

measured (i.e. it is assumed to be the same as the positive half-cycle). Therefore, it is possible to perform triac conduction detection only in the negative AC half-cycle. [00194] Accordingly, in an example embodiment, a triac conduction detection algorithm may be implemented by the microprocessor 1432 of microcontroller 1430 in which triac conduction detection may be performed in both half-cycles of the AC waveform. In general, the methodology checks each AC half cycle for whether or not the triac 1420 is conducting after it has been fired in accordance with a given control algorithm. The algorithm compares actual samplings of triac voltage/gate voltage taken by the two voltage monitoring circuits 1425 and 1427 against expected states to make a triac 1420 on/off determination in each half cycle of the AC supply signal.

[00195] Triac gate voltage monitor 1425 monitors the negative AC half cycle and positive VAC Vz cycle voltage monitor 1427 monitors the positive AC half cycle of the triac voltage. In general, after a zero-cross that indicates the beginning of a half- cycle, and after a given delay has elapsed (the delay is provided to wait for the known, given control algorithm to fire the triac 1420 in the given AC half-cycle), if it is determined based on the sampled voltage value that the triac 1420 is not conducting after it has fired, control module 100 attempts to re-fire the triac 1420. This check may be repeated several times at given intervals up to some minimum conduction point (i.e., such as until a 30 degree conduction angle is exceeded - in both the positive and negative half cycles of the AC waveform. This point represents the last 30 degrees in the 180 degree half-sine wave cycle.

[00196] If it is determined that the triac 1420 is not conducting upon reaching the minimum conduction point, the triac 1420 is not fired or re-fired for the remainder of the half-cycle. By checking up to the minimum conduction point whether the triac 1420 fired or not, the triac 1420 has either failed due to some fault condition or the switch 1402 is open if it has not yet fired.

[00197] If a continuous number of AC line cycles are observed where the triac 1420 has failed to conduct, then the switch 1402 is considered to be open. This enables the ability to detect an open switch 1402 without the need of a current measurement circuit.

[00198] FIG. 15 is a flow diagram for illustrating a method of detecting whether the triac 1420 needs to be re-fired in the control module 100 following an initial firing of the triac 1420 from a given control methodology. A typical control methodology implemented in the control module 100 requires a given conduction angle which sets the firing angle for both the positive and negative half cycles of the AC waveform to be identical and balanced. However, certain methodologies may cause the positive and negative firing angles to differ from each other and to vary from each other, but which still give an average equal firing in both polarities. [00199] Referring to FIG. 15, in a first half cycle, which in this example is upon detection of a negative-to positive zero cross transition of the AC waveform (1510) and hence in the positive AC half cycle, and after a delay has elapsed (1515) to wait for the known, given control algorithm in the microcontroller 1430 to fire the triac 1420 in the half cycle, the voltage across the triac 1420 is checked (1520) for re- firing using the positive VAC Vz cycle voltage monitor 1427. If monitor 1427 detects a voltage across the triac 1420 (output of 1530 is 'YES'), this generates a logic high signal in microcontroller 1430 which represents that triac 1420 is OFF, and microcontroller 1430 will attempt to re-fire the triac 1420 (at 1540) by sending a gate firing signal over line 1418 to maintain conduction. If the output of 1530 is 'NO', this indicates that the triac 1420 is ON and conducting (at 1545), generating a logic low in microcontroller 1430.

[00200] Either after re-firing the triac 1420 or if it is determined that the triac 1420 is ON and conducting, the same check at 1520 is repeated, i.e., monitor 1427 repeats sampling voltage across the triac 1420 at fixed regular intervals if the minimum conduction point has not been reached (output of 1550 is 'NO'). In an example, monitor 1427 can repeat sampling voltage across the triac every 9 degrees after the triac 1420 has fired up until the minimum conduction point is passed. [00201] As discussed above, if the minimum conduction point has been reached (output of 1550 is 'YES'), no change is made to the state of triac 1420, the triac 1420 remains in its current ON or OFF state (1555) until the next zero-cross transition is detected by microprocessor 1432. Similarly, if the triac 1420 is still OFF after the minimum conduction point has been reached an/or exceeded, it remains off in the

remaining half-cycle until the next zero-cross transition to the opposite half cycle has been detected. Accordingly, the above implementation may provide a simple logic input to the digital system (microcontroller 1430) that can easily and quickly determine the 'on'/'off condition of the triac 1420 during the positive AC half-cycle without consuming the ADC 1433 resource which can be used to measure triac 1420 current.

[00202] During the negative half-cycle, the triac gate voltage will be negative if the triac 1420 is ON and as a result for the ADC 1433 in the microcontroller 1430, the analog voltage is level shifted such that OV (at the gate) becomes about 1.8V. This is so the ADC 1433 can measure the negative gate voltages. Therefore, triac 1420 ON gives a lower analog voltage than a threshold, and triac OFF corresponds to a higher analog voltage than the threshold, which in an example could be about 1.0V. [00203] Accordingly, once the second or next zero-cross transition has been detected by the microcontroller 1430 (at 1560 in FIG. 15), which in this example is upon detection of a positive-to-negative zero cross transition of the AC waveform and upon elapsing of the set delay at 1562 , triac 1420 conduction detection is evaluated in the negative AC half cycle. In general, the triac gate voltage is sampled by gate voltage monitor 1425 (at 1565) and compared to some threshold at 1570 (such as a nominal analog voltage value) to determine whether the triac 1420 is ON or OFF. In an example, the triac 1420 is OFF and will be re-fired by the microcontroller 1430 (at 1575) if the measured voltage is higher than this threshold (e.g., nominal analog voltage value, output of 1570 is 'YES')), else it is determined to be ON and conducting (at 1580), since a triac 1420 ON in the negative half cycle gives a lower analog voltage than the threshold value.

[00204] As described above, the microcontroller 1430 will continue to attempt to ensure, by checking at regular intervals, that the triac 1420 is maintained in the on- state (output of 1585 is 'NO') from the moment it is fired until the minimum conduction point is reached (output of 1585 is 'YES'), after which the firing of the triac 1420 is no longer critical for the reminder of the half-cycle. The triac 1420 remains in its current state (at 1590) and the process at 1510 repeats upon the following zero-cross detection.

[00205] Accordingly, triac 1420 'on'/'off determination can be done in both half cycles of the triac voltage using a gate voltage monitor 1425 and/or a positive VAC 34 cycle voltage monitor 1427. Once the triac 'on'/'off' state is determined, either based on logic or based on the voltage value of the triac 1420 (depending on the half-cycle being monitored) the triac 1420 is either re-fired as necessary for the remainder of the AC half-cycle in an attempt to re-establish conduction of the triac 1420, or is maintained ON for the duration of the half-cycle via subsequent checks. Re-firing is typically limited to a given number of attempts and ceases once the minimum conduction point in any given 180 degree half-cycle is reached (a point where very little voltage is applied to the motor 15 to cause any noticeable torque or rotation, such as a 30 degree conduction angle, for example). [00206] Another function of the algorithm is to ensure that the triac 1420 is re-fired once conduction from the previous AC half-cycle has ceased. This extended conduction interval is typical for motor loads where the current can significantly lag the voltage, and as a result the current from an example negative AC half-cycle will continue into the positive AC half-cycle before the triac 1420 actually commutates Off'.

[00207] Therefore, triac 1420 firing should not commence until the triac 1420 has turned OFF from the previous AC half-cycle. This turning off point can be determined either by monitoring triac current, triac gate voltage from monitor 1425 and/or triac voltage from monitor 1427 to establish when the triac 1420 has actually turned 'off'. [00208] Zero Cross Detection

[00209] In one example, the control circuit 1400 of control module 100 may be configured to implement a zero cross detection methodology to establish reliable phase angle control for triac 1420 (also referred to as firing angle control or conduction angle control) for the triac 1420. Zero cross detection enables synchronization between the AC supply (which is an input AC voltage signal from AC mains 1407 to the tool 10 and control module 100) and the control module 100, so as to provide a desired level of noise immunity for situations where the normal AC supply is disturbed by one or both of the AC tool control itself and external influences on the AC supply signal input from AC mains 1407. Thus, accurate zero-cross

detection enables more precise timing for desired firing angle control for triac 1420, while providing a noise immune way to establish zero crossing points on AC supply waveforms which have noise (e.g., standalone AC generators). [00210] FIG. 16A is a block diagram to illustrate a zero-cross detection circuit portion of the control circuit 1400 for implementing zero cross detection; FIG. 16B is a flow chart describing a method of detecting zero crossings of the AC supply to tool 10. As shown in FIG. 16A, a low-pass filter 1450 (see FIG. 14) optionally can be combined with a digital blanking circuit 1620 within controller 1430 to implement zero cross detection. In an example, the digital blanking circuit 1620 may be a software- based algorithm stored in EEPROM 1436 and implemented by microprocessor 1432. [00211] However, the digital blanking circuit 1620 can detect zero crosses without a filtered input of the AC supply via RC filter 1450. In this example, the AC supply is digitized in controller 1430 by a normal digital input (not shown) to generate a digital signal. As it is well known for microcontrollers to have digital inputs, a detailed illustration is omitted. The digital signal is then processed in a software-based digital blanking circuit 1620 within microcontroller 1430. Functionality of the digital blanking circuit 1620 is invoked under control of the microprocessor 1432 to eliminate unwanted noisy zero crosses, as to be described in more detail below with regard to FIG. 16B.

[00212] The low pass-filter 1450 is merely one example of a filter usable to filter the AC supply signal. Alternatively, a band-pass filter (BPF) or phase-locked loop (PLL) may be used to filter a part of the AC supply signal from AC mains 1407. In an example, the LPF may filter the analog AC voltage signal to remove frequencies in excess of 80 Hz which typically represents the frequency of the noise that occurs around the zero-cross of the AC supply signal.

[00213] Referring to FIGS. 16A and 16B, which shows an example where optional filtering is employed, a part of the AC supply signal from AC mains 1407 is filtered by LPF 1450 to generate a filtered analog output signal. The analog output signal is digitized in controller 1430 by a digital input of the controller 1430 to generate a digital signal. This digital signal is then input into the software-based digital blanking circuit 1620, the functions of which are iterated by the microprocessor 1432 to

eliminate unwanted noisy zero crosses. As previously described, the digital blanking circuit 1620 is a software-based algorithm stored in memory accessible by the microprocessor 1432 from EEPROM 1436.

[00214] Referring now to FIG. 16B, to implement zero cross detection, the digital blanking functionality, under control of microprocessor 1432, accepts the first zero cross transition, as represented in the digital signal, as a validly detected zero cross signal for a given (or current) AC half cycle (1650), and then ignores or rejects remaining zero crosses (1655) in the digital signal for a specified blanking period. For example, this blanking period can be variable based on the frequency of the AC supply. All zero crosses are rejected until this blanking period has elapsed. The zero cross occurring at the next opposite polarity transition after the blanking period elapses (i.e., for a 50Hz supply, after a blanking period of 10 milliseconds has elapsed) is then accepted (1660) as the next valid zero cross in that half cycle of the AC supply voltage waveform.

[00215] This process is repeated (1670) for each given AC half-cycle such that only the first AC zero cross is used for each AC half-cycle. This blanking period (i.e., 10 milliseconds for the 50Hz example above) may be reduced to allow the control module 100 to operate over a range of AC supply voltage frequencies (e.g. 40Hz to 70Hz) and as a result, the half-cycle blanking period may be reduced to about 6-8 msec. An example blanking period for a given half cycle of the AC supply may be about 6.125 msec, for example.

[00216] Using digital blanking, with or without filtering, may enable zero-cross detection in a low cost system, while providing a robust zero-cross signal which is immune to AC voltage supplies where noise is very common, such as portable generators. The additional use of a low-pass filter may eliminate the majority of the high-frequency noise that occurs around the zero-cross of the AC supply signal. Use of a software-based digital blanking unit may eliminate other 'false' zero crosses which may occur throughout the AC supply half-cycles caused by unusual sources such as portable generators. [00217] Current Measurement Offset Correction

[00218] In an AC powered tool such as tool 10, accurate current measurement is required for control purposes in control module 100. Accordingly, voltage offsets in current measuring circuitry should be accounted for (i.e., the current measurement should be calibrated) to ensure an accurate current measurement. In FIG. 14, the current measurement circuitry includes the shunt 1440 to convert the actual measured current to an analog low voltage value representative of the current for measurement purposes. Shunt 1440 may be a low resistance value (e.g. 5 milliohms) and as a result the representative voltage (e.g. 5 millivolts per ampere) from the shunt 1440 may need to be amplified to allow a digital controller such as the microcontroller 1430 to resolve and measure the current. This amplification is provided by amplifier 1445.

[00219] In tool 10, currents up to a peak value of at least 5OA are to be measured; however this may only provide a small, low voltage signal across the shunt 1440. In an example, this voltage signal representative of measured current may be about 0.25V. Typical digital systems such as microcontroller 1430 have a 2.5V analog-to- digital converter (ADC), such as ADC 1433, which will resolve the voltage signal input from shunt 1440 to about 2.5 millivolts (i.e. 10-bit resolution). Therefore, to maximize the resolution of the ADC 1433, a gain of 10 may be introduced using amplifier 1445 between the shunt 1440 and the ADC 1433.

[00220] Amplifier 1445 may be an operational amplifier (op-amp) such as a single- supply rail-to-rail amplifier, for example. Amplifier 1445, like all amplifiers, may be biased, e.g., may have an offset voltage or bias voltage applied at its input. In an example, resistor components may be used to adjust the actual shunt voltage seen at the amplifier 1445 input, so that the output is biased. This offset voltage can be significant as compared to the 0.25V input signal from shunt 1440. [00221] Accordingly, to compensate for this offset voltage, amplifier 1445 can be biased in such a way that the op-amp offset, whether positive or negative, still permits a true zero current value to be measured by the ADC 1433 from the amplifier 1445 output under all offset conditions of the amplifier 1445. For example, the input of the amplifier 1445 may be biased in such a way that with a zero current input, the

output of the amplifier 1445 is set to be above OV or 'ground' regardless of the amplifier offset.

[00222] As a result of the amplifier 1445 biasing, it may be necessary to measure the ADC value when a true zero current condition exists so as to determine a compensative value, also referred to as a zero-current offset, to be applied to actual current measurements. The compensation value or zero-current offset is an ADC value that is measured in a situation where there is no current-the triac 1420 is not fired. For example, this is done in a functional test procedure during manufacture of the control module 100.

[00223] In this testing situation, zero current is known to exist and the ADC value output of ADC 1433 can be measured and recorded in EEPROM 1436 as a compensation value representative of the voltage offset in amplifier 1445. In general, the compensation value (i.e., an Offset ADC value' or zero-current offset) is subtracted in the microcontroller from an actual current ADC value to obtain the true current measurement for a particular sample (as scaled by the amplifier 1445 and shunt 1440). More specifically, to determine a true current measurement, such as an average current value across triac 1420 in a given half cycle, once the microcontroller 1430 senses a positive going zero cross of the AC waveform, ADC samples from the shunt 1440/op-amp 1445 are taken repetitively throughout the positive voltage half-cycle, and summed together in the microcontroller 1430. For each sequential ADC value that is output from ADC 1433, the microcontroller 1430 subtracts the compensation value (zero-current offset) to obtain the true current measurement for that ADC value. At the end of the positive AC half-cycle (i.e., the microcontroller 1430 senses a negative going zero-cross of the AC waveform, the summed value is averaged (divided by the number of samples), and at this point the result is proportional to the average AC current flowing during the AC half-cycle. In this way, any amplifier offsets from amplifier 1445 are removed from the true current ADC measurement, regardless of the actual amplifier 1445 offset bias. [00224] A potential benefit of amplifier biasing is that negative currents can be measured. The ADC 1433 is often integrated into the microcontroller 1430. It uses the same Vcc (typically +5Vdc, but possibly +3.0Vdc or any other voltage) as the

microprocessor 1432 in the microcontroller 1430. Therefore, only voltages between Vss (ground potential or 0.0 Volts) and Vcc can be measured by the ADC 1433. [00225] Typically the voltage across the shunt 1440 is amplified such that the maximum instantaneous current becomes Vcc (and Vcc is the analog reference for the ADC 1433). This is accomplished by adjusting the amplification factor of the amplifier 1445. Typically, a voltage of Vcc is converted by the ADC 1433 into the full-scale digital value. For a 10-bit ADC, full-scale is a numerical value of 1023 counts, and the 0.0 Volt conversion value is a numerical value of zero counts. [00226] In a first example, a peak current of 64 Amperes denotes a full-scale ADC output and zero amperes denotes a zero ADC output, or zero counts. Then, by adding electrical bias to the amplifier circuit while maintaining the same amplification factor, it becomes possible to shift the amplified value of zero current to Vcc/2, resulting in 511 or 512 ADC counts.

[00227] Similarly, an instantaneous current of 32 Amperes becomes 1023 counts, and an instantaneous current of -32 Amperes becomes zero counts. A value of 64 Amperes is now off scale and will be clipped to a numerical value of 1023, in this second example. The electrical bias applied to the amplifier need not be so large as to make the zero current equal Vcc/2.

[00228] In a third example, let the electrical bias be applied to the amplifier 1445 such that zero Amperes results in 96 ADC counts while the gain of the amplifier 1445 remains unchanged. Thus small negative AC currents may be measured, i.e., down to an ADC value of 0 counts. In this example, where the amplifier biasing shifts the output of amplifier 1445 such that 96 ADC counts equals 0 amps, assuming 1 amp per 16 counts, then zero ADC counts would represent -6 Amperes, 16 ADC counts would represent -5 Amperes, 32 ADC counts would represent -4 Amperes, 48 ADC counts would represent -3 Amperes, 64 ADC counts would represent -2 Amperes, 80 ADC counts would represent -1 Amperes, and 96 ADC counts would represent 0 Amperes. The full-scale current is no longer 64 Amperes but 58 Amperes. This provides a useful way to correct the AC current measurement and make allowance for small negative currents or large negative currents, as the application requires.

[00229] In module 100, the positive half-cycle current may be measured for the positive AC voltage half-cycle. Since the AC current typically lags the voltage by a small amount, some of the current flowing during the positive AC voltage half-cycle is negative. The amplifier 1445 biasing as described above therefore allows these small negative currents to be measured at the start of the positive voltage AC half- cycle. If the negative currents are inverted and considered positive in the microcontroller 1430, the complete AC half-cycle of current can actually be measured. This is discussed in more detail hereafter. [00230] Current Calibration

[00231] Proper current calibration is also necessary for accurate firing angle control of triac 1420. Current calibration is necessary from a practical standpoint to allow for shunts, amplifiers, analog references, and ADCs which have a wide range of operational characteristics. The accuracy of current measurement may be dictated by the accuracy of the shunt 1440, the amplifier gain and amplifier bias or offset at op-amp 1445, the ADC 1433 accuracy and a voltage reference for the ADC 1433 (not shown).

[00232] Current calibration may be performed during a testing phase (such as during control module 100 manufacture) to determine an ADC compensation value used to scale all current measurements. In this case, the triac 1420 conducts a known and accurate current that is sensed by shunt 1440, amplified at op-amp 1445 and input into ADC 1433 to determine an ADC compensation value. [00233] This ADC compensation value is used to compute a Current Calibration Factor (CCF) during the testing phase. For example, the CCF is equal to 128 times the expected value divided by the difference of the measured value less the zero- current value. Thus, for a zero-current value of 0, an expected value of 320, and a measured value of 320, the CCF is 128.

[00234] This CCF is recorded in microcontroller 1430 non-volatile memory and used in real-time calculations by the microcontroller 1430 to compute the actual current value from the measured current value. For example, this CCF value is stored in EEPROM 1436 and used by the operational software within the

microcontroller 1430 of the control module 100 to scale all current measurements, such that all inaccuracies of the control module 100 are calibrated out.

[00235] In an example, the CCF can be computed in such a way that values of

Shunt 1440 resistance, Amplifier 1445 gain, and ADC reference voltage 1433 give a perfect Current Calibration Factor value of 128. If the resistance of the shunt 1440 is lower than nominal, then the CCF will be greater than 128. If the resistance of the shunt 1440 is higher than nominal, then the CCF will be lower than 128. Similarly, if the Amplifier gain of amplifier 145 is lower than nominal, then the CCF will be greater than 128, and less than 128 if higher than nominal.

[00236] If the ADC reference voltage is lower than nominal, then the value returned by the ADC 1433 is greater than nominal and the CCF will be lower than

128. If the ADC reference voltage is greater than nominal, then the value returned by the ADC 1433 is lower than nominal and the CCF will be greater than 128. Thus, to perform a correction on a measured current value, the measured current value is multiplied by the CCF and divided by 128.

[00237] Accordingly, a CCF of 128 becomes multiplication by a factor of 1. If the shunt resistance is one-half of nominal, then the CCF would be 256. Suppose further that during normal operation the instantaneous current flowing through the triac 1420 is precisely that current that should give a value of 128. Then, multiplying this measured current value of 64 by 256, the CCF, and dividing it by 128 would restore the measurement of 64 to a value of 128, the proper value. It is understood that before applying the CCF, any current offset must be removed from the current measurement.

[00238] Tachometric Hysteresis for Speed Measurement and Control

[00239] In another example, control module 100 may utilize hysteresis for motor speed measurement and control. In a basic tachometric speed control system, speed is determined using a magnet on the motor and a pick-up coil (inductor) placed nearby. For example, the pick-up coil assembly 250 is configured to detect motor speed of tool motor 15. As shown in FIG. 2, in the tool motor 15 (which is comprised of a tool motor armature 20 rotating within a tool motor field 30), as the armature 20 rotates, the magnetic field from the magnets on armature 20 is picked

up by the pick-up coil assembly 250 to give an accurate reading of motor speed. Thus, as the motor 15 rotates, the voltage across the coil of the pick-up coil assembly 250 sinusoidally increases and decreases. The faster the motor armature 20 spins, the higher the frequency of the sinusoid.

[00240] FIG. 17 illustrates an example circuit used in motor control module 100 to determine motor speed. FIG. 17 is provided to illustrate a way to measure the motor speed using a pickup inductor and a comparator so as to output a set of pulses within the microcontroller 1430. The frequency of the pulses is directly proportional to the speed of the motor 15. Once actual speed is measured, the microcontroller 430 can perform a control algorithm to control the measured speed to a desired value as determined by various control inputs.

[00241] Microcontrollers such as microcontroller 1430 in FIG. 14 may contain one or more comparators which can trigger a response if the comparator output goes above or below a reference voltage. As shown in FIG. 17, circuit 1700 includes a comparator 1710, a voltage divider circuit 1720, an RC filter 1730 and a hysteresis resistor (shown as R3). The voltage divider circuit 1720 (resistors R1 and R2) creates a fixed voltage reference (Vref) as one input 1715 to the comparator 1710. The second input (tachometric input 1725) is the voltage signal (Vcoil) from the pickup coil assembly 250. The second input 1725 is filtered by the RC filter 1730 to reduce the amount of noise going into the comparator 1710. As Vcoil increases to exceed Vref, the microprocessor 1432 in controller 1430 sees a low output at the comparator 1710. As the motor voltage (Vcoil) drops below Vref, the microprocessor 1432 sees a high output on the comparator 1710.

[00242] The controller 1430 measures the time period between these high-to-low- to-high transitions, motor speed can be determined. Without hysteresis, the reference voltage Vref is fixed and will not change. If the measured voltage signal Vcoil is hovering around the Vref and noise is induced in the system, the microprocessor 1432 would see multiple high/low transitions resulting in inaccurate speed measurements by the controller 1430.

[00243] To prevent this from occurring, the microcontroller 430 employs comparator hysteresis using a hysteresis resistor to provide speed measurements

from the pick-up coil. In FIG. 17, circuit 1700 includes a third hysteresis resistor (R3) controlled via software through a port pin 1740 on the microcontroller 1430. If the port pin 1740 is configured as an output and connected to ground, the resistor R3 affects the voltage divider created by R1 and R2 by reducing Vref. [00244] However, once a low-to-high transition occurs, the port pin 1740 is reconfigured as an output and connected to Vcc. This changes the voltage divider circuit 1720 so that it includes the parallel combination of R1 and R3, thus increasing the value of Vref (as the value of Vref is determined by the values of R1, R2, R3). Now Vcoil must increase to a higher value before the comparator 1710 will switch output again.

[00245] Accordingly the controller 1430 employs comparator hysteresis, using the hysteresis resistor R3, in providing speed measurements from the pick-up coil in close proximity to a rotating magnet of the tool motor 15. The changing/switching of the voltage reference level Vref using hysteresis makes it less likely for any noise on the second tachometric input 1725 of the comparator 1710 to exceed the switched reference level (as the switching of the port pin 1740 moves the reference away from the switching point of the comparator 1710) and minimizes false comparator 1710 output events. This combination may provide software level control of the comparator 1710 output, potentially providing more reliable speed measurements as noise on the tachometric input (second input 1725) is compensated for using the hysteresis resistor R3 to adjust Vref. [00246] Average Current Estimation

[00247] The control module 100 estimates average current flowing through the triac 1420 using an estimation algorithm in an effort to control the conduction angle of triac 1420 in response to changing load of the tool motor. Accurate estimation of the current flowing through the triac 1420 is conducive to accurate control. There are multiple ways to characterize time-varying current that has a mean value of zero amperes, such as through calculations of Root-Mean-Square (RMS) current and average current.

[00248] Average current could also be computed for negative excursions, i.e., in the negative AC half-cycle, but this value must be the same as average current

during positive excursions over the fundamental frequency period of time. Accordingly, in an example below current flowing during the positive half-cycle will be used to estimate average current.

[00249] Typically, RMS current computations are prohibitive in a microcontroller while average current computations are not. Accordingly, the examples proved below are described with respect to average current computations, it being understood that accurate estimation of the current flowing through the triac 1420 for accurate control could be achieved using RMS calculations. [00250] The control module 100 detects zero crossings by monitoring the AC supply voltage that powers the power tool 10 and the module 100. The zero- crossings may be used to establish the AC power frequency so that the microcontroller 1430 may apply corrections to its outputs to compensate for deviations from the nominal frequency. Furthermore, the positive-going zero crossing of AC supply voltage marks the beginning of the positive half-cycle, and the negative-going zero crossing of AC supply voltage marks the end of the positive half- cycle.

[00251] FIG. 18 illustrates an example positive half cycle of an AC voltage waveform. Referring to FIG. 18, the period of time between the positive-going zero- crossing (at 1810) and the negative-going zero-crossing (at 1820) defines the positive AC half-cycle. During the positive half-cycle of voltage, the current through the shunt 1440 is measured and accumulated; these are show as samples 1830. Typically at the conclusion of the positive half-cycle, this accumulation is divided by the number of samples, providing the average current flowing through the triac 1420 during the positive half-cycle of the AC voltage waveform. [00252] As discussed previously, biasing of the op-amp 1445 to shift the ADC counts allows negative current to be measured by the ADC 1433, down to the limit of the biasing. Applying a bias voltage to the op-amp 1445 effectively shifts the range of current values that may be measured, such that a handful of negative current values may be measured in the vicinity of the negative-to-positive transition of the positive AC half cycle.

[00253] Because the tool motor 15 presents a partially inductive load, the AC current will not be completely in-phase with the AC voltage, but will be slightly out-of- phase. The phase angle between voltage and current will be neither zero degrees (purely resistive) nor 90 degrees (purely inductive), but somewhere in between. Thus, the current will have both an in-phase component, and an out-of-phase component, with respect to the voltage.

[00254] With some inductance, the current will not be zero when the voltage waveform crosses zero in either direction. Thus any current measurements just after a positive-going voltage zero-crossing, or just prior to a negative-going voltage zero- crossing, could be negative or positive respectively.

[00255] FIG. 19 illustrates an AC voltage and current waveform for a purely inductive load. A conventional current averaging estimation algorithm takes the sum of all individual current measurements and then divides by the number of measurements (number of samples) at the end of the positive half-cycle (when the voltage waveform crosses zero in the negative-going direction). If certain measured individual current samples are negative, these negative values effectively subtract from the summation of current over the positive voltage half-cycle; this skews the calculation for estimated average current downward from its true value, because the average current value is assumed only for the positive AC half-cycle of current. [00256] For example, and referring to FIG. 19, if the load (tool motor 15) was purely inductive, the average current over the positive voltage half-cycle would be exactly zero. In FIG. 19, the negative area under the current curve, from 0 to 90 degrees, exactly equals the positive area under the current curve, from 90 to 180 degrees. Thus the average current is precisely zero over this interval. However, the true current is clearly not zero, but rather some non-zero value. [00257] FIG. 20 illustrates voltage and current waveforms in the positive AC half cycle for a slightly inductive load to describe a method of estimating average current in accordance with an example embodiment. As shown in FIG. 20, an improved algorithm to estimate true average current (for positive half-cycles) may disregard the individual negative current measurements; these samples would not be added or accumulated to the sum of current measurements in the positive half-cycle. The

total sum of current measurements would thus equal the summation of non-negative current measurements between the two zero-cross transitions. As shown in FIG. 20, the two measurements indicated at 2010 would be ignored. [00258] Accordingly, ADC values determined by ADC 1433 from the non-negative samples measured by shunt 1440 would be accumulated, then divided by the total number of all measurements in the half-cycle between the two zero cross transition points in order to determine the estimated Average current. The resulting estimated Average current value would be closer to the true average current. Another estimate of the Average current would accumulate ADC values determined by ADC 1433 from the non-negative samples measured by shunt 1440 and then divide by the total number of non-negative measurements in the half-cycle between the two zero cross transition points. Accordingly, in the example of FIG. 20, ignoring negative current measurements may improve the estimation of Average current flowing through the triac 1420.

[00259] FIG. 21 illustrates voltage and current waveforms in the positive AC half cycle for a pure inductive load to describe a method of estimating average current in accordance with another example embodiment. Instead of ignoring the negative current measurements, if the individual negative current measurements are actually subtracted from the summation of current measurements, rather that being added, then the summation of current measurements will produce a more robust estimation of the average current. This is because subtracting negative measurements is equivalent to taking the absolute value of all current measurements before summation.

[00260] Accordingly, as shown in FIG. 21 , the average current over the positive voltage half-cycle is equal to the average current over the positive current half-cycle. The estimation of average current flowing through the triac 1420 may be even more robust if the current waveform is symmetrical about the 90 degree phase point, as shown in FIG. 21. Further, by biasing the op-amp 1445 for the shunt 1440 measurements so that zero current (as determined by microcontroller 1430 reading the ADC values) is the mid-point of the measuring range, accurate current measurements may be made over the entire 360 degrees of the AC cycle.

[00261] For example, the op amp 1445 may be biased at its input so that its output to ADC 1433 allows a full range of positive and negative current measurements to be measured by microcontroller 1430 at the output of ADC 1433. This would bias the zero-current shunt signal to the mid-point of an example measuring range, such that a range encompassing a number of negative and positive current measurements could be measured. An example range may be between +/-32 Amperes of current. This allows current to be computed over a complete AC cycle. [00262] FIG. 22A is a flowchart for illustrating a method for estimating average current through the triac of the motor control module in accordance with an example embodiment; FIG. 22C is a flowchart for illustrating a method for estimating average current through the triac 1420 in accordance with another example embodiment. FIGS. 22A and 22B correspond to the graph of FIG. 20, and FIG. 22C corresponds to the graph of FIG. 21.

[00263] Referring to FIG. 22A, the microcontroller 1430 senses a positive-going zero-crossing of the AC voltage waveform (2210), which is a trigger for the microcontroller 1430 to begin sampling the current via the shunt 1440/op-amp 1445 at regular intervals (2220). For each ADC value representing a given current sample that is received from the ADC 1433, the microcontroller 1430 will determine an adjusted value (2230). This is done by subtracting a zero-current offset from the ADC value to get the adjusted current sample value. This zero-current offset has also been referred to as a compensation value above, and has been previously determined in testing/calibration during control module 100 manufacture. The zero- current offset is stored in non-volatile memory such as ROM or EEPROM 1436. [00264] As described in FIG. 20, the microcontroller 1430 next adds only those adjusted values that are positive (2240) to determine a sum. Negative current samples are ignored. Once the microcontroller detects the negative-going zero- crossing of AC voltage waveform (2250), the sum is divided (2260) by the number of samples to determine the estimated Average current. FIG. 22B is the same as FIG. 22A, with the exception that the estimated Average current is determined by dividing the sum by the number of non-negative samples (2260a), instead of all samples.

[00265] FIG. 22C includes the same steps as FIG. 22A to estimate average current with the exception of step 2240b. This illustrates the alternative method using absolute values of all current samples in the sum operation. The microcontroller 1430 thus adds the absolute values of all the current samples in the positive AC half cycle (2240) in determining the sum. The negative current samples within the positive AC half cycle are therefore included in the Average current calculation, but are additive to the sum as the absolute value is used. [00266] Oscillator Calibration in the Microcontroller

[00267] Many microprocessors and microcontrollers use an internal oscillator as a fundamental clock for the execution of programmed instructions. Typically, these internal oscillators are not precise and can be adjusted by means of an oscillator calibration register within the microcontroller.

[00268] Microprocessor manufacturers adjust these oscillator calibration registers at their factory to give a certain frequency of oscillation at nominal operating voltage and nominal room temperature. At other operating voltages, and other temperatures, the fundamental frequency of oscillation may deviate from the norm. [00269] In certain applications, such as measuring the AC line frequency, it becomes essential to maintain a precise frequency of operation. This requires a precise frequency of oscillation. This may be achieved by performing a functional test, and subsequent calibration of the oscillator calibration register, within the motor control module containing the microprocessor or microcontroller. [00270] The oscillator in microcontroller 1430 of the control module 100 should be adjusted because the AC line frequency needs to be measured to determine if it is 50Hz or 60 Hz, which are typical operating frequencies, or if the AC line frequency is at another, different frequency used to communicate with the module 100 for the purpose of loading and reading coefficients necessary for the proper operation of the power tool. Accordingly, an example implementation to calibrate the fundamental frequency of oscillation in microcontroller 1430 is to count the number of oscillations between successive zero-crossings of the AC line which powers the control module 100. Either current or voltage can be sampled.

[00271] Microcontroller 1430 includes counters that can count the fundamental frequency, which may be divided by some prescaler within the microcontroller 1430. If the number of counts between successive zero-crossings is lower that expected, then the oscillator calibration register in microcontroller 1430 is changed by writing a new value to the register so as to increase the frequency and thus increase the number of counts. If the number of counts between successive zero-crossings is higher that expected, then the oscillator calibration register is changed in such a way (such as by writing a new value to the register) as to decrease the frequency and thus decrease the number of counts between successive zero-crossings. [00272] Accordingly, in a general example, the oscillator calibration register in the microcontroller 1430 can be calibrated so that the fundamental frequency of oscillation enables precise measurement of the AC line frequency. For example, an initial oscillator calibration register value is set, and the number of frequency oscillations between successive zero crossings of the AC waveform is counted by software in microcontroller 1430 to determine a count. This count can be compared against a nominal count value stored in memory of the microcontroller 1430 (i.e., some threshold). If the count is less than the nominal count value, the oscillator calibration register is calibrated by the microcontroller 1430 increasing the fundamental frequency of oscillation in the oscillation register. If the count is greater than or equal to the nominal count value, the microcontroller 1430 decreases the fundamental frequency of oscillation in the oscillation register. [00273] The example embodiments being thus described, it will be obvious that the same may be varied in many ways. Such variations are not to be regarded as departure from the example embodiments, and all such modifications as would be obvious to one skilled in the art are intended to be included within the scope of the appended claims herein.