当前位置:高等教育资讯网  >  中国高校课件下载中心  >  大学文库  >  浏览文档

电子科技大学:《嵌入式系统设计 Embedded Systems Design》课程教学资源(课件讲稿)Chapter 5 ask Management

资源类别:文库,文档格式:PDF,文档页数:25,文件大小:545.98KB,团购合买
点击下载完整版文档(PDF)

1 University of Electronic Science Technology of China(UESTC) Model Vehicle Control system design Real-Time Systems Lab

1 Real-Time Systems Lab University of Electronic Science & Technology of China (UESTC) Model Vehicle Control system design

2 1 OUTLINE University of Electronic Science Technology of China(UESTC) There is a model vehicle >4 cartwheels; >2 motors:One is steering engine (130s Brushless motor) that is used to control the front two cartwheels;the other is speed motor (Brushless ESC (Electronic Speed Controller))that is used to drive the rear two cartwheels; >1LCD(LCD1602): >3 ultrasonic sensors (SRF05); >1 freescale 5213 card (MCF 5213); >1 batter. Real-Time Systems Lab

2 Real-Time Systems Lab University of Electronic Science & Technology of China (UESTC) 1 OUTLINE  There is a model vehicle 4 cartwheels; 2 motors: One is steering engine (130s Brushless motor) that is used to control the front two cartwheels; the other is speed motor (Brushless ESC (Electronic Speed Controller)) that is used to drive the rear two cartwheels; 1 LCD (LCD 1602); 3 ultrasonic sensors (SRF05); 1 freescale 5213 card (MCF 5213) ; 1 batter

3 1 OUTLINE University of Electronic Science Technology of China(UESTC) Your mission >Drive the model vehicle to go ahead while keeps it at a given distance(50 cm)from a wall. Real-Time Systems Lab

3 Real-Time Systems Lab University of Electronic Science & Technology of China (UESTC)  Your mission Drive the model vehicle to go ahead while keeps it at a given distance (50 cm) from a wall. 1 OUTLINE

4 1 OUTLINE University of Electronic Science Technology of China(UESTC) Requirements >Detect the current distance from the wall in real time by the ultrasonic sensors; >Display the detected distance by the LCD; >Your program runs on the top of uC/OS II >Codewarrior,C&Assemble language. How to design? Real-Time Systems Lab

4 Real-Time Systems Lab University of Electronic Science & Technology of China (UESTC) 1 OUTLINE  Requirements Detect the current distance from the wall in real time by the ultrasonic sensors; Display the detected distance by the LCD; Your program runs on the top of uC/OS Ⅱ; Codewarrior, C & Assemble language.  How to design?

5 2 Problem (P) University of Electronic Science Technology of China(UESTC) P:How to detect the distance in real-time? >Distance=(TimeDuration 340m/s)/2; >How to get the TimeDuration? Real-Time Systems Lab

5 Real-Time Systems Lab University of Electronic Science & Technology of China (UESTC) 2 Problem (P1 )  P1 : How to detect the distance in real-time? Distance=(TimeDuration * 340m/s)/2; How to get the TimeDuration?

6 3 Problem (P),(P3),(P4) University of Electronic Science Technology of China(UESTC) P2:How to organize and design the software architecture on the top of uc/OS II >DFD(Data Flow Diagram) >Task structure ☐P3:How to( drive t the steering e engine to turn Left/Right? Given a turning a angle,How to implement the "turning"command? P:How to determine the turning angle in each adjustment Real-Time Systems Lab

6 Real-Time Systems Lab University of Electronic Science & Technology of China (UESTC) 3 Problem (P2 ), (P3 ), (P4 )  P2 : How to organize and design the software architecture on the top of uc/OS II ? DFD (Data Flow Diagram) Task structure  P3 : How to drive the steering engine to turn Left/Right? Given a turning angle, How to implement the “turning” command?  P4 : How to determine the turning angle in each adjustment ?

4 Implement the above design on the top of uC/OSII University of Electronic Science Technology of China(UESTC) APIs provided by the uC/OS II? Task management:OSTaskCreate ( Mail Box: OSMBoxCreate OSMBoxPost OSMBoxPend ( >Synchronize:OSSemCreate() OSSemPost O OSSemPend ( Mutex:OSMutexCreate ( OSMutexPost ( OSMutexPend ( >Interrupt:OSVectSet ( a111 Real-Time Systems Lab

7 Real-Time Systems Lab University of Electronic Science & Technology of China (UESTC) 4 Implement the above design on the top of uC/OSⅡ  Task management: OSTaskCreate ()  Mail Box: OSMBoxCreate () OSMBoxPost () OSMBoxPend ()  Synchronize: OSSemCreate () OSSemPost () OSSemPend ()  Mutex: OSMutexCreate () OSMutexPost () OSMutexPend ()  Interrupt: OSVectSet ()  ...... ......  APIs provided by the uC/OSⅡ?

8 4 Implement the above design on the top of uC/OS II University of Electronic Science Technology of China(UESTC) Interfaces for ultrasonic MCF_GPIO_PORTDD&=~Trig /produce a 20us pulse >TestTimeSum=Gettime[1]-Gettime[0]//Calculate the distance Interfaces for PWM OSSpeeddown O OSSpeedup ( OSTurnLeft ( OSTurnRight ( ■Interfaces for LCD LCDWcmd ( /Determine the position on the LCD LCDWdata ( /Display the given information LCDShowChar ()/Display the detected distance Real-Time Systems Lab

8 Real-Time Systems Lab University of Electronic Science & Technology of China (UESTC) 4 Implement the above design on the top of uC/OSⅡ  MCF_GPIO_PORTDD&=~Trig // produce a 20us pulse  TestTimeSum=Gettime[1]-Gettime[0] //Calculate the distance  Interfaces for ultrasonic  OSSpeeddown ()  OSSpeedup ()  OSTurnLeft ()  OSTurnRight ()  Interfaces for PWM  LCDWcmd () // Determine the position on the LCD  LCDWdata () // Display the given information  LCDShowChar () // Display the detected distance  Interfaces for LCD

9 5 How to design a more perfect control system? University of Electronic Science Technology of China(UESTC) More sensors(A group of photoelectric sensors) More tasks Perfect control algorithm Optimize your program Responsibility,Stability Other control applications ▣Q&A Real-Time Systems Lab

9 Real-Time Systems Lab University of Electronic Science & Technology of China (UESTC) 5 How to design a more perfect control system?  More sensors (A group of photoelectric sensors)  More tasks  Perfect control algorithm  Optimize your program  Responsibility, Stability  Other control applications  ……  Q & A

10 University of Electronic Science Technology of China(UESTC) 8 Square waves(40 HZ)(Ultrasonic) Utrasonic Sensor GND VCC Echo Trig (20 us pulse) GPIO Capture the Time Duration of high-level voltage GPT MCF 5213 Real-Time Systems Lab

10 Real-Time Systems Lab University of Electronic Science & Technology of China (UESTC) Utrasonic Sensor GND VCC Echo Trig (20 us pulse) GPIO GPT Capture the Time Duration of high-level voltage MCF 5213 8 Square waves (40 HZ) (Ultrasonic)

点击下载完整版文档(PDF)VIP每日下载上限内不扣除下载券和下载次数;
按次数下载不扣除下载券;
24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
共25页,试读已结束,阅读完整版请下载
相关文档

关于我们|帮助中心|下载说明|相关软件|意见反馈|联系我们

Copyright © 2008-现在 cucdc.com 高等教育资讯网 版权所有