Step 7: R/C Controller Communication and Signalling

Because R/C controllers take as an input the hobby industry "standard" servo pulse, you cannot just communicate with it using a 3-wire potentiometer. A signal conversion must take place, and it can either be done in hardware or in software.

The lead image is a graphic of a typical "servo command" pulse-width pulse: 1500 microseconds is a neutral or zero speed signal, 1000 microseconds usually full power one way, and 2000 full power the other. While servos and robot controllers respond to the pulse durations as indicated, a typical airplane controller is unidirectional. The most common "default" is 1000uS as zero speed and 2000uS as full speed, or something resembling that range. Of course, the ESCs can be recalibrated to accept different endpoints at will, so this distinction is mostly inconsequential.

A Simple "Servo Tester" is Your Friend

A vehicle throttle is basically a knob you turn to generate a signal to something which controls how fast the vehicle goes. In gas engined vehicles, this knob might literally have pulled on the engine's throttle body, but generally these days it's an electronic signal to the engine computer.

In the hobby world, there exists a small device that is sold commercially which does precisely the task of converting a knob motion to "servo" pulses, and it's called a servo tester . An example is shown in picture 2; this one in particular . They are used in lieu of setting up a whole radio and receiver just to make sure your servos work. Notice that one (and most cheap ones sold today) have three outputs - this lets you test all 3 servos in a helicopter main rotor simultaneously. You only need to use one.

The cool part about most servo testers is that you can directly drop a 0-5v source, such as a 3-wire potentiometer or commercial vehicle throttle, into the place of the knob (which itself is a potentiometer). The 3rd image shows a conversion I have done to that particular servo tester model - the 3 pin connector goes to a commercial hand throttle (more on those parts in a bit). After this stage is complete, you have a direct analog voltage to servo pulse converter that can be installed in a vehicle.

Note that these come with different modes available such as "neutral", useful for keeping your servo centered while you adjust linkages, and "sweep", which automatically does a full 1000-2000uS sweep. These modes are not useful, and if accidentally selected during operation, can result in bad . It is recommend to remove the button which selects the modes.

Full hardware method

If you love torturing yourself, you can build a 100% hardware (i.e. resistors, linear integrated circuits, caps) timing circuit that will convert a 0-5v reference to the appropriate servo pulse. I link to a few in the older edition, but these days, you have no excuse to use a full hardware servo tester given that they cost like 5 cents. Hardware component values change with temperature and even humidity, and there are more parts, leaving them more prone to failure.

Throttle ramping

Because sensorless R/C controllers can't really control how much current they send to the motor (and current is directly proportional to torque output), and low-speed starting can be erratic and hard to control, it is useful to have a "ramp" somewhere in the throttle chain. Without ramping or some other kind of control input damping, sudden jerk motions of your hand or foot can result in the vehicle responding unexpectedly such as a sudden application of power. This is not only hard to operate, but it can be outright dangerous if you are in traffic or around other people.

Ramping can be accomplished either in hardware or in software.

Hardware resistor-capacitor filter

In the fourth image is a "RC filter" type circuit, where RC is resistor-capacitor , which smooths out sharp transients in the control input. The general form of the circuit is known as a low pass filter, and its technical details will not be discussed (Wikipedia can provide a better treatment than I ever can). The values of your choice of R and C determine the damping "time constant", and that's just given by Trise = R * C .

No, really, that's it. So in the example, a 100K resistor and a 10uF capacitor together form a filter which has a rise time of 1 second - meaning if you floor it from standstill (like you shouldn't be doing anyway, right? ) the control signal takes 1 second to reach 63% (the defined standard threshold for this circuit). True settling time is defined as the time it takes for the output to reach over 90% of the final value, and is generally accepted to be 3 time constants (3 * T). You may adjust the R and C values to achieve however fast a filter you want.

It is important that the resistor is of significantly higher (at least 10 times) value than the throttle potentiometer, and should be at least 10K ohms. The reason is that if the resistor is too close to the pot's total resistance, the potentiometer affects the filter's time constant strongly. I put 100K as an example, but with most vehicle throttles being 5K ohm resistors, try to use at least a 47K resistor. The capacitor can be any polarized or nonpolarized type, but if it's polarized, please put it in straight. The whole circuit can be soldered inline with a throttle harness.

