Presentation is loading. Please wait.

Presentation is loading. Please wait.

28 April 2005 Brushless DC Motor Controller Software Design Presentation Western Washington University Patrick Prendergast.

Similar presentations


Presentation on theme: "28 April 2005 Brushless DC Motor Controller Software Design Presentation Western Washington University Patrick Prendergast."— Presentation transcript:

1 28 April 2005 Brushless DC Motor Controller Software Design Presentation Western Washington University Patrick Prendergast

2 WWUEET28 April 2005© Patrick Prendergast Kernel Selection To be demonstrated…

3 WWUEET28 April 2005© Patrick Prendergast Tasks 4) Start 5) Commutation 6) User Interface 7) Data

4 WWUEET28 April 2005© Patrick Prendergast Start Task Initializations Creates other tasks Period: Once Execution Time: 100ms

5 WWUEET28 April 2005© Patrick Prendergast Commutation Task PWM creates a sinusoidal motor current Determines motor commutation and PWM duty cycle based on: –Position –Motor Current –Battery Voltage –Commutation Mode

6 WWUEET28 April 2005© Patrick Prendergast Commutation Task Continued Responds to the Duty Cycle request from the CAN like a critically damped PID controller Response time depends on load (motor current) Controls the 14V gate drive supply (safety feature) Period: 40µs (Periodic) Execution Time: 5µs

7 WWUEET28 April 2005© Patrick Prendergast Data Task Collects data –Analog to Digital Converter –Controller Area Network (CAN) –Microcontroller Inputs Sends data over the CAN Period: 10ms (Periodic) Execution Time: 40µs

8 WWUEET28 April 2005© Patrick Prendergast Kernel Selection II Wait now we can determine our kernel: –T P = 40µs for the Commutation Task –T EXEC = 40µs for the Data Task –Therefore, L > 1 for a timeslice kernel So a preemptive multitasking kernel must be used and we have easy access to µC/OS-II.

9 WWUEET28 April 2005© Patrick Prendergast User Interface Task (UITask) Controls the User Interface LED’s Monitors the on/off switch and starts the shutdown routine. T P = 10ms T EXEC = 2µs

10 WWUEET28 April 2005© Patrick Prendergast HallIsr Hall Effect state change causes interrupt Refreshes HallState to match hall sensors Period: 5.1ms < T P < 1s (Sporadic) Execution Time: 500ns

11 WWUEET28 April 2005© Patrick Prendergast CPU Load Maximum Load Load is a non issue

12 WWUEET28 April 2005© Patrick Prendergast Modules ModuleTasksFunctions/Data main.c Start, Data, User PWMCalc(), ThrottlePos, ComMode, MotorAmps, BattVolts, HallState, Revs, DutyCycle, CompensatedDutyCycle, ModedHallState commute. c Commutation PWMSelect(), ModedHallState, CompensatedDutyCycle ATD.c ATDInit(), ATDAmps(), ATDVolts(), MotorAmps, BattVolts, CAN.c CANInit(), CANFilter(), RxCan(), TxCan(), CANGetStatus(), ThrottlePos, ComMode, MotorAmps, BattVolts, Revs PWM.c PWMInit(), PWMDuty(), DutyCycle InCapt.c HallCapture(), HallState

13 WWUEET28 April 2005© Patrick Prendergast Data Flow Diagram

14 WWUEET28 April 2005© Patrick Prendergast CAN Data Flow CAN0Controller ID Filter DataTask() Transmit Buffer Receive Buffer CANFilter() CANGetStatus() CANInit() TXCAN0 RXCAN0 CANPushMessage() CANPullMessage() CAN Bus Physical Layer

15 WWUEET28 April 2005© Patrick Prendergast CompensatedDutyCycle and Hall State Data Flow Diagram Data Task Commutation Task Buffer OSSemPost()OSSemPend()


Download ppt "28 April 2005 Brushless DC Motor Controller Software Design Presentation Western Washington University Patrick Prendergast."

Similar presentations


Ads by Google