Skip to main content

Hardware Validation

After programming, perform practical validation:

    • Whether the motor rotates in the correct direction as you increase the setpoint.

    • Whether, upon changing the reference or pressing rst, the motor responds correctly (adjusting speed or returning to zero position, depending on the implementation).

    • The PWM should vary to correct the difference between desired and actual position.

If you see undesired behavior:
- Check if the encoder direction is inverted;
- Adjust the controller gains (the constants used in gain16signed);
- Confirm that the PWM and motor speed are not saturating (very high values might keep the motor at high speed continuously).

And at the end, your circuit should look like this:

image.png

DC Motor Circuit


DC Motor Testing