The second variant of this circuit adds a one-way bypass to the system such that throttling down is unramped - meaning if you let go from full throttle, it doesn't take a full second for the throttle signal to slowly come back down, it will do so almost instantly . The diode conducts if the input voltage on the potentiometer side is lower than the capacitor's voltage (which is the output), so it effectively shunts input to output for those positions.

In software using a microcontroller

Ramping is also achievable in software if you're making your own servo tester-like device anyway. For instance, the following Arduino code implements ramping by taking a R/C pulse in on one digital pin and spitting it back out on another. This was written by Arduino and motor control master Shane Colton .

#include <Servo.h>

#define THR_MIN 178
#define THR_MAX 870
#define PWM_MIN 1000
#define PWM_MAX 2000

#define SPEED_LIMIT 0.33 // fraction of full speed
#define RAMP_LIMIT 0.13 // fraction of full speed per second

Servo tgypwm;

float pwm_f = (float) PWM_MIN;

void setup()
pinMode(9, OUTPUT);

void loop()
signed int thr = THR_MIN;
float thr_f = (float) thr;
float pwm_target = (float) PWM_MIN;
unsigned int pwm_i = PWM_MIN;;

thr = analogRead(7);

thr_f = (float)(thr - THR_MIN) / (float)(THR_MAX - THR_MIN);
pwm_target = thr_f * SPEED_LIMIT * (float)(PWM_MAX - PWM_MIN) + (float) PWM_MIN;

if(pwm_target > pwm_f)
pwm_f += RAMP_LIMIT * (float)(PWM_MAX - PWM_MIN) * 0.05;
pwm_f = pwm_target;

pwm_i = (unsigned int) pwm_f;



