Question
The OP wishes to control the speed of a DC motor using PWM or regulator. He also wishes to change the direction of the motor.
Answer
This answer is in two parts: Short and Long.
The short answer is kind of an introduction to the long answer.
Short Answer
Part A - Clarifications
A.1 - AC to DC Switching Power Supply and DC-DC Step down voltage regulator
The OP's Q&A on using resistor divider or Zener diode (Ref 5, 6) is not appropriate to step down a power supply for the DC motor.
The following instead are recommended: (1) 110VAC to 12V switching power supply (Ref 4) to get 12VDC, (2) A LM2596 Voltage regulator module is then used to get 3~9VDC for the DC motor.
A.2 - The OP's Average Voltage vs PWM Measurements and Chart
The average voltage measurement used by the OP is not very useful for controlling DC motors for many reasons: (1) DC Motor speed is not linearly proportional to input voltage or current (Appendix B). (2) The DC motor's Voltage, Current, Torque, Efficiency relationship (Appendix B) is complicated.
Part B - Suggestion to run a particular control sequence
The OP would like to run a particular control sequence, involving motor speed, direction, brake. I would suggest to first use the following offline, table top hardware setup to experiment with speed and torque etc, before doing Arduino or Raspberry Pi programming.
1. GA12-N20 geared motor with Hall effect encoder (TT130, GB37)
2. Manual UART XY Signal Generator (Arduino/Rpi PWM, NE555, PCA9685)
3. L298N H-bridge motor driver (L293D, TB6612FNG, BTN7971B)
/ to continue, ...
Part C - Discussion, Conclusion, and Recommendation to Newbies
/ to continue, ...
Long Answer
1. Scope
This answer is in general applicable to 6~12V DC motors, using the L298N H-bridge motor driver, and Arduino C++ or Raspberry Pi python programming.
2. Focus
The focus will be on PWM speed control on DC geared motor, using a power MOSFET and a PWM signal generator.
Once speed control problems are solved, direction control is relatively easy, by just using a H-bridge motor driver, such as L298N to switch power polarity and thus direction. The Arduino or Raspberry Pi programming part is also relatively easy.
So, as recommended by EE StackExchange, we will focus on only one topic:
DC Motor speed control using PWM
/ to continue, ...
References
Part A - Switching Power Supply and Voltage Regulator
(1) AliExpress 110/220VAC to 5/12/24/48VDC, 2/5/10/15/20/30 A Power Supply
(2) MeanWell NES-350 series 350W Single Output Switching Power Supply
(3) AliExpress LM2596 voltage regulator module
(4) AliExpress LM2596 DC-DC 12V/24V Step-down to adjustable 9V/6V/5V/3V 3A Power Supply Module (Actually 40V down to 1.25V)
(5) Stepping down voltage by a resistor divider - EE StackExchange, Asked 5 years ago, Viewed 234k times
(6) Stepping 5V power rail to 3V using a resistor or Zener diode - EE StackExchange, Asked 6 years ago, Viewed 1k times
Part B - PWM Signal Generator
(7) AliExpress UART XY-KPWM Signal generator 1Hz - 150KHz PWM - US$3.6
(8) How can Rpi4B python UART talk to XY PWM Signal Generators?
(9) AliExpress NE555 Square Wave PWM Module Catalog
(10) AliExpress NE555 10KHz-200KHz Square Wave Pulse Frequency Duty Cycle Adjustable Module Signal Generator - US$1
Part C - PWM H-bridge Motor Driver
(11.1) (Huge Internal Voltage Drop, Energy Wasted, and Needing Huge Heat Sink) L293, L298 and SN754410 (DRV8837, L298N) H-bridge Drivers On Low Voltage Power Supply - EE SE Forum Discussion, 2014apr30
(11.2) L298 Dual Full-bridge Driver (46V, 4A, "Low" Saturation Voltage) DataSheet - ST 2000
(11.3) AliExpress L298N DC/Stepper Motor Driver Module/Board module - US$1
(11.4) AliExpress RonZi Tech BTN7971B H-Bridge Drive Module - US$17
(11.5) BTN7971B High Current PN Half Bridge NovalithIC - Infineon 2008 June
(11.6) BTN7971B Module User Guide - ZonRi Tech 2018jan19
(11.7) AliExpress TB6612FNG H-Bridge DC Mother Driver (0.5 Ohm on resistance) - US5
(11.8) TB6612FNG MOS H-bridge Driver Datasheet - Toshiba
(11.9) DRV8871 3.6A PWM Control DC Motor Driver With Internal Current Sense - TI
(11.10) DRV8874-Q1 H-Bridge Motor Driver With Integrated Current Sense and Regulation - TI
(11.11) AliExpress H-bridge Driver Module Catalog
(11.12) AliExpress DRV8871 MOSFET H-Bridge Motor Driver Board 3.6A Max Internal Current Sense - US$2.7
(11.13) AliExpress BTS7960 43A H-Bridge Motor Driver Module - US$3
https://nl.aliexpress.com/item/32820492945.html?
(12) Instructable (Text) on How to Use L298n to Control DC Motor With Arduino - AYassine Lebouiha 2018jan04
(13) Instructable (YouTube) on How to control DC motor using L298n + Arduino - AYassine Lebouiha 2018jan04
(13.1) Controlling DC Motors with the L298N Dual H-Bridge and an Arduino (Web Page) - DroneBot WorkShop
(13.2) Controlling DC Motors with the L298N Dual H-Bridge and an Arduino (PDF) - DroneBot WorkShop
(13.3) L298N rpi.stackexchange discussion 1
(13.4) L298N rpi.stackexchange discussion 2
(13.5) L298N rpi.stackexchange discussion 3
(13.6) L298N rpi.stackexchange discussion 4
(13.7) L298N rpi.stackexchange discussion 5
(13.8) L298N rpi.stackexchange discussion 6
(13.9) L298N rpi.stackexchange discussion 7
(13.10) L298N rpi.stackexchange discussion 8
(13.11) L298N rpi.stackexchange discussion 9
(13.12) L298N rpi.stackexchange discussion 10
(13.13) L298N rpi.stackexchange discussion 11
(13.14) TaoBao DRV8837 DC Motor Driver Module 1.8A Dual Half Bridge - ¥8
(13.15) TaoBao DRV8833 DC Motor Driver (Replacing TB6612FNG) - ¥9
(13.16) AliEXpresss DRV8837 DC Motor Module Dual 1.8A - US$15
(13.17) Adafruit DRV8871 (45V 3.6A) DC Motor Driver Breakout
(14) MX1508 vs L9110S vs TB6612 vs L293D Motordriver board, ArduinoDiy
(15) MX1508 DC/Stepper PWM Dual Bridge Motor Driver - Amazon US$14
(16) L9110 Single DC Motor Driver with built in clamp diode Datasheet
Part D - DC Motor Characteristics
(14) How to read the characteristics of a DC motor? - Rotero Electrical Motion and Control 2018feb26
(15) AdaFruit 3V-6V DC 200rpm TT Gearbox Motor - $2.95
(16) YouTube AdaFruit 3V-6V DC 200rpm TT Gearbox Motor
(17) AliExpress Yellow DC 3V-6V Dual Axis Gearmotor TT Motor US$1.52
(18) TaoBao DC3V-6V Gear Motor TT Anti EMI 4WD - CN¥3
(19) Amazon DC3V/6V/12V RPM 7.5A 6000 Micro Gear Motor with metal gear
(20) TaoBao GA12-N20 Gear DC Motor with Hall Effect Encoder - ¥30
(20.1) TaoBao GA12 Motor 12MM Gear Box - ¥11
(20.2) TaoBao DC Gear Motor Catalog
(20.3) TaoBao JA12 N30 3~12C metal gear motor - ¥18
(21) Pololu 1000:1 Micro Metal Gearmotor HP 6V 31rpm, 70mA, 12kgcm, stall 1.6A - US$24
(22) Pololu Micro Metal GearMotor Catalog
(23) Pololu 6V Micro Metal GearMotor Catalog
(24) Pololu Encoders for Micro Metal Gearmotors
(25) Pololu Encoders for Micro Metal Gearmotors Catalog
(26) TTM1 1:120 gear DC motor with AB encoder (6V, 200rpm, 3.2kgfcm, 960 pulses) - MiaowLabs ¥30
Part D - Automation, Control, and Robotics Newbie Reading List
(26) Rotary Encoder (Hall Effect Quadrature Encoder) - Wikipedia
https://en.wikipedia.org/wiki/Rotary_encoder
(27) Hall Effect - Wikipedia
https://en.wikipedia.org/wiki/Hall_effect
(28) PID Controller - Wikipedia
https://en.wikipedia.org/wiki/PID_controller
(29) Root Mean Square - Wikipedia
https://en.wikipedia.org/wiki/Root_mean_square
/ to continue, ...
Appendices
Appendix A - L298N Schematic and Operation
Appendix B - PWM Controlling Speed of JB37 Geared Motor
Appendix C - GA12 N20 Gear Motor with Hall Effect Encoder Specification
(20) TaoBao GA12-N20 Gear DC Motor with Hall Effect Encoder - ¥30
Appendix D - GA12 N20 Gear Motor Spec
Appendix D - Pololu Hall Effect Encoder
Appendix E - BTN7971B Datasheet Summary
Appendix F - BTN7971B Module
Appendix G - N20 DC Motor PWM and Hall Effect Quadrature Encoder Test
Appendix H - NA20 Motor PWM and Encoder Test Preparation Notes
Appendix I - TT130 6V Quadrature Encoder Test Results
Motor TT130 6V ~= 48 rpm
Appendix J - N20 Quadrature Encoder Test
Appendix K - ZonRi Tech BTN7971B Module Schematic
Appendix L - Calibration of PWM BTN7971B Motor Module with N20 Motor
Appendix M - BTN7971B H-bridge Motor Driver Voltage Drop Measurement
(a) I set 1kHz PWM signal to 100% duty, and also direct 6V PSU to check the motor speed. I found in both cases, the encoder output C1 is
600us, or 1000000/600 = 1666Hz, or 27rpm.
In other words, the motor driver does not seem to have any volt drop causing a reduction of motor speed.
(b) I then measure the voltage drop of the motor driver. What I did was the following.
(b.1) Use a multi-meter to measure the voltage of the power connector at the motor driver board. I found it 6.35V.
(b.2) Use the same multi-meter to measure the voltage across the motor terminals (ie, after voltage drop across the two on resistances of the two MOSFET switches conducting the current through the motor. I found it 6.13V.
(c) Total voltage of the two FET switches
So the voltage drop is 6.35V - 6.13V = 0.22V
(d) The PSU's current meter is not very accurate, shows very roughly under 20mA. So the the
Total on resistance of the two FET switches = 0.22V / 20mA ~= 0.01mΩ (Note 1).
Note 1 - My measurement are not at all precise. Perhaps I should use a L298N motor driver to compare the voltage drop and speed.
Appendix O - MT1208/MX1508 Flyback diode discussion notes
Note: the following article has a discussion on whether it is necessary to us flyback diodes on MX1508.
(14) MX1508 vs L9110S vs TB6612 vs L293D Motordriver board, ArduinoDiy
/ to continue, ...
End of Long Answer