Aircraft Winch - Unexpected ESC/HUB Motor behaviour using PWM Throttle

Hi Arduinians,
I'm working on a remote control winch used to tow (Gliding) aircraft into the air. The premise is a HUB Motor (E-Motorbike) with 2km of tow line spooled, a Sbvaton 72200 ESC with the throttle and brake Data inputs of the ESC controller set by PWM outputs from an Arduino Mega. The RC side of things i have tested and sorted (LoRa 96).

Prior to the HUB motor and ESC arriving, I successfully created a miniature test using an Arduino utilising a PWM output to drive a very small motor via a controller. This test worked well, and I tested successfully with 3 km of line, perfect speed control of the motor locally or RC via LoRa.

I've made a hand-made welded solid frame, mounted the HUB Motor, connected the ESC and appropriate battery, and am seeing strange results (I suspect) somehow related to the PWM.

Currently haven't connected anything except Arduino MEGA, Input Digit Pin, that takes a reading from a Slide Potentiometer and outputs a PWM value which is connected to the DATA PIN of the throttle via a 220 Resistor. Very very basic setup

I tested the output with a Multimeter and get the perfect voltage. I have piped the output to the console and everything is working right. The slider gives correct values, Code changes to correct PWM value and Multimeter measure on PWM pin is what I would expect and holds value.

I did my research and understand it's probably the modulation is most likely the culprit and suspect it could be a low pass filter which I am not running.

The Motor is engaged at 1.2v (Min Throttle to get moving) and 5V (Wide open throttle)

At 1.3v PWM output, the HUB starts to turn, and slowly but surely it accelerates (despite no adjustment from Slider and PWM output not changing. Within 10-12 seconds just ends up being Wide open throttle. NOTE my ESC has USB and monitoring software and I can see the throttle input (voltage) jumping around. Its not logging, just gives a "real-time" account of Throttle input voltage into the ESC, so its hard to draw patterns or any meaningful conclusion.

The strange thing is, when I then crank up the Slide Potentiometer to give full 5v (255) Output, and then, lower to the slider to PWM output ~1.3 volts the motor eventually slows and stays at a constant lower speed. It's still not even close to where i need it to be and I can never get the HUB to spin as cosntantly and as slowly as I would like. I'm looking for very granular control of the speed including the ability to set it at below walking pace as safety is a massive factor here.

I've taken the Arduino out of the equation, and running the ESC from the Slider directly works well, this does nothing for me accept confirm that the ESC, HUB, SLIDER are all functioning correctly.

Any thoughts, comments, theories or suggestions would be greatly appreciated.

  1. Any theories? My knowledge of ESC sensitivity against PWM is lacking.
  2. I dont understand the speed increase then stability when moving back down? Any ideas?
  3. Is there a 3rd party smooth PWM to analogue module that would suit my purpose?
  4. Any documentation worth reading?

Happy to provide a video if my description doesn't make sense. I've reduced the Circuit and Code to the most very basic level. Similar to any basic (Control LED brightness with POT) type testbed.

  • POT Slider -> Digital Pin -> Basic Code to set PWM output -> PWM Output goes via a 220 Resister into the ESC (Throttle) Data IN.
  • Console Output (Slider Reading, PWM Output) perfect
  • Multimeter on PWM Output is always as expected. 1/4 Slider 1.2v, 1/2 Slider 2.5v, 3/4 Slide 3.7v, Full 5v)
  • ESC/HUB works as designed with straight Slider POT connected (i.e Not driven via arduino PWM)

Thanks in advance.

Kind Regards,
Chris.
Victoria, Australia

JCA34F Wrote "RC ESC input signals are not 0 ~ 255 PWM they are 1000 ~ 2000 microsecond PPM, like servo signals. Post datasheet for the ESC.
And your code."

Thanks JCA34F not sure why you deleted your post. I didn't follow what you wrote and was hoping you could read the below and expand.

I'll reply anyway in the hope you or someone reads this.

Controller Manual / Data sheet
http://www.sabvoton.net/static/upload/file/20191016/1571196643138512.pdf

All Documentation for the controller
http://www.sabvoton.net/downloadlist/

As I said my code is really just to isolate the issue and test the throttle function. The code is simple and it works in terms of does what i want, just the ESC and HUB dont respond as expected.

const int ledPin = 9;              //pin 9 PWM 
const int potPin = A0;           //pin A0 read input

int value;                         //save analog value
int valuenew;                      //save analog value

void setup(){
  pinMode(ledPin, OUTPUT);
  pinMode(potPin, INPUT); 
  Serial.begin(115200);
}
void loop(){
     value = analogRead(potPin);                         //Read and store pot value
     valuenew = map(value, 0, 1023, 0, 255);          //Map value 0-1023 to 0-255 (PWM)
     analogWrite(ledPin, valuenew);                  //Send PWM value to ESC Throttle (Data) input
 
     Serial.println(value);
     Serial.println(valuenew);

     delay(100);
}

No experience, but it seems you need a 0-5volt signal, not a servo signal.

PWM does not output a voltage, but a digital 0/5volt signal with varying on/off times.
Which can be integrated with a resistor and capacitor to a voltage.
Try 1k between pin and a 47uF electrolytic capacitor(+), with capacitor(-) to ground.
A variable voltage is available on the cap.
Use pin 5 or 6 (not 9) for a smoother voltage.

A multimeter is too slow to react to PWM, so show an average voltage.
A human sees a fast flashing LED as dim.

     value = analogRead(potPin);  //Read and store pot value
     valuenew = map(value, 0, 1023, 0, 255);  //Map value 0-1023 to 0-255 (PWM)
     analogWrite(ledPin, valuenew); 

