Hardware Validation
After programming, perform practical validation:
1. Connect the DC motor and encoder physically to the FPGA board (using appropriate drivers for motor current/voltage).
2. Power the system with the proper power supply.
3. Press the configured button in the project (if it is used to increment the setpoint) and observe:
-
-
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).