Giter Site home page Giter Site logo

stm32-motor-driver's Introduction

stm32-motor-driver

Altium PCB files and STM32CubeIDE project to implement a basic brushed DC motor controller.

Demo Usage

The STM32 will respond to commands sent on the UART pins at a baud of 115,200. You can use PuTTY or some other serial terminal to communicate with the board using a USB-to-serial converter.

The board will announce itself on boot-up; if you don't see STM32 Motor Driver, v1.0 printed on your console, check your TX/RX polarity, your baud, and that you are connected to the correct COM port.

The only command the interface currently supports is the "goto" command. Invoke it as g [setpoint]. The board will respond by announcing the setpoint and announcing when it is reached.

Examples:

g 1000
GO 1000...Reached

g -500
GO -500...Reached

Building the Firmware

You should fork the repo on GitHub to provide you with a version-controlled environment to develop and backup your code. GitHub offers the GitHub Desktop client, but there are many ways — including the command-line git tool — to manage local and remote git repositories.

You'll need STM32CubeIDE installed to build the firmware. Invoke the File > Import command to open the Import dialog.

Choose General > Existing Projects into Workspace and hit Next.

Choose the Select root directory radio button and hit Browse to select the firmware folder. STM32CubeIDE should automatically discover the project and allow you to import it by selecting it with a checkbox and clicking Finish.

Pin Mapping

  • PA10 and PA8 are wired as separate PWM channels (TIM1_CH3 and TIM1_CH1) for the INA and INB signals, respectively.
  • PA9 is routed to the "PWM" pin — if you want to recirculate your current, keep this pin high and instead apply your PWM to the INA or INB signals. Otherwise, enable TIM1_CH2 and apply your PWM duty cycle appropriately.
  • PA15 and PB3 correspond to the A and B quadrature encoder inputs, which routes them to TIM2_CH1 and TIM2_CH2 running in Encoder mode.
  • PA0 (ADC1_IN0) can be used to monitor the current. The board uses a 1k CS resistor, which translates to roughly 3.696 amp at full-scale 3.3V (0.8928 V/A).
  • SEL0 is routed to PA11; this can be used to determine which path inside the H-Bridge to measure current from. Consult the VNH7100 datasheet for more information.

stm32-motor-driver's People

Contributors

jaydcarlson avatar

Stargazers

 avatar Brock Robinson avatar  avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.