or simply

     analogWrite (ledPin, analogRead(potPin) >> 2); 

Leo..

Thanks Leo, I'll give it a try this afternoon and report back.

Appreciate your time in responding,

Cheers,
Chris

Hi Leo,
Adding the cap didn't change things, however i restested without the arduino just using a few different throttles and Pots and it does the same thing (gradual acceleration without input), therefor the problem is more likely with the ESC specifically proprietary software configuration of the 72200.

I'm going to close this topic and try on the E-Bike forums see if i can get some advice there.

Thanks again for your help, I'll leave the CAP in the solution but need to sort out this acceleration problem first.

Cheers,
Chris.

An RC ESC needs a SERVO signal. I have controlled ESCs using the Servo() library.
The analog input is useless for your application. You need the PulsIn() function to measure the servo signal if you want to implement feedback from the arduino servo signal output to the arduino PulseIn input. Also, if you create variables and store the servo signal command values , before sending the commands to the ESC, you can read them back to verify the last command sent. Implementing both variables and feedback might be better than just having variables. You can test this by connecting the arduino to a small esc connected to a small motor using the white wire of the ESC three wire connector and GND on the blk and 5V on the red. Use the servo library and you will find that the control signal for an ESC works the same as the control signal for a servo. They are interchangable. You can plug a servo or and esc in and send it a servo library signal and it will work just fine.
What you have said here:

Currently haven't connected anything except Arduino MEGA, Input Digit Pin, that takes a reading from a Slide Potentiometer and outputs a PWM value which is connected to the DATA PIN of the throttle via a 220 Resistor.

Implies you are in fact not using the servo library but instead are using analogWrite

> **analogWrite(ledPin, valuenew); //Send PWM value to ESC Throttle (Data) input**

Very very basic setup

And very wrong. You need the Servo library and you need to treat the ESC as if it were a servo because it takes the same signal. The analogWrite signal is
PWM. A servo signal is PPM

PPM encoding for radio control[edit]

A complete PPM frame is about 22.5 ms (can vary between manufacturer), and signal low state is always 0.3 ms. It begins with a start frame (high state for more than 2 ms). Each channel (up to 8) is encoded by the time of the high state (PPM high state + 0.3 × (PPM low state) = servo PWM pulse width).

More sophisticated radio control systems are now often based on pulse-code modulation, which is more complex but offers greater flexibility and reliability. The advent of 2.4 GHz band FHSS radio-control systems in the early 21st century changed this further.

Second..There seems to be a GREAT deal of confusion about whether the signal received by the servo (or rather the motor controller) is PPM or PWM. The following states that it is controlled by PPM signals:

You might ask yourself "How do you know this ?" Well, I flew fixed wing RC aircraft for 10 years and during that whole time, I tested my motors using a servo tester I bought at the RC store. It worked exactly as I have said. Just out of curiousity, how much experience do you have flying RC aircraft ?

1 Like

Thanks Raschemmel,
I do appreciate the reply, unfortunately we are talking very different things, not RC. Essentially this is an E-Bike speed controller and HUB.

Take a quick look at the below youtube clip, I've book marked it at the section relative to my post. This is a much smaller but exactly the same setup.

I am trying to control the throttle (and brake etc) with an Arduino. This is to allow to the Pilot (not RC) to control the motor remotely. Currently the motor when engaged with 1.3v (via a POT without arduino I get the same result it gradually continues building speed.

My end project will look similar to this;

As I said in my previous post I'm quite sure now that the problem is with the internal software of my sabvoton 72200 Controller for my 5kw Hub Motor. Same results Arduino, Same results Pot, same results E-Bike Throttle. I believe the answer is to be found in the controller app. (Manual here).
http://www.sabvoton.net/static/upload/file/20191016/1571196543440394.pdf

Unfortunately the gap here is the documentation for the HUB motor is lacking (1 page general specification).

I suspect the current / Phase current configured in the 72220 Application is wrong for the HUB motor. The HALL test passes but there is something else wrong.

I do appreciate the reply.

PS I do fly RC planes as well, love all forms of aviation. This project is mainly to tow Paragliders and hang gliders.

Cheers,
Chris.

Thought i might show off my test circuit (which works) and basically I hoping to eventually use the same design to control the SVMC 72220 rather than this little stepper. Everything works, just need to get the throttle working!

Image 1. Shows what is the base controller. In the image you can see Arduino, controlling a Motor Driver (red PCB) (as is required for the step motor). This component wont be required in the end design but i was really testing the LoRa RFM95 (Small Blue PCB) and motor. Just used a whip (wire) antenna and was able to control from 2km away line of sight.

Image 2. Is the handset used by the pilot. I just used a little DFrobot PS4 style stick controller, but this could have just as easily been a POT or throttle. This runs into ADAFruit Feather (keep it light) which has an onboard RFM on it, again just a whip antenna for testing.

The above programming and logic worked prefectly, no problems at all.

The trouble i am having is with the bigger setup and initially I thought my only problem was the Arduino PWM output, I've since just plugged it straight into a POT (No Arduino or PWM) as in the previous YouTube clip example, and get the same result of once the engine engages it slowly and continually gains speed. The POT sort of works as in I can speed it up or shut it off, but once I hit MIN Voltage 1.3 it turns slowly but then gradually speeds up. The 72220 Controller (I believe) is supplying too much current to the HUB Motor, thus making it spin faster?

Thanks again,

Cheers,
Chris

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.