Giter Club home page Giter Club logo

stepmotor_inf's Introduction

stepmotor_inf's People

Contributors

miaomiaogao avatar maggiemgao avatar

Watchers

 avatar

stepmotor_inf's Issues

Create GUI in python tkinter for sending command

Create a entry frame to include:

  1. 2 Radio button (clockwise, counterclockwise)
  2. rpm label and rpm entry.
  3. step label and step entry.
  4. 2 buttons, (start, stop)
    start: start running
    stop: terminate running

Create empty project based on hardware

Requirement: select a STM32 microcontroller with 7MHZ running frequency, 4KB RAM, 32KB flash.
Modification: select STM32L071CBTx based on my hardware board(8M HSE, 20KB RAM, 128KB flash), configure the running frequency to 6MHZ, and only use 4KB RAM, 32KB flash.
ports:

  1. usart1 with interrupt and callback enabled
  2. 3 pins: step/dir/enable (use the 3 leds ports: PB5, PB6, PB7)
  3. clock OSC in (8M)

Encrypt the message

Add AES encryption in python GUI transmitter.
Add decryption in microcontroller to decrypt the message.
Debug the system with encrypted communication.

Implement communcation part using rs232

There are 3 paramters can be defined by user:

  1. running PRM
  2. how many steps to run
  3. direction (clockwise, counterclockwise)
    Initial design the sturcture of the command structure is Direction, PRM, STEP
    Implement USART receiver, and data processing function to accept the command and then run the command.
    Debug with sscom.

system debug

Send command with python GUI
Receive command with STM32 microcontroller
Control step motor with 3 pins
Monitor 3 pins with logic analyzer

Configure a timer for PWM control

The motor is 18 degrees per step (20 steps per revolution)
Constraints: The stepper motor cannot do more than 600 RPM
600 RPM -> 10 RPS -> at least 100ms for one revolution -> 5ms one step
As uTick of this microcontroller is 10 milliseconds, which is slower than the requirement, a timer is needed here
Assume PRM_NUM is defined by user, this number is between 1 to 600 (1 <= PRM_NUM <= 600)
Calculation:
one step period (ms) = (60 * 1000ms) / (PRM_NUM * 20) = 3000/PRM_NUM

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.