First Turn

DC Motor Duty and Speed Exercise

Task

Before a fan, a pump or a drill leaves the factory, its motor spins up on a test rig. The speed it reaches under load goes into its record.

Run the motor forward at duty 400, and print the settled shaft speed once: SPEED 11600 RPM The motor's registers are in the Circuit figure.

Circuit

Circuit: the test rig puts a load on the motor's shaft, U1 STM32F4 writes DUTY and CTRL to the motor M1 at 0x50061000 and reads SPEED back, and prints on USART1 TX, PA9, to a terminal; the motor's registers DUTY, DIR, CTRL and SPEED are listed with offset, access and units

Pass condition

One SPEED line prints within 500 ms of reset, with the settled shaft speed to the nearest RPM. The motor never latches a fault.

Expected output under the light load: the shaft's speed climbs from 0 when the motor is switched on and levels off at 11600 RPM; the terminal shows one line, SPEED 11600 RPM, and the motor trace latches no fault

Notes

Duty is how hard the motor is driven, in thousandths of full power. 400 is 40 percent. The test rig puts a load on the shaft. The load changes from run to run, so the settled speed changes too.

Related challenges

Loading the interactive arena.