Skip to content

angcx1997/ScatWheelchair_MCU_2

Repository files navigation

ScatWheelchair_MCU_2

This repo is the secondary embedded system(Bluepill - STM32F103C8TX) on the shared controlled autonomous wheelchair.

The MCU does

  • collect data from incremental encoder
  • process them to angular velocity and
  • send them back to primary MCU every 1ms.

Link to Main MCU repo: https://github.com/angcx1997/scat_microcontroller

Link to original author repo: https://github.com/angcx1997/ScatWheelchair_MCU_2

Requirement

Installation

STM32CubeIDE is used to generated the overall code and structure. In Project Manager/Code Generator, select "Generate peripheral initialization ..."

Tips: Add the code in between the section

  • /* USER CODE BEGIN XX */ and
  • /* USER CODE END XX */

If wish to use STM32CubeMX

  • Do note that the code is not generated through CubeMX but refer to the code generated by it.
  • If wish to use the auto-code generation feature from CubeMX, it is advised to generate a new code from CubeMX and copy the code from this repo.
  • Also, the /Document/cubeMX_report.pdf is just providing a reference, might not be final pin configuration or peripheral configuration.

Hardware and Peripheral Used

Hardware Peripheral Used
Left Encoder TIM2 CH1 CH2
Right Encoder TIM3 CH1 CH2
Communication with Main MCU SPI1

General Guideline if you are interested in contributing the code

To achieve accurate timing of 1kHz, systick interrupt is used to ensure that the data sending at correct timing. If user have more thing to send over to main MCU, could just add them into HAL_SYSTICK_Callback.

Note

The reason a second MCU is used is because of insufficient space on main MCU. Therefore, current method of sending data is actually not encouraged by the author as it is more error prone to wiring or timing issue during communication between MCU. And it make debugging very difficult.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published