You are on page 1of 13

Copyright Global Innovations Technologies GLINTEC2006

Proportional Motor Controller (PMC) Ver. 1.0


ON-OFF & Proportional Controller Embedded System
By GLINTEC

The PMC is a helpful platform designed for implements control systems like temperature control system and speed control system in CD motors (rpm) and stepper motors too. This manual explains some features of the PMD platform; the system is based in the PIC microcontroller 16F882. High-Performance RISC CPU: Operating speed: - DC 20 MHz oscillator/clock input - DC 200 ns instruction cycle Special Microcontroller Features: Precision Internal Oscillator: - Software selectable frequency range of 8 MHz to 31 kHz - Software tunable - Crystal fail detect for critical applications Wide operating voltage range (2.0V-5.5V) Industrial and Extended Temperature range High Endurance Flash/EEPROM cell: - 100,000 write Flash endurance - 1,000,000 write EEPROM endurance - Flash/Data EEPROM retention: > 40 years Program memory Read/Write during run time In-Circuit Debugger (on board) Low-Power Features: Standby Current: - 50 nA @ 2.0V, typical Operating Current: -11 A @ 32 kHz, 2.0V, typical -220 A @ 4 MHz, 2.0V, typical Watchdog Timer Current: -1 A @ 2.0V, typical Peripheral Features: 24/35 I/O pins with individual direction control: - High current source/sink for direct LED drive - Ultra Low-Power Wake-up (ULPWU) Analog Comparator module with: - Two analog comparators - Programmable on-chip voltage reference (CVREF) module (% of VDD) - Fixed voltage reference (0.6V) A/D Converter: - 10-bit resolution and 11/14 channels Enhanced USART module: - Supports RS-485, RS-232, and LIN 2.0 In-Circuit Serial Programming TM (ICSPTM) via two pins

Reproduction forbidden without Global Innovation Technologies written authorization - All Rights Reserved

Copyright Global Innovations Technologies GLINTEC2006

The schematic of the IC is showed in the figure below for more information about the Pic 16f882, refer to [Microchip].

Figure 1.1. PIC 16F882 Schematic. 2. Features of PMC platform. PMC platform can be programmed externally for implements ON-OFF controller or Proportional plus Bias controller. Each one has its parameter range from 0 to 100% in increments of 10%. For program the parameter(s) in the controller; the user has to implement an interface with three buttons each one manipulates the increment, decrement and enter. The values of the parameters can be displayed into LCD display; specifically a parallel LCD display of two lines (see figure 2.2).

Figure 2.1. Configuration Pins of the LCD display. When the circuit is turn on, in the LCD you must to see a shift message like show in the figure 2.2.

Figure 2.2. Initializing PMC.


Reproduction forbidden without Global Innovation Technologies written authorization - All Rights Reserved

Copyright Global Innovations Technologies GLINTEC2006

Continuing with the sequence appears a message which displays the name of the application PROPORTIONAL MOTOR CONTROLLER (PMC V1.0). If everything is correct, you must to see other label; Sel Opc... (Select option) you can select three options of control. 1. Controlling a Servo Motor. 2. Controlling a Stepper Motor. 3. Controlling a Direct Current Motor. Each one will be explained in the next sections.

Figure 2.3. Select option. For select a specific option, you must enter an easy code, only pressing one or two buttons (see sections 3 to 5). 3. Controlling a stepper motor. Stepper motor is an actuator very useful in robotics, because it has a high precision to pose the final actuator in a manipulator, or get the odometry in mobile robotics. There are two kinds of stepper motors, unipolar and bipolar, each one has pros and cons, the difference in these actuators are the number of pins, the first has 4 terminals and the second 6 terminals; but this chip is capable to control both, one schematic is showed in the figure 3.1.

Figure 3.1. Unipolar and bipolar stepper motor The user can control a stepper motor through these steps:

Reproduction forbidden without Global Innovation Technologies written authorization - All Rights Reserved

Copyright Global Innovations Technologies GLINTEC2006

1. Select the routine named Stepper Motor Controller (PRESSING THE DECREMENT BUTTON), in the LCD appears Stepper Motor.

