Arduino+Brushless Motor Problem
-
- Admin Emeritus
- Posts: 1115
- Joined: May 10th, 2011, 8:25 pm
- Division: Grad
- State: TX
- Has thanked: 0
- Been thanked: 1 time
Re: Arduino+Brushless Motor Problem
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)
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)
'If you're the smartest person in the room, you're in the wrong room' - Unknown
- Bazinga+
- Exalted Member
- Posts: 383
- Joined: March 8th, 2014, 7:10 am
- Division: C
- State: NY
- Has thanked: 0
- Been thanked: 0
Re: Arduino+Brushless Motor Problem
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() ).windu34 wrote: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() presentBazinga+ wrote:Something like thiswindu34 wrote: How did you implement your code to gradually change your speed?
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?
Innovation =/= success
-
- Member
- Posts: 16
- Joined: December 3rd, 2015, 4:24 am
- Division: C
- State: TN
- Has thanked: 0
- Been thanked: 0
Re: Arduino+Brushless Motor Problem
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)
}
while(count < targetDist)
{
servo.write(what ever speed you want)
}
There is nothing like the last minute rush to get your cheatsheets organized the night before the big day
"I don't believe in luck, I believe in skill or the lack thereof." - Me
"I don't believe in luck, I believe in skill or the lack thereof." - Me
- Bazinga+
- Exalted Member
- Posts: 383
- Joined: March 8th, 2014, 7:10 am
- Division: C
- State: NY
- Has thanked: 0
- Been thanked: 0
Re: Arduino+Brushless Motor Problem
Yes I calibrated it. I've already figured out the problem and it should be fixed.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)
}
Innovation =/= success
Re: Arduino+Brushless Motor Problem
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!Bazinga+ wrote:Yes I calibrated it. I've already figured out the problem and it should be fixed.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)
}
-
- Member
- Posts: 8
- Joined: May 27th, 2016, 6:23 am
- Has thanked: 0
- Been thanked: 0
Re: Arduino+Brushless Motor Problem
Brushed motor or brushless?seem to be having a similar issue with my brushed motor and ESC
Re: Arduino+Brushless Motor Problem
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?
-
- Member
- Posts: 8
- Joined: May 27th, 2016, 6:23 am
- Has thanked: 0
- Been thanked: 0
Re: Arduino+Brushless Motor Problem
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
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?unwoundmouse wrote:Do you have more information? eg what motor esc battery are you using, what is the weight of the vehicle, etc
Thanks for the help and replies during the Summer!
-
- Member
- Posts: 8
- Joined: May 27th, 2016, 6:23 am
- Has thanked: 0
- Been thanked: 0
Re: Arduino+Brushless Motor Problem
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?
Who is online
Users browsing this forum: No registered users and 2 guests