Page 2 of 3
Re: Arduino+Brushless Motor Problem
Posted: February 2nd, 2016, 9:38 pm
by iwonder
If it only happens with a load on the motor then it really sounds like an ESC issue.
It's a long shot, you could also try a few things. First, make sure all your motor wires are well away from the arduino/control wires, second, try putting a large (3.3kOhm or something) resistor between the servo pin on the arduino and ground, lastly if you can try a 0.1uF-1uF capacitor in it's place as well... Maybe one of those will help.
Oh and go back to the servo.h code

the noInterupts() and delays seem like they're going to cause more headaches than they solve.
(now that I think about it, the capacitor is much more important than the resistor)
Re: Arduino+Brushless Motor Problem
Posted: February 3rd, 2016, 4:26 am
by Bazinga+
windu34 wrote:Bazinga+ wrote:windu34 wrote:
How did you implement your code to gradually change your speed?
Something like this
for(Pulse=1500;Pulse<1800;Pulse+=){
noInterrupts();
digitalWrite(HIGH);
delayMicroseconds(Pulse);
digitalWrite(LOW);
interrupts();
delay(20-(Pulse/1000));
}
(basically the same as servo.write)
When I tested this the encoder was missing a ton of counts because it wasn't counting from noInterrupts to interrupts, so ideally I wouldn't want to go through this loop 300 times. Would it still work well (as in not glitch out) if I went up in increments of 10 or even 50?
That's gonn abe something you will have to experiment with. Why don't you just use the servo.h commands? worked fine for me. I don't quite understand what you are sending to the servo in this scenario because there is no writeMicroseconds() present
The reason for not using servo.h is because servo.h does not include no interrupts in the code. This means that when it send the speed the delay between high and low is longer. It's pretty interesting actually since as you spin the encoder the motor turns faster even when I set it to a constant speed. I'm pretty sure servo.h doesn't have no interrupts in it and I don't want the interrupts to screw with the signal. Also in case you don't know, writemMicroseconds() is practically exactly the same thing except without noInterrupts(I am sending signals through dogitalWrite() ).
Re: Arduino+Brushless Motor Problem
Posted: February 9th, 2016, 12:06 pm
by Bob_117
Did you calibrate the esc and have you tried using interrupts for the encoder and just using servo.write() with a while loop in the main loop, like this:
while(count < targetDist)
{
servo.write(what ever speed you want)
}
Re: Arduino+Brushless Motor Problem
Posted: February 9th, 2016, 1:00 pm
by Bazinga+
Bob_117 wrote:Did you calibrate the esc and have you tried using interrupts for the encoder and just using servo.write() with a while loop in the main loop, like this:
while(count < targetDist)
{
servo.write(what ever speed you want)
}
Yes I calibrated it. I've already figured out the problem and it should be fixed.
Re: Arduino+Brushless Motor Problem
Posted: June 30th, 2016, 11:54 am
by turb0lag
Bazinga+ wrote:Bob_117 wrote:Did you calibrate the esc and have you tried using interrupts for the encoder and just using servo.write() with a while loop in the main loop, like this:
while(count < targetDist)
{
servo.write(what ever speed you want)
}
Yes I calibrated it. I've already figured out the problem and it should be fixed.
Sorry to bring up an old topic, but I also seem to be having a similar issue with my brushed motor and ESC. It seems as if when the vehicle is placed under load the motor pulses in a loop. But when I lift the vehicle in the air to simulate no load, the vehicle functions properly. I have tried to eliminate excess load by eliminating the four wheel drive function, but the issue still exists. Would you mind explaining how you were able to solve this issue? I am using the Servo.h library along with delays in my code. Thanks in advance!
Re: Arduino+Brushless Motor Problem
Posted: July 1st, 2016, 3:32 pm
by unwoundmouse
seem to be having a similar issue with my brushed motor and ESC
Brushed motor or brushless?
Re: Arduino+Brushless Motor Problem
Posted: July 1st, 2016, 6:42 pm
by turb0lag
It is brushed. Is it possible that I am triggering my ESC's low voltage mode as my battery may have a low discharge capacity and is not up to the task of running the motor at full throttle?
Re: Arduino+Brushless Motor Problem
Posted: July 1st, 2016, 7:29 pm
by unwoundmouse
Do you have more information? eg what motor esc battery are you using, what is the weight of the vehicle, etc
Re: Arduino+Brushless Motor Problem
Posted: July 3rd, 2016, 11:55 am
by turb0lag
unwoundmouse wrote:Do you have more information? eg what motor esc battery are you using, what is the weight of the vehicle, etc
Yes, I should have posted that to begin with. The motor is a Traxxas Titan 12T 550 size and the ESC is a Hobbywing Quicrun 1060. The battery is a Tenergy 7.2 Volt NiMH 6 Cell. I think I may be having brownouts with the Arduino as more load is placed on the vehicle. This would cause the Arduino to reset and re-run the program. I am going to try and power the Arduino seperately and see if that can solve my issue. Do you have any other suggestions?
Thanks for the help and replies during the Summer!
Re: Arduino+Brushless Motor Problem
Posted: July 3rd, 2016, 2:07 pm
by unwoundmouse
Based on the symptoms you're currently having, I would place my bets on a voltage drop as well. I assume currently you're powering the Arduino with the ESC's built in BEC?