Battery-Electric and Hybrid-Electric vehicles are becoming more and more economical, efficient and environmentally friendly resulting in an increase in adoption rates. In addition, the recent advancements in autonomous electric vehicles are also resulting in the automotive industry starting to transition from petrol to electric vehicle design. As an embedded system engineer you have been contracted by an automotive manufacture who is transitioning from petrol to Battery-Electric technology. Your task is to design the real time controller and hardware interface of the electric motor for the vehicle.
Your challenge is to handle the complete sensing and actuation of a 3-phase Brushless DC (BLDC) motor common in electric vehicles. This will include monitoring the state of the motor such as velocity, power and temperature and handle the start-up, braking and emergency procedures for the system. Your system design will require real-time handling of multiple tasks for sensor acquisition and filtering, motor fault handling and system display of critical information. Your setup includes a motor testing station including the motor driver and sensor board and a development kit for the Tiva TM4C1294NCPDT microcontroller. Figure 1b illustrates the setup interface of the testing station. Inputs and outputs of sensors and per-phase connections are compatible with the requirements of the microcontroller ports, with an electrical interface to achieve this.
The mapping of the microcontroller pins (GPIO, I2C, ADC, UART) and the motor driver inputs and outputs is provided in a separate document. Additional documentation that will be provided includes a description of the operation of the motor.
(b) (a)
Figure 1: (a) Simulated Electric Vehicle Sensor and Motor Testing Station. The system includes a microcontroller development kit, a motor driver and sensor board, brushless motor with hall effect sensors for position and velocity feedback and temperature and current sensors for fault monitoring. (b) BOOSTXL-DRV8323RH Motor Control Launchpad Boosterpack
2. Requirements
The assignment can be separated into three main sections: Motor Control, Sensing and User Interface. Each section has different requirements and are described below. You are required to design the solution using a software driver model for each subsystem. The user interface system will then use the driver functionalities to integrate each subsystem into one coherent solution for demonstration. Your team should coordinate and design the software system together in order to manage events, shared resources and CPU utilisation, taking into account the priority of each subsystem and their tasks.
2.1 Motor Control
You are to write a device driver for the DRV832x motor driver board (including the additional custom motor adapter board) to provide an application programming interface that
will:
- Start and control the motor safely, handling any fault conditions using the provided state transition diagram (see supporting documents for how to control the phases of the motor)
- Control a user given desired speed of the motor in revs/min
- Safely start and accelerate the motor to the desired speed (See below for acceleration
specifications)
- Safely decelerate the motor (See below for deceleration specifications)
The motor must be controlled by specifying the rpm. No marks will be awarded if the motor is controlled by specifying the PWM duty cycle. In order to safely start and brake the vehicle (motor) the system should control the speed of the motor following acceleration and deceleration limits (See separate reference document for supporting speed control diagram). You will also need to investigate how to effectively get a 3 phase brushless motor to start correctly. The system will also require different deceleration limits depending on whether an emergency condition has occurred or a user has input a slower desired speed. The acceleration and deceleration limits are defined as:
- Acceleration 500RPM/s
- Deceleration (setting slower speed) 500RPM/s
- Deceleration (emergency stop aka e-stop) = 1000RPM/s
Please ensure you handle units correctly as acceleration and deceleration values will be tested. Note, the deceleration for e-stop should be equal to (not great or less than) the desired value as we would like the vehicle to come to a complete stop quickly but safely.
2.1.1 E-stop Conditions
The following conditions should cause the motor control to enter into an e-stop condition causing the motor to safely brake using the previously indicated deceleration limit.
- Total motor current has exceeded a user defined threshold
- Motor temperature has exceeded a user defined threshold
- Absolute acceleration has exceeded a user defined threshold (an impact has occurred) measured via the accelerometer sensor (see section 2.3)
2.2 Motor Library and Motor Kits
A custom motor library will be supplied to your group in order for you to easily and safely commutate the phases of the motor. This will be available via Blackboard and separate instructions will be supplied describing how to install and use the library. You must use this motor library to minimise the risk of damaging the motor kits supplied with this assignment. However, this does not guarantee that the motors will not be damaged and it is recommended that the motor kits are monitored during operation and if debugging software while operating the motors that either the motor kits are powered down or monitored such that the do not heat up significantly. The teaching team have added some protection mechanisms (motor adapter board and current limited power supplies) to minimise this risk but with all electrical and mechanical hardware it is almost impossible to protect against all possible failures.
2.3 Sensing
In order to monitor critical information on the state of the vehicle you will need to write a device driver for the various sensors available on the vehicle. You will need to write the sensor drivers in order to provide an application programming interface (api) to perform the following functionalities:
- Read and filter the light level from the ambient light sensor over an I2C connection.
- Read and filter the ambient board temperature and the motor temperature from the the two temperature sensors over a UART connection
- Read and filter two motor phase currents via the analogue signals provided by the three current sensors
- Read and Filter the acceleration on all three axis and calculate average absolute acceleration (sum of absolute acceleration in each axis)
- Setup the accelerometer to detect a user-definable crash threshold (in m/s2) using the chips output interrupt pin
- Measure and filter the current speed of the motor in revs/min (rpm)
2.3.1 Data Filtering
All received data is noisy in some fashion such as temperature, current and speed. In order to correctly identify faults in a real-time fashion and ensure noise does not trigger false alarms you must filter this data before displaying it. You must filter the data using the
following specifications:
- Temperature sample window size greater than 3 at 2 Hz.
- Current sample window size greater than 5 at 250 Hz
- Ambient Humidity sample window size greater than 5 at 1 Hz
- Magnitude (sum of absolute x,y,z values) of acceleration sample window size (of each axis) greater than 5 at 200 Hz
- Speed sample window size greater than 5 at 100 Hz
- Light sample window size greater than 5 at 2 Hz
It is recommended that this filtering should not be done in a hardware interrupt. For example you should capture 1 sample of the current every 2ms (250Hz) and keep a buffer (window size) of 5 samples. You may use your own filtering technique such as a sliding window technique (see sliding window for examples). It is recommended that once a set of samples have filled the buffer then a software interrupt should be used to perform the follow up filtering update step. If you believe more samples at higher frequency would improve the performance of the filter then it is okay to increase these specifications.
2.4 User Interface
You are required to develop a graphical user interface to control the operation of the electric vehicle. This includes displaying critical information and including the ability to change the status of the vehicle. You should consider the layout of the interface for easy control and display of the information.
Write an application program that uses the device driver and other drivers and allows:
- Starting and stopping the motor using buttons
- Classify and display whether it is currently day or night (night time is classified as the ambient light being less than 5 lux)
- Displaying start and stopped status using an LED
- Turn on an LED when the time of day is classified as night time
- Setting the desired speed of the motor using user input
- Keeping track of time and displaying calendar time
- Setting an upper limit of allowable current drawn by the motor. If this condition is met a fault has occurred and the motor should be stopped safely
- Setting an upper limit of allowable temperature of the motor. If this condition is met a fault has occurred and the motor should be stopped safely
- Setting an upper limit of allowable acceleration of the vehicle (from accelerometer sensor). If this condition is met a fault has occurred and the motor should be stopped
safely.
On a second page/tab within the user interface you will be required to plot the filtered sensor information from the vehicle in a real-time, user friendly manner. Use your own design/structure for displaying the sensor information, but it must display the following information as a moving plot over time:
- approximate power usage of the motor using the phase current measurements (in watts)
- ambient light level (in Lux)
- ambient and motor temperatures (in Degrees Celsius)
- Average absolute acceleration from the accelerometer (m/s2)
- motor speed (rpm)
For displaying the sensor data, units can be of different magnitudes (e.g. Kilowatts), scaled or adjusted for display purposes.
3. Video Demonstration
You are required to present and demonstrate your work to the teaching team via a video presentation. Your video should include a speaking roll by each member of your group. For the video demonstration, you should prepare to show and talk about what you have done. Additional advanced features will also improve your mark only if the design requirements for that system have been met. Your video should step through and demonstrate each design requirement. For the video presentation you should aim to present your designed system to your client which is the automotive manufacture (teaching team). Your presentation should include an overall description of your final design, how you have met specifications and showing all relevant details for the teaching team to assess the quality of your solution.
The duration limit is up to 10 minutes for the total video demonstration.
4.4 Requirements that could not be demonstrated
If you describe your work well enough and your demonstration marks were low you could be given partial credit to compensate for an inability to demonstrate when it was required. You can add an explanation for each failure if you have been able to figure out how you might proceed if you could do it again.
5. Suggested Format of the Report
The report should contain the following items. The content and style are flexible if these are separately identifiable. Approximate page guidelines are given in parentheses.
- Cover page names, student ID numbers, course, and unit information. (1 page)
- Table of Contents Section headings, list of figures, list of tables. (1 to 2 pages)
- Introduction Problem statement, context, requirements, and statements on the individual contributions by each team member. (2 pages)
- Design and Implementation Approach to design, important issues and choices and their relationships to theoretical concepts and the hardware and software platforms. Check if you have addressed:
- Provided a graphical representation for your design?
- Provided a Project Folders and Files diagram?
- Did you use the GPIO module? How? Did you use the graphics library? How?
Did you use Tasks, Hwi and Swi? How?
- Did you use multiple threads/handlers? How? Did you use the ADC? How?
- Results Summary of evidence of functional requirements that were demonstrated and explanation of failures as learning outcomes in terms of what could have been done differently. (2 pages)
- References Including vendor supplied technical documents with a table that links each document to sub-sections of your report where they are relevant with entries: The reference number, the sub-section number, topic keyword or keywords, the pages that were found useful. (2 pages)
- Appendix Mention the name of the hardware development platform and versions of the tools used such as Code Composer Studio, Tivaware, TI-RTOS, etc. (1 page)
Reference Documents
- DRV832x 6 to 60-V Three-Phase Smart Gate Driver Datasheet
- DRV832XX EVM Sensored Software Users Guide
- BOOSTXL-DRV8323Rx EVM Users Guide
- TI-RTOS Users Guide
- TI-RTOS SYS/BIOS Users Guide
- EK-TM4C1294XL Users Guide
- TM4C1294NCPDT Datasheet
- TMP107 Datasheet
- OPT3001 Ambient Light Sensor Datasheet
- BOOSTXL-SENSORS Sensors BoosterPack Users Guide
Reviews
There are no reviews yet.