<p>This 4 year old instructable is STILL a treasure trove of useful relevant information. Thanks for sharing!</p>
A fun build! Thanks for the awesome instructable!
<p>Actually instructive. Though the term is common I had no idea what a brushless motor was or how it worked, and I am an electrical engineer, an old one. Sixty years ago I was wondering why the brushes of the dead motor that I was rewinding were not semiconductor devices. The transistor was then 10 years old. Life took me in other directions so the idea never matured - and suddenly I know. Thanks! Further I now understand something about the DC/AC drive of the Tesla Auto. My interest is, at the moment, in electric propulsion for a nearly finished Sampan sitting in my back yard. Though off the shelf devices are readily available I am hoping for something better. Your remarks about RC devices and propellers seem to apply. The battery info is also helpful. I am struggling with the tradeoff of a low HP gas outboard, at less than 40lb and a 20lb trolling motor with a 50lb 12 volt lead acid battery. You advice about how to purchase motors, batteries and controllers is most pertinent. - Boatmakertoo</p>
<p>Hi My gfs bike has a 12mm rear axle and she hates the 6kg front hub. Id like to use this motor to drive the back wheel. It looks very similar to my internal motor on a mac 10t geared hub motor ie lots of turns. Could I not just use the infineon sensorless controller? http://www.hobbyking.com/hobbyking/store/__54888__9235_100KV_Turnigy_Multistar_Brushless_Multi_Rotor_Motor.html</p><p>Anyway thanks for the article, Dan</p>
<p>very good article, a great help to all modellers!</p>
<p>Very good, enlightening article !</p>
<p>You Sir, are my hero.</p>
<p>Hi, your<br>article is sooo good!</p><p><a href="https://www.instructables.com/id/The-New-and-Improved-Brushless-Electric-Scooter-Po/all/?lang=es" rel="nofollow">https://www.instructables.com/id/The-New-and-Improv...</a></p><p>I created<br>some links to it at my site <a href="http://www.avdweb.nl" rel="nofollow"> www.avdweb.nl</a></p><p>You've put all<br>topics under each other so they are difficult to localize, it is sooo long now.<br>Can you create a table of contents on the top with links to the separate<br>topics?</p><p>Or create<br>separate items on instructables.</p><p>Kind regards,</p><p>Albert</p>
<p>It looks like the above named A123 ALM_12v7 drop in batteries are available from: <a href="http://www.buya123batteries.com/ALM_12V7_p/400520-201.htm" rel="nofollow">http://www.buya123batteries.com/ALM_12V7_p/400520-...</a></p><p>for $130.00</p>
What is the pinout for the standard, RC esc sensor connector?
Wonderful instructable. Have been giving it some thought for a bit and wondering why you haven't considered building your own ESC. From your descriptions a sensorless controller suitable for our purposes seems very doable, but not available within the R/C airplane realm. We need a custom, self-starting, sensorless ESC. Other's have made them. <br> <br>Once you have the basics together fine-tuning becomes possible. Seems like the perfect solution to a host of problems. Perhaps the springboard to designs otherwise out of reach.
Thanks for your instructable. It's very interesting and complete but I have a, may be, stupid question. I'm planning to put sensors in an outrunner as well and wanted to know how to tie the sensors to the ESC. There seems to be a standard 6 pin connector shared between the different ESC models. How do I wire the sensors to this connector?
This is a pretty sweet little scooter, might make one for my son if he starts behaving again. lol <br> <br>I am legitimately trying to find that gas motor which you showed but did not use. <br> <br>Can you tell me where you found it? I can only find electric models, which are great but not appropriate for my current project. <br> <br>Thanks, <br>-Grey
I found a good place to get thick very flexible 8 and 4 gauge wire is the local car stereo center. Th 8 gauge I used cost $1 per foot. They had 4 gauge but it was much more expensive.
Wow after reading this article now I'm building a scooter. <br>Bad influence I think.. <br>Welding and machining I get but the electrics are not so much my thing :( <br> <br>I bought 2 motors <br> <br>KA63-18L <br>Constant: 259Kv <br>Battery: 10Cell Lipo <br>Operating Current: 25-60A <br>Peak Current: 72A(15sec) <br> <br>Here is the problem.. Do I run one and have a spare or use them both? <br>If both what would be the best way? <br>
If you run both you need a controller for each. Now this may sound easy but you need to be careful to set up each esc the same and use the exact same model of esc and motor or one motor will do more work. Now unless you want to push more than 200 lbs around at 20 mph or more one motor should be sufficient as long as you use the gearing equation from this article as to not burn up your motor. Good luck and feel welcome to ask any questions you want to.
Hobbyking now sells 20C four cell 5 Ah lipo packs from the US warehouse for about $25 per pack: <br>http://www.hobbyking.com/hobbyking/store/uh_viewItem.asp?idProduct=18631
Could I maybe use a large pvc pipe to hold the hall effect sensors?
How exactly do you back install hall effect sensors in a motor? I am trying to make an electric motorcycle and want to use a kelly controller. I have a Turnigy 80-100-A 180 KV brushless outrunner (the same class that is on the scooter in this instructable) and have had a really hard time figuring out how to install sensors. I am also having a hard time figuring out how this motor is wound. <br>Any help would be greatly appreciated, thanks in advance.
It is extremely difficult to install *internal* sensors onto a mystery motor (of which you do not know the internal winding pattern). The C80 series is also very difficult to discern because they require so much current. <br><br>Usually, you would run current through two phase wires (&quot;line to line&quot;) and use a test magnet to observe which poles are polarized in which directions - they should always be alternating from tooth to tooth and there should always be 8 of them on in total. Using this and the process of elimination you can separate the 12 teeth of the stator into 3 groups of 4 teeth which you can call &quot;A&quot;, &quot;B&quot;, and &quot;C&quot;, which are associated with one of the three phase wires. Then, the Hall sensors are placed *between* 2 teeth of *different* phases.<br><br>Because the C80s have a very low resistance and few turns, you need either a ton of current or a sensitive magnetometer to determine the direction of the stator field. <br><br>Using external Hall sensors on the C80s is possibly the easiest solution. <br><br>
Thank you for the info, I have tried to run current through the different phases but I could not get enough current to get discernible results. I am thinking of just rewinding the motor so I know where the different phases are. Unfortunately I do not have access to anything to make an external mount for hall effect sensors. Do you know of a website that could make a mount for me? I also do not have any experience using CAD software. Another question I have is do all hall effect sensors have the same wiring scheme? The website I got mine from did not tell me which lead is which.
hi <br>a bit for the sake of accuracy: when you refer to &quot;convection&quot;, you actualy mean free convection(no air speed), as opposed to forced convection. <br>other than that petty note, its a great article and im learning why i shouldnt have bought the esc that i have...
Just wanted to say a quick thanks for this instructable. It's the detail all in the one place that i have been searching for, for years. Thanks for confirmation of R/C parts as well and the technical detail.
Can you use the sensored kelly controllers with a sensorless motor?
Not the KBS - Kelly does have the KSL line which is sensorless, but I have not heard vehicle stories about them nor know what settings they can manipulate (e.g. ramp-up time, initial current, etc.). And they're huge - they're full-size Kelly cases.
Great tips, especially about bore size changing! Thanks for taking time and explaining this!
If I'm going to use LiFePo4 batteries from HK, will I need to include a battery management system when discharging and/or charging? Great instructable, by the way.
You wouldn't necessarily need one, but as long as you are getting a Li batt from Hobbyking, pick up a balancing charger along with it. It will be there when you do need it. <br><br>I do not think HK cells are as robust as A123s, and they definitely get out of balance faster. It is a good idea to have the balance connector accessible and to periodically throw them on the balance charger.
NIce Work!, do you have any video to see how it works?
http://endless-sphere.com/forums/viewtopic.php?f=2&amp;t=6892&amp;start=75#p119810 <br> <br>Is a good piece of software to calculate speed etc, I got the link from http://www.jeromedemers.com/
Double check your info on GT belts. They're made by Gates, who rate them for much higher load than HTD belts. The belts have round teeth and are compatible with HTD sprockets, but supposedly work better with GT sprockets.<br><br>I know this because I've been working on the belt drive system for you-know-what.
Great tutorial, <br>I'm in the process of building up my e-scooter I brought for $20 and was just wondering what are your thoughts on 3d printed parts for spurs and sprockets with chain for a scooter? <br>Cheers <br> <br>Larry
Hey Larry,<br><br>I wouldn't expect a 3DP sprocket to last very long due to it interfacing with metal. I have, however, played with 3DP timing belt pulleys. I wouldn't put more than 2-300w through a 5MM printed pulley, though.
WOW that is an absolute ton of information. THANK YOU!<br><br>Also, I find that for twisting the wires, it's better if you have a minimum of two people (three is better) and to twist all your wire up at once.<br><br>SETUP:<br><br>Two people have drills with the wires chucked into the ends. Both drills are in the same direction.<br><br>Ends of the wires not in the chucks are securely connected together. I use a ziptie with the wires doubled over.<br><br>The length of the wire is stretched out (This is where the third person helps) but not touching the ground and connected to something like an eyehook or something. The wires must be FREE to spin in the air and not touch anything.<br><br>Then you simply spin the drills at the same RPM (two identical drills set on 'low' is best) and you watch as the wire begins to twist itself into a neat little cable without any kinks. The third person can hold the wire where the twist is coming together to help it form nice and tight.<br><br>I have made bundles of CAT-5 cables over 25' long with this method and it only takes about 5mins to get the setup and everybody schooled in their job. With good quality silicone wire and good helpers, it can go even faster.
I've done this on my own many times. Clamp one end, use a drill at the other end and have at it. Sometimes I'll use a heat gun to anneal the insulation, but sometimes I'll just let it sit for a minute or deal with it unraveling a little. A heat gun is easier if you have a second person, but I've used the weight of a drill to keep the wire tensioned while I run a heat gun over it.<br><br>Make sure you have plenty of slack to start with, the longer the wires the shorter the bundle you make will get (since the wires travel in spirals instead of straight lines)<br>
By twisting both wires in the same direction, they will wrap themselves and stay wrapped--no heating required. They also don't want to coil up on one another. They lay flat, and coil just like a normal cable.<br><br>This is an ancient rope/twine making technique.

About This Instructable




Bio: lol robots
More by teamtestbot:How to Build your Everything Really Really Fast Chibikart: Rapid-Prototyping a Subminiature Electric Go-Kart Using Digital Fabrication and Hobby Components The New and Improved Brushless Electric Scooter Power System Guide 
Add instructable to: