From 89256a78832e7e5c5a77fe072736fbad89347eb8 Mon Sep 17 00:00:00 2001 From: Richie Wang <2837357W@student.gla.ac.uk> Date: Sat, 11 Nov 2023 16:51:38 +0800 Subject: [PATCH] Update README.md --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6fbb4b4..34c740b 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,12 @@ cp freeRTOS-car.uf2 /media/$USER/RPI-RP2 # Components ## Motors +Motor module consist of 4 components: + +1. [motor_init](frtos/motor/motor_init.h): Initialises the pins and struct stated in [motor_config](frtos/config/motor_config.h) and [car_config](frtos/config/car_config.h), and the free rtos tasks related. Call `motor_init` followed by `motor_tasks_init` to get ready all the motor and wheel encoder related components. +2. [motor_speed](frtos/motor/motor_speed.h): Monitors the speed of the motors by interrupt. Each **falling edge** of the wheel encoder will trigger the interrupt and the time elapsed since last trigger will be recorded and thus calculate the speed and distance travelled since boot. Includes functions to adjust the duty cycle of the motor. +3. [motor_pid](frtos/motor/motor_pid.h): PID function to match the **right** motor duty cycle to the **left** motor such that the car can move straight, with 50ms interval. +4. [motor_direction](frtos/motor/motor_direction.h): Sets the direction of the motor to control the car using bit masks. Includes functions that works with the magnetometer to turn the car to/by specific yaw. ## Ultrasonic Sensor @@ -55,4 +61,4 @@ The final version of the magnetometer uses a **moving average filter** to smooth ## Barcode (Line) Sensor -## WiFi (Web Server) Module \ No newline at end of file +## WiFi (Web Server) Module