2. Put the number of degrees to move the stepper motor (SM) pressing the increment or decrement button. Remember that youre using a relative reference, i.e, the initial position is 0, you can select (1, 180] in range (only half turn). Obviously, the range is only half turn but is not a weakness of the platform because you can set more than 1 spin if you wish (maximum 180). Now if you agree with the value, press the enter button.

3. In these step you must assign the proportional gain (Kp) try to assign the optimum gain pressing the increment or decrement button; remember that the gain is the main element into the controller if you dont set a correct gain, probably youll see an unexpected behavior. When youre agree with the proportional gain value (Kp) press the enter button.

4. The third parameter to set is the number of turns, by default is assigned to 1 but you can set other value (maximum 180), just press the increment decrement button; if you finish to setting the value, press enter.

5. Enjoy the sequence that you programmed.


Reproduction forbidden without Global Innovation Technologies written authorization - All Rights Reserved

Copyright Global Innovations Technologies GLINTEC2006

Example I. The current example shows step by step how to run a sequence in the Control Stepper Routine. Suppose that you want to set the reference to 90, remember that the current position is in 0 (relative position) so: 1. Select the routine named Stepper Motor Controller in the LCD menu then press enter.

2. Put the number 90 into var[0], these are the degrees value in this example; then press the enter button.

3. Press the increment button and set the value to 1; in this case we dont want to get more than 1 turn; press enter.

4. Probably in this case, the current value of the proportional gain is not correct but only is an example, the value assigned is 32, press the enter button.

5. Now watch what happen with your earlier assignations. Does it work correct? Was it the 90? Example II. In the previous example only we want 90 but in this the reference will be 360+90=450, is the same to 1 turn 90. Remember that is not possible to assign 450 in the platform, but, how can we do it? Well just follow the steps: 1. Select the routine named Stepper Motor Controller in the LCD menu then press enter.

2. Put the number 90, this is the degrees in this example and then press the enter button.

Reproduction forbidden without Global Innovation Technologies written authorization - All Rights Reserved

Copyright Global Innovations Technologies GLINTEC2006

3. Press the increment button and set the value to 1; in this case we want to get 1 turn (360 more); press enter.

4. The current value of the proportional gain is set up to 34, if you make the previous example you observed that the current value was 32 this is because the system has a local memory and preserve the earliest values. Press the enter button.

5. Does it work correct? Was it the 450?

4. Controlling a Servo motor. Servo motor is likewise an actuator very useful in robotics; there are 2 kinds of servo motors, each with an operational range of 0 to 90 or 0 to 180. The main features are the high torque, the precision and few connections only 3 wires 2 of them are to supply the energy and the third for control the orientation; one picture in the figure 4.1.

Figure 4.1 Servo motor. The user can control the servo motor through these steps: 1. Select the routine named Servo Motor Controller (PRESSING THE INCREMENT BUTTON) in the LCD appears the label Servo Motor Controller and starts to blink one led (indi_1).

Reproduction forbidden without Global Innovation Technologies written authorization - All Rights Reserved

Copyright Global Innovations Technologies GLINTEC2006

2. Enter the number of degrees to move the servo motor pressing the increment or decrement button. Remember the servo motor has limits 90 or 180 so the value must be consistent with the specifications of your servo. Now if you agree with the degrees to move, press the enter button.

3. The second parameter to set is the proportional gain it must be between 0 to 100%, by default is assigned to 0 but you can set other value (maximum 180), just press the increment decrement button; if you finish to setting the value, press enter.

4. Although there are a third variable to be entering this has a value of 1 by default, so if you want to press enter no problem!. 5. Enjoy the sequence that was programmed you must see in the LCD something similar to the following figure.

5. Controlling a CD motor (Fan). This section explain about how you can control a current direct control, like a fan of CD, with this you can control the temperature inside of a canister. Controlling the
Reproduction forbidden without Global Innovation Technologies written authorization - All Rights Reserved

Copyright Global Innovations Technologies GLINTEC2006

