Hello,
Is there is a python library to control the ESC to send PWM signals?
*I am using Nvidia Xavier NX Dev Kit.
Hello,
Is there is a python library to control the ESC to send PWM signals?
*I am using Nvidia Xavier NX Dev Kit.
Our ESCs are controlled by PWM signals like those commonly used in servos (ON times of 1100-1900 microseconds).
I haven’t used your dev kit before but I’d suggest looking for libraries that support controlling servo motors, as then you’ll be able to just specify the min and max ON times, and the proportion you want to set the ESC to (e.g. 0% → full negative, 50% → off, 100% → full positive).
If you’re not able to find a servo library then you’ll likely have to control your PWM signals with the more standard duty-cycle and frequency parameters, in which case you should note that our technical details specify a maximum update frequency of 400Hz. Note also that lower frequencies will generally have a lower duty-cycle resolution in the operating range (e.g. a 10Hz signal has 1100-1900us ON times as 1.1% to 1.9% duty-cycle, whereas for 50Hz it’s 5.5% to 9.5%, and at 400Hz it’s 44% to 76%)
An appropriate duty-cycle proportion for a selected frequency can be calculated by duty=\frac{1100 + ratio \times 800}{1000000 \times frequency}, where ratio is a number between 0 and 1 (e.g. 0 → 1100us → fully negative, 0.5 → 1500us → stopped, 1 → 1900us → fully positive), and frequency is your PWM frequency in Hz.
Hello, I have this commander , ESC and T200
I want to control T200 with Jetson nano GPIO. (using python)
So, I have to know the value of PWM cycle and duty ratio.
Please tell me these values.
I solved the problem by myself.
Hi @114514, welcome to the forum ![]()
I’ve moved your post here because it’s on the same topic.
Glad you’ve already managed to solve your issue ![]()
Hey @EliotBR @mahmoudf98 , Can you please tell me how did you control the BLDC using Jetson Xavier Nx?
I’m working on a project, Autonomous Differential Boat. I’m using a PWM Driver (PCA9685) , but I couldn’t control it, the esc beeps but no motor movement, no matter what pulse I sent.
I’d love to receive help from anyone ![]()
Hi @Tanya, welcome to the forum ![]()
What kind of ESC are you using, and how is it beeping? It’s common that ESCs require a continuous “stop” signal to be received for a couple of seconds before it will arm itself and allow controlling the motor.
If your ESC is configured for bidirectional motor control then that is most likely 1500µs pulses, although if there are timing mismatches between your ESC and PWM driver then you may need to trim that up or down a little for it to register as intended.
It’s worth noting that the PCA9685 is intended for LEDs, so its internal clock/oscillator is not necessarily ideal for sending precise servo signals. If you’re using the chip by itself (rather than on a dedicated servo driver carrier board), and don’t have an external oscillator in your circuit, then it’s possible the oscillator is offset enough that the signals require significant trimming, or inconsistent enough that your ESC refuses to arm.
Hey Elliot,
Thank you for this fast reply.
I’m using T-Motor Air Gear; Motor:2213/920Kv, Esc: 20A 600Hz
I did as you said, trim the signal up or down
Today, I tried testing the range giving continuous microsecond pulses using the PCA9685.
I’m working on 50Hz, started from 1000us, it stopped beeping at 4000us, started moving at (Left motor 4070us, Right motor 4050us), I decided that my maximum is 4400us, I think it will be fast enough for controlling my Autoboat, but it can take more, I tested until 6000us; it was too much.
What do you think about this?
I’m new to all of this so Idk if this is wrong, I would like to hear your opinion about all this. And
I can’t find any clear specifications or datasheets for these, which makes it difficult to evaluate if any particular approach is correct or problematic.
This seems quite unusual. PWM-driven ESCs would typically use servo-style signal ranges, which are generally ~1000-2000µs.
I am curious what kind of code you’re using to control the PCA9685 chip - perhaps there’s a missing scale factor of 4, in which case the range you believe to be 4000-6000µs pulses could be physically outputting 1000-1500µs pulses, which seems more reasonable.
It is of course possible that your ESCs just use an unusual signal type, but that would make them incompatible with a lot of existing setups, which seems unlikely unless they heavily advertise some benefit to the difference.
You mentioned testing a range of 4000-6000µs, in which case 20/2000 is ~1% difference. It’s quite possible that won’t be noticeable compared to other effects (e.g. if the boat is slightly unbalanced, or there’s a current in the water). If you’re concerned about it you can try to run a test in flat water (e.g. in a swimming pool or lake) with and without compensation, and see whether you can tell which one travelled straighter.