Mapping ESC input to output force of quadcopter Motor - Page 1
Forum section: electronics / projects

author: BurnedResistor
author_rank: Regular Contributor
timestamp: March 30, 2017, 02:06:40 pm
content: Hello All,I was toying around with the idea of writing a MATLAB simulation that includes all of the sensor fusion and pid.To test it out I would like to implement a model of the quadcopter.My Problem: I am unsure how to determine the maximum upwards output force of the motor and rotor, and how it maps with the input of the ESC.I know the optimal case would be to measure it, but I am unsure how I could perform such a measurement. This is for a hobby project, so I am not interested in a very elaborate setup, but I am not afraid to get my hands dirty.If measuring is out of question, would a linear correlation be an ok guess? What factors do I need to aproximate the max output force?I have a motor at home and will post details as soon as I get there.It might be easier to measure how the input of the ESC maps to rotation speed. From there it should not be too hard to model how the rotational speed maps to output force.Would I need to measure the actual speed of rotation or would using an oscilloscope to measure the speed of the 3phase output be sufficient for that?

author: Mr. Scram
author_rank: Super Contributor
timestamp: March 30, 2017, 03:51:33 pm
content: Quote from: BurnedResistor on March 30, 2017, 02:06:40 pmThat seems easy enough. Get a motor and a scale. Tare. Input power, measure thrust with scale. Rinse, repeat.

author: BurnedResistor
author_rank: Regular Contributor
timestamp: March 30, 2017, 04:44:26 pm
content: As in measure the weight of the motor resting on it?This being a motor designed for lifting a whole quadcopter, would this not only allow me to capture the very bottom of the range of the motor?Quote from: Mr. Scram on March 30, 2017, 03:51:33 pm

author: Mr. Scram
author_rank: Super Contributor
timestamp: March 30, 2017, 04:47:54 pm
content: Quote from: BurnedResistor on March 30, 2017, 04:44:26 pmWell, if you want to do it that way, it is easy to add weight or to find a scale with negative weight, as most digital ones have. However, it is easier to simply invert the set-up and have it push down on the scale. That is actually a pretty common way to test a propeller. People sometimes use a lever construction too, but I am not to keen on the extra variables that introduces.

author: rstofer
author_rank: Super Contributor
timestamp: March 30, 2017, 04:55:14 pm
content: Put a brick on the scale, something the prop can't lift. Somehow mount the motor/prop and try to lift the brick noting the loss of weight on the scale. It would be nice to know how much lift occurs at various RPMs and various amounts of current. The prop needs to be some distance away from the brick such that the prop wash doesn't impact the brick and push it back down.Or, just guess! What difference does it make for a simulation? A linear transform of input to output is as likely as anything else. Or you could model an exponential function. Or discreet steps... Just guess!

author: Ian.M
author_rank: Super Contributor
timestamp: March 30, 2017, 05:14:51 pm
content: The lever arm allows you to test the motor/prop assembly in free air. However its a PITA to build for just one test. The brick approach lets you test all the motors in situ on the quadcopter - just hook all their ESC control inputs to the output of a servo tester. However getting clean airflow and avoiding ground effect may be difficult.If you want an accurate simulation, you'll also need to do some step changes in throttle command to see how responsive it is while monitoring the motor speed.

author: BurnedResistor
author_rank: Regular Contributor
timestamp: March 30, 2017, 06:06:59 pm
content: Well, I must admit the lever is a very novel idea. I definitely increases variables, but I am doing this for the educational value of designing a simulation, not for a perfectly accurate result. I am mostly looking for a ballpark! Thank you for the incredible idea!Another thing to take into consideration would be determining how quickly the output force changes once the input changes... Maybe replace the scale with a load cell, hook it up to an oscilloscope, and look at the correlation at PWM input to the ESC and change in pressure?Quote from: Mr. Scram on March 30, 2017, 04:47:54 pm

author: Mr. Scram
author_rank: Super Contributor
timestamp: March 30, 2017, 06:24:46 pm
content: Quote from: Ian.M on March 30, 2017, 05:14:51 pmYou can do free air with a top down design, or at least something very close to it. Just extend the propeller a bit from the weighing platform.

author: rstofer
author_rank: Super Contributor
timestamp: March 30, 2017, 07:52:48 pm
content: Quote from: BurnedResistor on March 30, 2017, 06:06:59 pmThat was the point of Ian.M's comment re: step response. Go from just idle to full throttle and see how long it takes to get to full lift. If you had a load cell, you could capture the transfer function on some kind of recorder. A Digilent Analog Discovery would be perfect for this. In fact, I think you could use the AD to trigger or drive the ESCs and the scope function to record the lift.Most digital scales will be too slow to get a good trace of lift versus time. I was thinking you could put a digital counter near the weigh scale and record weight versus time with a cell phone camera. But I'm pretty sure the scale conversion time will mess that up. You could do it step-wise, pausing at each step long enough to get a somewhat stable reading. However, that's not the true step response.At some point, getting the transfer function for lift is a bigger project than the simulation it is expected to feed.

author: brucehoult
author_rank: Super Contributor
timestamp: March 30, 2017, 08:28:39 pm
content: Quote from: BurnedResistor on March 30, 2017, 02:06:40 pmI guess there's no choice but to measure (or estimate) the maximum force.I think it should be pretty linear with ESC input value. If the ESC is controlling the motor with PWM (yes?) then the output power should be quite linear until you get near maximum motor speed -- which might never happen, if the prop is big enough.You don't know what RPM you'll get at each ESC setting -- but you know the power. The RPM acheived at a given power will vary depending on the airspeed. The RPM will depend on the drag, which if the rotor tip speed is high compared to the vertical speed will be quite linear with the lift achieved.

author: Ian.M
author_rank: Super Contributor
timestamp: March 30, 2017, 08:42:42 pm
content: If you assume that lag in the ESC response + the moment of inertia of the propeller and motor are dominant and that aerodynamic effects have a negligible impact on the response speed, then simply measuring the RPM while doing the brick on scales test will let you plot thrust against RPM. You then do the step response test, measuring RPM, not thrust.A more difficult parameter to measure will be prop torque, but you desperately need it to be able to model the yaw response.Modern ESCs tend to be smart with programmable response curves and even learning modes, so unless you are running an open source one, don't assume anything about its response.

author: Mr. Scram
author_rank: Super Contributor
timestamp: March 30, 2017, 08:54:47 pm
content: Quote from: Ian.M on March 30, 2017, 08:42:42 pmI doubt that would be a correct assumption.

author: metrologist
author_rank: Super Contributor
timestamp: March 30, 2017, 08:55:02 pm
content: eCalc. Has so many parameters to enter and likely will give you what you're looking for.https://www.ecalc.ch/