STM32 M0+ driving PWM servo and display

Job ID: 32859070

Budget: $50 – $120 USD

Simple application for periodically driving a servo clockwise/counter-clockwise by PWM output according a combination of 3 input parameters preset by joystick button on display board.
Two inputs of another timer module are used to take feedback from quadrature sensor and display positional value. The feedback from quadrature sensor does not have any impact on PWM duty cycle, it just need to be shown on the display. For testing purposes this can be simulated by two switches.

Coding in C/C++

Tools:
demo boards STM32G071RB + GFX01M1,
STM32CubeIDE, TouchGFX, servomotor or oscilloscope to test PWM signal

Please only accept this project if you have current access to the above components as no additional funds or time will be allocated to obtaining them.

Input parameters:
1. Cycle Frequency
clockwise/counter-clockwise = "up" / "down" cycles per minute [CPM]
adjustable values from 10 to 24 CPM, steps 1 CPM
2. Up/Down Speed Ratio
adjustable values from 2:1 to 1:3, steps 0.1
{2:1, 1.9:1, 1.8:1, ... 1.1:1, 1:1, 1:1.1, 1:1.2, ... 1:2.9, 1:3}
3. Travel Distance
percentage of travel from zero position,

zero position is fully DOWN (counter-clockwise) = 0 degrees = 1ms PWM pulse width
fully UP (clockwise) position = 100 % travel = 180 degrees = 2ms PWM pulse width
adjustable values from 40 to 100 %, step 2%
4. Delay
a delay between each change of movement direction
adjustable values from 0.1s to 1.0s, steps 0.1s

All threshold values and steps to be configurable as preprocessor constants.
Active values to be stored in NVM and reloaded after power-up.

Resources:
TIM16_CH1 PWM output 20ms period pin PB8,
TIM1_CH1, TIM1_CH2 quadrature encoder mode configured on pins PA8, PA9
SPI1 - communication with display
SPI2 - communication with display module NOR flash memory

Screen1 layout:
CPM freq: (value)
U:D ratio: (value)
% travel: (value)
Delay [s]: (value)

Screen2 layout:
Encoder Position
(value)


Additional screen layout features:
white background, black text, font and text size up to your consideration

text evenly distributed over the height of the display
values slightly larger than the rest text
selected text line blue
modifiable value red (after confirming the selected line for modification)

Joystick Controls:
Left/Right - switch screens
Up/Down - select parameter / increase-decrease confirmed parameter
Center - confirm selected parameter for modification / store modified value



The project will be considered completed if the following conditions are met:
- The freelancer can successfully test the project on their hardware
- All project files including required development environment configurations are delivered
- The client can successfully debug the project in STM32CubeIDE without alteration
- The client can successfully connect to demo boards and validate the functionality
Related categories: STM32