Introduction
Electric vehicles need to control how fast their wheels turn and how much force they apply to move smoothly and safely. Managing torque and speed precisely helps the vehicle respond well to driver commands and road conditions.
Imagine riding a bicycle where you control how hard you pedal (torque) and how fast you want to go (speed). If you pedal harder, you go faster, but you also need to adjust how fast you turn the pedals to keep a comfortable pace. Your brain constantly adjusts both to keep you riding smoothly.
┌───────────────┐ ┌───────────────┐ ┌───────────────┐
│ Desired Speed │──────▶│ Speed Control │──────▶│ Motor Control │
└───────────────┘ └───────────────┘ └───────────────┘
▲ │ │
│ ▼ ▼
┌───────────────┐ ┌───────────────┐ ┌───────────────┐
│ Actual Speed │◀─────│ Feedback Loop │◀─────│ Torque Control│
└───────────────┘ └───────────────┘ └───────────────┘speed_error = desired_speed - actual_speed
torque_command = Kp * speed_error
motor_current = torque_command * motor_constantspeed_error = desired_speed - actual_speed
torque_command = Kp * speed_error
motor_current = torque_command / motor_constantPass the test and this pattern moves unknown