Skip to content

Latest commit

 

History

History
16 lines (11 loc) · 1.37 KB

File metadata and controls

16 lines (11 loc) · 1.37 KB

Position control of a vehicle on rotating ramp using STM32

Goal of the project was to make an object (in this case a small LEGO car) stop at given place on the ramp. The difficulty comes from the fact that it's a non-linear system.

NUCLEO-F746ZG board was connected with an ultrasonic distance sensor HC-SR04 and servo TowerPro MG-995 - standard. Additional power supply was needed because the servo needed more power than the board could deliver. Also there was a 7-segment display to make it easier for user to read current position of the object.

Data from the microcontroller was sent to PC using USART and user could set the distance (using for example terminal) for the vehicle to stop at or use Matlab script to plot position during last 20 seconds.

PID controller was implemented in the STM32 to make everything possible. Parameters were calculated by using autotune option in Simulink after modeling the object (model was created using the step response for the object).