|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#17
|
||||
|
||||
|
Re: Arduino PWM output
Quote:
![]() (from Arduino.cc) ...but your motor controller is expecting this: ![]() The frequency of the signal in Hz is the number of pulses per second. The reciprocal of the frequency is the period, which is the time between the rising edges of the PWM signal. For your motor controller, this should be 50 Hz, or a 20 ms (millisecond) period. According to the Arduino documentation, the analogWrite() function produces a 490 Hz PWM signal, or a 2 ms period. The duty cycle of the signal is the ratio between the pulse width and the period. For your motor controller, the pulse width is "mapped" as follows: Full Forward: 2 ms pulse / 20 ms period = 10% duty cycle. Neutral: 1.5 ms pulse / 20 ms period = 7.5% duty cycle. Full Reverse: 1 ms pulse width / 20 ms period = 5% duty cycle. As others have suggested, the Arduino servo library should be able to produce the correct signal. 180 degrees on a servo is the equivalent of "full forward" on a motor attached to the motor controller (0 degrees is full reverse, 90 is neutral, etc.) Quote:
Hope this helps... |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|