Вы находитесь на странице: 1из 9

Chapter 5.

Actuation: Motor Control using an H-Bridge, PWM Signals

5.1. Understand H-Bridge Operation


5.1.1. Objective Understand the basic operation and functionality of the SN754410 H-Bridge.

Figure 83: SN754410 H-Bridge

5.1.2.

H-Bridge Operation Be sure to make the connection as shown below:

Figure 84: H-Bridge Connection Determine the output of the H-Bridge based on different inputs from the power supply. Use it to complete the table below:

77

Input A H

Table 2: H-Bridge Data Table Output Y

78

5.2. Drive DC Motor with PWM and H-Bridge


5.2.1. Objective This chapter focuses on running a DC motor with PWM and an H-Bridge. On completion of the exercise you will: Have used PSoC Designer to create a Motor Drive Project. Understand the basic operation and functionality of the SN754410 H -Bridge. 5.2.2. System Level Diagram

Figure 85: System Diagram 5.2.3. Conceptual Background The motor control in this lab will drive a motor both forward and backward. It will also allow for speed control by using a PWM. The direction that the voltage will pass through our motor will be determined by the H-Bridge. The signals passed into the H-Bridge will control which gates are open, this will then determine which way the voltage will be going through our motor. The PWM signal will dictate the rate at which the gates open and close. This will allow us to determine how quickly the motor is spinning.

79

Figure 86: Pin Numbering for SN754410 H-Bridge

Figure 87: Schematic Diagram of a Motor 5.2.4. Equipment Required PSoC Designer 5.0 Software PSoC Mini Programmer USB Cable Simple DC Motor SN754410 H-Bridge CY3210-PSoC Evaluation and CY3210-MiniEvaluation board

80

5.2.5.

Choose and Place User Modules

Figure 88: Select a PWM module

Figure 89: Select LED Module 5.2.6. Set Global and User Module parameters

81

Figure 90: PWM8 Properties Dialog Box

Figure 91: LED properties Dialog Box 5.2.7. Define Pin-out for the device

Figure 92: Select a Pin for output for PWM8

82

Figure 93: Connect the Output as shown

Figure 94: Connect it to Port_1_4

83

5.2.8.

Coding

//---------------------------------------------------------------------------// C main line //---------------------------------------------------------------------------#include <m8c.h> // part specific constants and macros #include "PSoCAPI.h" // PSoC API definitions for all User Modules

void main(void) { PWM8_1_Start(); LED_1_Start(); PWM8_1_WritePulseWidth(0xBA); LED_1_Off(); // Insert your main routine code here. }

5.2.9.

Programming PSoC module Save the file Generate configure file Compile main project Build the project Program->Program Part Select MiniProg1. Set the Acquire Mode on power cycle if external power is not supplied and vice versa.

Figure 95: Program Part Settings

84

5.2.10.

Demonstrate working configuration

Figure 96: Connection for Bridge and Motor

5.2.11.

Suggested Modifications

85

Вам также может понравиться