4.7. PICDEM Board Simulation

• Mechatronics board simulation schematic

• Mechatronics board circuit operation

• Mechatronics board applications

A simulation version of the PICDEM mechatronics board created in Proteus VSM is provided on the support Web site www.picmicros.org.uk. The ISIS schematic is shown in Figure 4.14. The circuit has been organized into functional blocks, and some hardware features are not included to simplify the schematic.

Figure 4.14. PICDEM Mechatronics Board Simulation Schematic


For example, generic drive FETs were used for compactness on the schematic, rather than the specific devices. It was not necessary to include the circuit of the optical interrupter interface, since the DC motor and pulse encoder are modeled in VSM as one component. The RS232 interface is designed to work primarily with a terminal software module provided with the PICDEM kit and therefore also was not included. Components such as decoupling and filtering are used only where essential for accurate circuit modeling. The overcurrent sensing circuit has a simulated input added because variations in the motor loading cannot be represented; this also allows the operation of this part of the circuit to be tested independently. The back emf from the DC motor can be modeled by a voltage source or simple pot if required.

The component numbering is the same as the hardware wherever possible. The circuit connections between the main blocks are made via terminal labeling in the schematic. User connections for particular applications can be added as required.

Circuit Description

The central component of the PICDEM mechatronics board is the PIC 16F917, whose main distinguishing feature is the integral LCD drive facility. The 3.5-digit LCD outputs occupy a large proportion of the available I/O pins, leaving a limited number for the other peripherals. The digit segments are enabled by appropriate combinations of the segment and common inputs (see Section 4.2 for details). These are defined in an include file, which must be added to the application project. Three bias voltages are also required by the LCD at Vcc, 2Vcc/3, and Vcc/3; these are generated by a simple resistive divider.

The push-button (tactile switch) inputs on the hardware are represented by toggle switches, so that they can be left in the closed position if necessary when running the simulation. They can be replaced with buttons if preferred. A bank of active high LEDs are provided for output monitoring. The temperature and light sensors are modeled as generic devices, with user control of the set variable. They normally are connected to an analog input on the MCU, either a comparator or an ADC input.

The drive control logic is also modeled using generic devices for the discrete CMOS gates but with specific devices for the enable logic. The driver MOSFETs themselves are generic, so actual device characteristics may not be represented exactly. This is not a significant issue, since the motor models are also generic.

The PMOSFET is switched on when its gate is taken low, and the NMOSFET is switched on when its gate is logic high. No additional interfacing is necessary, which is a great advantage of the FET over other types of current driver, such as bipolar power transistors. In addition, the FET is voltage operated and input resistance at the gate is very high, giving negligible loading on the control logic outputs.

The flywheel diodes in the output are added to cut off the back emf from the inductive motor load when switching off the windings, a standard arrangement with inductive loads. This high-voltage pulse could otherwise damage the FETs. The specific FETs used in the actual hardware have Schottky diodes across the outputs, which perform a similar protection function.

A motor overcurrent is detected by a 0.1-Ω resistor, through which all driver currents flow to the ground. This generates a voltage of 100 mV at 1 A, and a noninverting amplifier with a gain of 10 increases this to 1.0 V. This voltage is monitored by a comparator stage, which has a reference voltage generated by a pair of diodes in series giving just over 1 V. When this voltage is exceeded, the comparator output triggers the overcurrent latch, which disables the bridge drivers via their control logic. This latch needs to be reset via the CLR FAULT push button on power-up or when an overcurrent condition has been cleared.

Logic functions controlling each half bridge driver have been derived from inspection of the control logic in the schematics of the mechatronics board in the PICDEM User Manual.

Source FET on: !Pg=P.F.(!(M.N))

Sink FET on: Ng=M.N.F

where

Pg=PMOSFET gate (active low),

Ng=NMOSFET gate (active high),

N=N input from MCU,

P=P input from MCU,

M=PWM input from MCU,

F=FAULT input (disable all outputs).

The operation of each bridge driver deduced from these functions is represented in Table 4.8

Table 4.8. Bridge Driver Control Logic States
InputsOutputsResultDriveState
PMNFPgNg
XXX010Bridge disabled, both offOFF1
0X0110Bridge disabled (default input)OFF2
110100Source on, Sink offSOURCE3
X11111Source off, Sink onSINK4
10X100Source on, Sink offSOURCE5
00X110Bridge disabled, both offOFF6

Note: Default input (open circuit links) is shown in bold. , which shows only the significant logic conditions. The full logic table confirms that the important fact that the FETs are never on at the same time, which would effectively short out the drive supply. F always disables the output when low (power-up condition from the overcurrent circuit). For most input combinations, the half bridge is disabled (safe).

When the bridge control inputs are not connected, the P and N inputs are pulled low (0), the M input pulled high (1) (logic states shown in bold), and the outputs are disabled (Pg=1, Ng=0, State 2). They are also unconditionally disabled when F is low (Fault mode, State 1).

Assuming we start with all inputs open circuit and both FETs off, the bridge is switched to the Source mode when the P input is taken high (State 3) and to the Sink mode when N is taken high (State 4). The Sink mode can be used to switch a load connected to the positive supply on and off or to provide single-ended PWM drive.

For full-bridge operation, P1 and N2, P2 and N1, and M1 and M2 are linked via the six input links. Drive 3 and 4 inputs are linked in the same way. In this mode, load current is bidirectional and can be reversed by toggling M with P and N high (States 4 and 5). States 4, 5, and 6 allow the bridge to be switched between Sink, Source, and Off.

Demo Applications

The mechatronics board simulation represents fixed connections around the MCU by labeled terminals. Additional connections can be made to uncommitted pins using the normal wiring tools in ISIS, allowing the demo applications to be tested. Note, however, that only the full version of ISIS is guaranteed to allow complete control of the simulation. Therefore, different versions of the mechatronics board schematic configured for testing particular applications are provided on the support Web site.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.93.210