1. according to the attached circuit, I don't understand how Analogwrite() command could control the speed of the motor. Correct me if I'm wrong: the Analogwrite() would generate signal with a fixed frequency to the transistor, and I don't understand how the signal control the power that motor receives which determine the motor speed.
Analog write generates a signal with a fixed frequency, but a varying duty-cycle (i.e. the percentage of time it spends in the "ON" state). The transistor uses that signal to switch power to the motor and the motor speed is proportional to the duty cycle.
- Code: Select all
2. Since I'm going to use a 0.8k W motor, I'm sure I need a shield. However, would the attach circuit still valid/practical? would I need a relay, or anything else?
You don't mention the voltage, but 800 watts is too much for the Adafruit motor shields. If it is one of the 36v electric scooter motors, you will need a driver capable of at least
23A. The attached circuit could be beefed up with higher-capacity switching transistors & heat sinks, but it will not give you direction control - and it has no fuses for safety either. 22A is is a lot of current to be working with. I would recommend investing in a controller designed to handle such currents. The MegaMoto unit from RobotPower works with an Arduino and handles up to 25A: http://www.robotpower.com/catalog/