Group assignment¶
After the group assignment I investigated a bit more about motors.
There is the
- Idle Current: The power needed just to keep the internal logic and potentiometer active.
- Inrush Current: When a motor starts moving, it experiences a momentary surge
- Running Current: The average draw while moving.
- Stall Current: The massive spike (often 5x to 10x the idle current) when the motor is forced to stay in one position against resistance.
Insights¶
Due to inrush spikes it is often recommended to use decoupling capacitors (usually $10\mu F$ or higher) near the servo header to “buffer” that spike and prevent the microcontroller from resetting due to a voltage drop (brownout).
If the system crashes when the servo hits an obstacle, the power supply isn’t rated for the stall current.
If the servo draws 500 mA at peak and the voltage regulator is only rated for 100 mA, it will overheat and fail.
Always power servos from a secondary power rail, not directly from the $VCC$ pin of the microcontroller (unless it’s a very small, unloaded hobby servo, which was our case).
Servos are controlled via Pulse Width Modulation (PWM) and we need to control the duty cycle to set the position. The servo library hides this behind the scenes but one can do the calculations and just use the analogWrite function directly