ArduinoGeneral

FIT0441: brushless gear motor: speed control and PWM frequen

userHead chengshanbao 2017-01-24 13:06:26 2360 Views5 Replies
I bought this brushless gear motor and it is great: cheap, high torque and integrated. But when I connected Arduino to the motor connector and followed the tutorial, I found I cannot control the speed, even though I can read the speed and change direction. I found my Arduino Pin 11 generates 600Hz PWM, but from the motor spec I found somewhere, the motor can only accept PWM frequency from 10KHz to 20 Kz. Somehow I change the PWM frequency to 25KHz from Arduino, but speed control is not right: when I input 50 rpm, but it gives me full speed of 120 rpm; when I input 150 rpm, it rotates at 50 rpm. Anybody can help me on this?

Also is there anyway I can get the directional information from the motor? The FG pins only gives the pulses from which I can only get speed information, but not the direction.

Thanks a lot!
Shanbao
2017-02-06 22:19:50 Hi Shanbao,

We tested the motor recently and I guess that the manufacturer change something inside. The pin1 should be PWM, the pin4 should be FG, then the code on our wiki should work.
I also tested it with 500hz PWM output, we can adjust the speed via changing duty cycle, and 0 is max speed, 255 stop. So would you mind testing the motor again to see what happened according to the new pin definition?

Let me know if you have any problem.
userHeadPic Wendy.Hu
2017-01-26 17:20:35 Did you test it with 500Hz PWM output? My motor was running at full speed no matter what duty cycle it is, at 500 Hz PWM.

Who should I talk to in order to have the motor customized for directional information.

Thanks!
Shanbao

Grey wrote:
> Really? I tested the code before, it should wok. Unless the manufacturer
> change something inside. I can confirm it after the holiday. Anyway, it has
> to be customized if you need direction information.
userHeadPic chengshanbao
2017-01-25 22:14:13 Really? I tested the code before, it should wok. Unless the manufacturer change something inside. I can confirm it after the holiday. Anyway, it has to be customized if you need direction information. userHeadPic Grey.CC
2017-01-25 10:02:05 Hi Grey,

I tried the wiki sample code, but it doesn't work! because the default pin PWM frequency is only about 500 Hz. So I have to change the PWM frequency up to 25KHz. now it is working.

I still have two questions:
1. I can open up the motor and connect some wires out so that I can get speed direction information? cause the FG pin only gives speed pulses, not the direction information.
2. Is the motor PWM control inverted? Cause I input a 25% duty cycle, I get 75% speed. What is the model number of motor ?

Thanks!
Shanbao

Grey wrote:
> Hi Shanbao,
>
> The speed control PWM frequency is 20-30KHZ, have you tried it with wiki
> sample code? Does it work?
userHeadPic chengshanbao
2017-01-24 19:17:00 Hi Shanbao,

The speed control PWM frequency is 20-30KHZ, have you tried it with wiki sample code? Does it work?
userHeadPic Grey.CC