temperature is very important in the industry, many process needs a specific temperature to produce a good product. This section. The user can control the temperature using a CD motor (fan): 1. Select the routine named Temperature Controller (PRESSING THE INCREMENT BUTTON and DECREMENT at the same time) in the LCD appears the label Temperature Controller and starts to blink one led (indi_3). 2. The first value is the degrees; if youre using the LM35 temperature sensor, you will have measurements in Celsius; otherwise like LM34 youll Fahrenheit degrees. For a correct use of the PMC use a LM35. The operational range is in 1 to 100C (check the datasheet about LM35).

3. The second variable to introduce is the proportional gain, with this and like before, youre using a proportional controller and the gain is in percentage (0 to 100%) try to set a correct value for your system. Now if you agree with the constant (Kp), press the enter button. 4. Finally the third variable is the Bias value, you can put it or not, remember is only a Bias in the controller. The limits are 1 to 180.

5. After all, you must see something like this in your LCD, where SP means Set Point of the temperature that you set in the step 2 and CT (Current Temperature) is the temperature that measures the LM35. If you see the value 65530 like in the figure, means that the LM35 doesnt work properly, or there is nothing connected in the PMC.

6. Enjoy your sequence that was programmed.

Reproduction forbidden without Global Innovation Technologies written authorization - All Rights Reserved

Copyright Global Innovations Technologies GLINTEC2006

6. Connecting the PMC in your test board. In this section you learn how to wire your own circuit for control 3 different kinds of motors, put attention while you connect the sources and remember, the motor is an actuator with much more current sink than the microcontroller, probably you must have a different source to supply them. The schematic configuration of the PMC platform is showed in the figure 6.1.

Figure 6.1. Configuration of the PMC The CI has 28 pins each one with a function to control a specific actuator, to display information and to acquire the signal input through the sensor or pressing the buttons. The basic connections for this platform are explained in follows. 6.1 Visual Indicator Section. Each device must has a signal that specifies if it works properly or not, the best form is using visual indicators like lamps or leds, PMC has three indicators leds to ensure its correct performance; each one is active when a specific subroutine is active; the led is blinking while the program is executing. Figure 6.1.1 shows a proposed connection with the PMC.

Reproduction forbidden without Global Innovation Technologies written authorization - All Rights Reserved

Copyright Global Innovations Technologies GLINTEC2006

Figure 6.1.1. Schematic Indicators. 6.2. Selecting Section. Now you know that the PMC has three modes of control (Servo motor Control, Stepper Motor Control and Temperature control), the way to accede at one subroutine is by 3 buttons in the same form you must assign the values of reference signal and gains controller.

Figure 6.2.1. Schematic Indicators. 6.3. Fan Controller Section. This section provides a simple circuit to operate a fan DC the objective is keep constant temperature inside a canister, remember the DC motor it cannot be connected directly to the PMC. A schematic diagram for connected is showed in the figure 6.3.1; keep in mind that if your Fan needs more than 500 mA and 12 VCD probably you must design other circuit.

Reproduction forbidden without Global Innovation Technologies written authorization - All Rights Reserved

Copyright Global Innovations Technologies GLINTEC2006

Figure 6.3.1. Connecting a Fan 6.4. Stepper Motor Controller Section. This section shows a schematic to interface with a bipolar Stepper motor the circuit to use is the H bridge L293B IC for protect the PMC platform like showed in the figure 6.4.1.

Figure 6.4.1. Interfacing a Bipolar SM. 6.5. LCD Section. The LCD gives a easy way to see the values and data points that the PMC platform is sending, and the values that you are entering into the controller. You find in this section a schematic to implement (Figure 6.5.1); in the right side you can see the pins assignation of the PMC platform. While in the figure 6.5.2 shows the virtual board (double layer) within the specifications of the components shown in the last sections.

Reproduction forbidden without Global Innovation Technologies written authorization - All Rights Reserved

Copyright Global Innovations Technologies GLINTEC2006

Figure 6.5.1. LCD and PMC schematic section.

Figure 6.5.2. Virtual board of PMC top and bottom layer.

Reproduction forbidden without Global Innovation Technologies written authorization - All Rights Reserved

Copyright Global Innovations Technologies GLINTEC2006 Notes:

Reproduction forbidden without Global Innovation Technologies written authorization - All Rights Reserved

You might also like