Hello, I have barely any experience with coding, Im trying to use an arduino uno to control 2 sensored brushless motors I've mounted in a kids ride on toy.
I need the arduino so I can add forward reverse and the pedal switch.
Im failing miserably at trying to get the motors to sync to the pwm codes ive tried sending. Anyone with experience in this specific application of coding, help would be greatly appreciated.
#Coding issues with arduino uno
88 messages · Page 1 of 1 (latest)
I can try to help
oooh arduino fun
what have you tried
i think i own one of these
yah its the wifi
That would be awesome. I've tried quite a few codes provided by chat gpt but nothing seems to arm the motors when I hook them up. I've tried pretty much everything that was suggested by chat gpt including purchasing the a tool with a fancy name to determine what pwm signal the motor respond to with a rc receiver
you got datasheets for the motors?
Somewhere yeah but not very helpful I've looked it over so many times it's missing the important info.
datasheet should say something about "operating principle" or "control type" if it doesn't say specific control signals
but the big question is:
what have you tried?
oh yeah this is a consumer application designed for a specific controller
I tried powering the arduino externally instead of from the esc I've tried i bunch of sweep codes I'll send the most recent one
well there's a lot of debugging to do along those lines but i have a few questions haha
are you trying to signal the motor controller with the arduino yourself? or are you trying to power the motor directly?
#include <Servo.h>
Servo esc;
void setup() {
esc.attach(9); // ESC signal pin
delay(500); // 0.5 second power-up delay for ESC
// Sweep from 1400 µs to 1600 µs in 5 µs steps
for (int pulse = 1400; pulse <= 1600; pulse += 5) {
esc.writeMicroseconds(pulse);
delay(1000); // 1 second pause at each step
}
// Hold last signal steady (likely around 1500 µs)
esc.writeMicroseconds(1500);
}
void loop() {
// Do nothing - ESC remains at neutral signal
}
Just attempting to signal the motor with a pedal switch and a smooth start it has its own power supplied to the esc from a 4s or 3s battery
have you used a multimeter or oscilloscope to verify the signals from the arduino controller are as intended?
if you have an oscilloscope, have you used it to observe the signals from the supplier-provided part?
you can find cheap compact oscilloscopes, they're really a necessity if you're building electronics
I used a oscilloscope to measure the signal and attempted using that signal aswell in some simple code to just spin the motor and nothing seems to get the motor to activate they stay in a stat of just beeping telling me it's receiving the wrong signal but it is receiving a pwm signal
you have a supplier-provided part that works with the controller in place of the arduino right?
did you observe the signals from that?
Not supplied im using a radio link that I've use to narrow down the issue.
Yes I did and tried sending it but still didn't work.
have you measured the currents in the conductors? do you know if the transmitter is supposed to be high- or low- impedance?
Im using an at 10 controller meant for planes.
@onyx escarp has reached level 2. GG!
If the receiver is expecting the transmitter to have low impedance then a high impedance transmitter might not work because it might not supply enough current
the GPIO drivers on an arduino have high impedance
does the motor controller supply constant voltage to your module? have you tried connecting the other pins to the constant supply with a relay?
I haven't tried that.
Im pretty sure it gets constant power to the motor.
Are you referring the the receiver in the esc or the controller receiver itself?
i'm referring to the transmitter in the esc and the receiver in the controller
if the esc receives a voltage supply from the controller then it might be expected to signal the controller by connecting that supply to the esc control signal pin so that current can flow freely
that would be a low-impedance transmitter in the esc
you can know how much impedance you need by knowing the current expected by the controller receiver, and you can know that by measuring it under standard operating conditions
you can also know that by measuring resistance across esc module pins during operation
in any case the problem begins with getting a particular V/A to the motor controller
you appear to know V but not A
Referring to voltage and amps i assume. Im not super familiar with all the lingo of coding just yet and second guess what im reading.
well this is all electronics stuff still haha
in fact i would put down the arduino until you're able to signal the motor controller with a simple circuit
Lol yeah that part im a little more familiar with.
How would I manage using a circuit if the motor controller expects a pwm signal
you can at least signal 0 and 1 to a PWM decoder with basic tools
you should also probably know how to build a basic PWM circuit with a MOSFET and certain other discrete components
very often you'll need to build a separate driver circuit when working with microcontrollers like arduino
the arduino provides the setpoint signals and your driver circuit does the lifting
separate PWM circuit would be a reasonable PWM setup with arduino GPIO
just depends on application
Well shoot that a bunch. Im mainly just trying to upgrade the motors on a ride on toy. My only snag is needing some new gears and controlling the motors from a pedal. Is the arduino going to be the easiest?
Well it's more a question of it's possible
very cool build
Thank you.
The potential problem is just that the arduino GPIO driver circuits might not have the right impedance or provide enough current (or they could even provide too much)
SO
you need to know how to signal the motor and then after that apply the arduino to stand in as control if that's even necessary
that's the logic of this endeavor
first know how to signal the motor with basic tools (show you can do it)
then asses how to work arduino with known GPIO characteristics into that
arduino has good datasheets
Basic tools just to prove that the motors function
right just to prove the pins you can touch work in a certain way
arduino datasheet will say exactly whether GPIO can drive that directly or if you'll have to drive it separately
Well everything function with the rc control.
I'll look into the datasheet.
let me try to understand this rc control setup
you have a handheld radio transmitter i see
and you also have a radio receiver/decoder (called the ESC?) that signals the motor controller?
is that right?
and you're trying to use an arduino in place of that to signal the motor controller?
because you want to control it with a foot pedal?
hang on i don't think you need an arduino
Ohhhh
i really think you need to build an analog pwm modulator
i think you need to set that with the pedal and have computer out of the mix
I still want reverse and a slow start but only have a switch in the pedal not a potentiometer
alright now you're starting to get back to desirable computer control
"we want advanced features that are easy to say in software"
Lol
that makes sense but it also makes sense to be able to implement a lot of this with basic transistors and transistorized discrete components
but anyway
step one remains prove you can signal the motor controller one way or another
build from there to inclusion of the GPIO
then you can play with C++
measure measure measure
Thank you. Ill see where this info gets me.