Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HomingOnSTM32

This repository contains a study case solution for a linear actuator homing function implemented in C on STM32 using the HAL driver.

Overview

The project targets an STM32-based ECU that controls a linear actuator through two digital outputs. Two buttons are used to simulate the actuator end switches, and two LEDs indicate actuator direction.

The implemented solution:

  • Runs as a non-blocking step in the main superloop
  • Uses a finite state machine for the homing sequence
  • Includes debounce handling, timeout checks, and fault protection
  • Separates actuator control and homing logic into reusable modules
  • Supports midpoint estimation with asymmetric forward and reverse speeds

Project Structure

  • Src/actuator.c, Inc/actuator.h: actuator direction abstraction
  • Src/homing.c, Inc/homing.h: non-blocking homing logic
  • Src/main.c: hardware initialization and superloop integration

Hardware / Test Setup

  • Forward limit input: PC5
  • Reverse limit input: PC6
  • Forward output indicator: PC8
  • Reverse output indicator: PC9
  • Start button: B1 (PC13)

Build

The project was created with STM32CubeIDE and uses STM32 HAL.

Open the project in STM32CubeIDE and build it with the default Debug configuration.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages