# Motor Folder

##### `<span class="editor-theme-code">components/driving_board/motor</span>`<span style="white-space: pre-wrap;"> </span>

<span style="white-space: pre-wrap;">All of the motor functions in this folder are called in </span>[Main](https://bookstack.roboteamtwente.nl/books/drive-system/page/main "Main")

#### BLDC Motors:

They are used to control the speed of the rover.

##### `<span class="editor-theme-code">bldc.c</span>`<span style="white-space: pre-wrap;"> contains:</span>

<span style="white-space: pre-wrap;">The set\_bldc\_pwm() method. This methods scales the control signal value calculated from control code and adjust the pwm </span>**duty cycle**<span style="white-space: pre-wrap;"> outputted by the STM32 accordingly.</span>

#### Stepper Motors:

##### `<span class="editor-theme-code">stepper.c</span>`<span style="white-space: pre-wrap;"> contains:</span>

<span style="white-space: pre-wrap;">The set\_stepper\_pwm() method. This methods scales the control signal value calculated from control code and adjust the pwm </span>**frequency**<span style="white-space: pre-wrap;"> outputted by the STM32 accordingly.</span>

#### Encoders:

##### `<span class="editor-theme-code">read_encoder.c</span>`<span style="white-space: pre-wrap;"> contains:</span>

The read encoders() method. This method reads encoder values of **encoder angle, voltage generated** and **rpm.**