#define MAX_SPEED 1240 // speed where my motor drew 3.6 amps at 12v. #define MIN_SPEED 1040 // speed just slow enough to turn motor off Note: the following speeds may need to be modified for your particular hardware. #define POT_PIN (34) // Analog pin used to connect the potentiometer center pin ![]() #define LED_BUILTIN (2) // not defaulted properly for ESP32s/you must define it #define ESC_PIN (33) // connected to ESC control wire ESCs are the modern version of older, mechanical speed controllers. ESCs control an electric motor’s speed and thus the speed of an RC model. ESCs connect to an RC model’s electronic system. ESCs can be built-in or standalone (removable) units. Connect the main power pack to the ESC 4. ESC is a circuit composed of tiny electronic components. Disconnect the BEC cable of the ESC (trio wires) from your receiver, then connect it to the program card at the top right corner position marked with BEC 3. This error helps ensure that your motor will stop if you accidentally disconnect your joystick, potentiometer or RC receiver. Some use stick programming, some will use a card device, and others like BLHeli can be connected to a PC for settings. Disconnect the power pack from the ESC 2. Not all ESCs can be programmed, nor is there a uniform set of features for them. #include "ESC.h" // RC_ESP library installed by Library Manager No indication in that listing as to whether the ESC can be programmed beyond basic throttle calibration. Enter the PROM, connect the throttle on the emitter using the simple option M, and move the throttle. #include // ESP32Servo library installed by Library Manager How to Use: Speed controller programming instructions. If you try to use a programing card on an ESC not designed to talk to that card (for example a turnigy card with a blue-series ESC) it will probably fail and can damage the ESC. ESC programing cards are designed by product line. * and my particular ESC (generic 30A) and brushless motor (generic 2200KV) There is no universal ESC programming card. * comes with the ESC library, so that it works with an ESP32 DevKit V1 * Note: the following code is a modification of the Knob Example that You may have to fiddle with arming parameters, commanded speeds, etc., etc., etc. The code listed below is a modification of the NANO code, and it works with an ESP32 DevKit V1 and my particular hardware combination. I modified the example until I arrived at a NANO sketch that reliably started the motor and made it run though a good range of speeds when I turned the pot full travel. These motors like to be started up very slowly after arming, so I put in a loop to do just that. At first, using a NANO, the program only made my motor chirp at me, but not run. The Knob Example that comes with the RC_ESC library only compiles with an AVR board. Keep holding full throttle on the transmitter. ![]() Hold full throttle on the transmitter and turn the ESC switch ON. Plug a battery into the ESC - If your ESC does not have a switch, hold full throttle on your transmitter before plugging in the battery. (3) Hobby ESCs and brushless motors are fussy beasts. Start with the transmitter ON, the battery disconnected, and the ESC switch in the OFF. Note that if you let the Library Manager update this library, you'll have to repeat this step! These programmers allow you to easily adjust parameters on your ESC to suit your RC airplane or RC helicopter. Note that this library will still throw a warning that it's AVR-only when compiled for an ESP32 board, but it's only a warning, and compilation will finish OK. Change line 16 to #include and save the changes. To do this, go to your libraries folder where you store your programs, drill down to RC_ESC>src>ESC.h, and edit it (I used NotePad++). It has a buried reference to Servo.h which must be changed to ESP32Servo.h. ![]() This library does not claim to work with ESP32s, and, indeed, it does not. (2) In the Library Manager, search for "RC_ESC" and install version 1.1.0 by Eric Nantel. These libraries use timers that are different for ESP32 versus the AVR boards, like the Arduino and its variants. Note that, in any program that you write for using servos with an ESP32, you must have #include rather than #include. (1) In the Library Manager, search for "ESP32Servo" and install version 0.9.0 by Kevin Harrington. I think in order to accomplish the slowing effect you will have to break the region of travel down into different sectors and use your "tSpeed(int)" function to different speeds over the travel path.Well, I got this working with the following steps, using the Arduino IDE and it's library manager, and running a modified version of the Knob Example from the ESC library on a generic ESP32 DevKit V1:
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |