Hello,
I was wondering how possible it would be to implement a new control mode for VESC based ESCs which automates the process necessary for achieving the greatest possible electrical to mechanical conversion efficiency during acceleration of electric vehicles?
I have written some code which in theory can automate the process of improving efficiency by modulating the motor current command during acceleration, and I'd like to see it implemented in the firmware and freely available for all to use. Unfortunately I've never delved into modifying the actual VESC firmware, so any outside help in implementing this would be greatly appreciated.
-Devin
-------------------------
Background
In an electric vehicle, only one value of motor current will achieve a particular constant speed for a given load or set of road conditions (affected by grade, wind, rider weight, etc).
By contrast during the acceleration of electric vehicles, one can choose how much motor current to use, with more current generally resulting in more torque, faster acceleration, more heat produced (via copper loss and other mechanisms) in the motor, and lower efficiency.
Due to the relationship between torque and copper losses as a function of motor current, it is possible to achieve a "targeted electrical to mechanical conversion efficiency" during acceleration by modulating the motor current to achieve a targeted efficiency.
Generally speaking, lower acceleration results in greater efficiency. By extension, in order to achieve the greatest possible efficiency during acceleration, it is necessary to use the lowest possible motor current that still results in acceleration.
I have produced a chart comparing the efficiency during full throttle acceleration of 2 electric skateboards with identical hardware but different control modes-- one with "efficiency control" and one with standard "current control." Both boards have (2) 120kv hub motors, 50v battery, 0.07ohm winding lead-to-lead, 120mm tire diameter, 100% throttle, 52a motor current limit, 52a battery current limit per motor. The "efficiency control" board also has a 88% desired efficiency setting, 250w minimum electrical watt setting & 2600w maximum electrical watt setting.
The automatic improvement in efficiency during the acceleration of the board with efficiency control is seen in the blue line, bottom middle chart -- electrical to mechanical conversion efficiency bldc.
I will share the actual software code for BLDC & FOC in the following post.
Here is the code for BLDC efficiency control... i'll post the FOC version in my next post.
Please note there are presently 2 throttle variations of BLDC efficiency control - watt control throttle & motor current control throttle (both variations here).
------------------------------
BLDC Efficiency Control
Watt Control Throttle Variation
Control Loop Targets
Settings:
M= 100 = Throttle % Setting
K= 90 = Desired Efficiency % Setting
L= 500 = Desired Min Watts Available Setting
P= 4500 = Desired Max Watts Available Setting
Y= 120 = Max Motor Amps BLDC
Z= 95 = Max Duty Cycle %
Observables:
G= 48.2 = Battery Voltage
D= 16.94 = Back EMF Voltage
F= 0.025 = Winding Resistance Ohms (Lead to Lead)
Control Loop Targets:
A= XX.XXX = Battery Amps
B= XX.XXX = Motor Amps (BLDC)
H= XX.XXX = Throttled Wattage
N= XX.XXX = Desired Full Throttle Wattage
C= XX.XXX = Duty Cycle %
E= XX.XXX = Effective PWM Voltage
N=L
^this line sets the desired full throttle wattage at the minimum desired wattage value
&
if D>((sqrt(F)*K*sqrt(L))/(10*sqrt(100-K))) then N=(-1)*((100*(D^2)*(K-100))/(F*(K^2)))
^this line calculates whether there is enough back emf voltage present to allow the desired minimum full throttle wattage at or above the desired efficiency, and if there is, it adjusts the desired full throttle wattage to the value which achieves the desired electrical to mechanical conversion efficiency at the present rpm
&
if N>P then N=P
^this line adjusts the desired full throttle wattage to the maximum desired wattage setting if the wattage at desired efficiency exceeds the desired max wattage setting
&
if Y<((sqrt((D^2)+(4*F*N))-D)/(2*F)) then N=Y*(D+(F*Y))
^this line calculates whether the desired full throttle wattage exceeds the max motor amp setting, and if it does, it adjusts the desired full throttle wattage to a value which does not exceed the max motor amp setting
&
if Z<((50*(sqrt((D^2)+(4*F*N))+D))/G) then N=(G*Z*(G*Z-(100*D)))/(10000*F)
^this line calculates whether the desired full throttle wattage exceeds the max duty cycle setting, and if it does, it adjusts the desired full throttle wattage to a value which does not exceed the max duty cycle setting
&
C=10*((sqrt((25*(D^2))+(F*M*N))/G)+((5*D)/G))
^this line calculates the duty cycle control value based on the final desired full throttle wattage value, throttle position, back emf voltage value, winding resistance, and pack voltage
&
E=G*(C/100)
^ calculates effective PWM voltage
&
B=(E-D)/F
^calculates motor current
&
H=B*E
^calcualtes throttled wattage
&
A=H/G
^calculates battery amps
&
repeat
Therefore:
Instantaneous Control Loop Targets:
A= 29.400 = Battery Amps
B= 75.264 = Motor Amps (BLDC)
H= 1417.10 = Throttled Wattage
N= 1417.10 = Desired Full Throttle Wattage
C= 39.049 = Duty Cycle %
E= 18.821618 = PWM Effective Voltage
------------------------------
BLDC Efficiency Control
Motor Current Control Throttle Variation
Control Loop Targets
Settings:
M= 100 = Throttle % Setting
K= 90 = Desired Efficiency % Setting
L= 500 = Desired Min Watts Available Setting
P= 4500 = Desired Max Watts Available Setting
Y= 120 = Max Motor Amps BLDC
Z= 95 = Max Duty Cycle %
Observables:
G= 48.2 = Battery Voltage
D= 16.94 = Back EMF Voltage
F= 0.025 = Winding Resistance Ohms (Lead to Lead)
Control Loop Targets:
A= XX.XXX = Battery Amps
B= XX.XXX = Motor Amps (BLDC)
H= XX.XXX = Throttled Wattage
N= XX.XXX = Desired Full Throttle Wattage
C= XX.XXX = Duty Cycle %
E= XX.XXX = Effective PWM Voltage
Where:
N=L
^this line sets the desired full throttle wattage at the minimum desired wattage value
&
if D>((sqrt(F)*K*sqrt(L))/(10*sqrt(100-K))) then N=(-1)*((100*(D^2)*(K-100))/(F*(K^2)))
^this line calculates whether there is enough back emf voltage present to allow the desired minimum full throttle wattage at or above the desired efficiency, and if there is, it adjusts the desired full throttle wattage to the value which achieves the desired electrical to mechanical conversion efficiency at the present rpm
&
if N>P then N=P
^this line adjusts the desired full throttle wattage to the maximum desired wattage setting if the wattage at desired efficiency exceeds the desired max wattage setting
&
if Y<((sqrt((D^2)+(4*F*N))-D)/(2*F)) then N=Y*(D+(F*Y))
^this line calculates whether the desired full throttle wattage exceeds the max motor amp setting, and if it does, it adjusts the desired full throttle wattage to a value which does not exceed the max motor amp setting
&
if Z<((50*(sqrt((D^2)+(4*F*N))+D))/G) then N=(G*Z*(G*Z-(100*D)))/(10000*F)
^this line calculates whether the desired full throttle wattage exceeds the max duty cycle setting, and if it does, it adjusts the desired full throttle wattage to a value which does not exceed the max duty cycle setting
&
H=(M*((-1)*D*(M-100)*sqrt((D^2)+4*F*N)+((D^2)*(M-100))+(2*F*M*N)))/(20000*F)
^this line calculates the desired full throttle motor amps, reduces the motor amps by a percentage based on throttle position, and then calculates the resulting desired wattage
&
C=((50*(sqrt((D^2)+(4*F*H))+D))/G)
^this line calculates the duty cycle control variable from the desired wattage, back emf voltage, winding resistance, and pack voltage.
&
E=G*(C/100)
^calulates pwm effective voltage
&
B=(E-D)/F
^calculates motor current
&
A=H/G
^calculates battery amps
&
repeat
Therefore:
Instantaneous Control Loop Targets:
A= 29.400 = Battery Amps
B= 75.264 = Motor Amps (BLDC)
H= 1417.10 = Throttled Wattage
N= 1417.10 = Desired Full Throttle Wattage
C= 39.049 = Duty Cycle %
E= 18.821618 = PWM Effective Voltage
———————-
For Illustration:
classical settings: 100% throttle, 300a battery amp limit, 300a motor amp limit, 33.2v battery, 850kv 0.0135ohm motor, 120mm tire diamter, 4:1 gear reduction, 2 motors
efficiency control settings: 100% throttle, 300a battery amp limit, 300a motor amp limit, 87.5% desired efficiency setting, 200w minimum electrical wattage setting, 9960w maximum electrical wattage setting, 33.2v battery, 850kv 0.0135ohm motor, 120mm tire diamter, 4:1 gear reduction, 2 motors
I found the formula for calculating FOC torque from RMS motor current at the following site:
https://www.motioncontroltips.com/what- ... dc-motors/
T = 1.5 * Kt * M
where M is the RMS motor current per phase command and T is the torque in newton meters.
FOC Efficiency Control
Motor Current Throttle Variation
Settings:
M= 100 = Throttle % Setting
K= 90 = Desired Efficiency % Setting
L= 500 = Desired Minimum Electrical Watts Available Setting
P= 2000 = Desired Maximum Electrical Watts Available Setting
Y= 120 = Max Motor Current & Peak Current Per Phase
Observables:
F= 0.025 = Winding Resistance Ohms (Lead to Lead) = Resistance per Phase Ohms * 2
G= 48.2 = Battery Voltage
U= 1694 = Present RPM
V= 100 = KV
Control Loop Targets:
A= XX.XXXa = Battery Amps
S= XX.XXXa = RMS Current Per Phase
W= XX.XXXa = Peak Phase Current FOC
H= XX.XXXw = Throttled Electrical Wattage
N= XX.XXXw = Full Throttle Electrical Wattage
Control Loop:
N=L
^set full throttle electrical wattage to the minimum available electrical wattage setting
&
S=((-1.5*U)+V*sqrt((6*F*N)+((2.25*U^2)/(V^2))))/(3*V*F)
^set RMS Current Per Phase to the value which achieves the minimum available electrical wattage setting
&
if (100*U)/((V*F*S)+U)>K then S=((100*U)-(K*U))/(K*F*V)
^if a wattage equal to the minimum available electrical wattage setting results in greater efficiency than the desired efficiency setting, set the RMS Current Per Phase to a value which achieves the desired electrical to mechanical % conversion efficiency
&
N=((((U*2*pi)/60)*(S*(60/(2*pi*V))*1.5))+(S^2*((1/2)*F)*3))
^set desired full throttle electrical wattage to a value equivalent to the present RMS Current Per Phase value at the present RPM
&
if N>P then N=P
^if the desired full throttle electrical wattage exceeds the Desired Max Watts Available Setting, set the full throttle wattage to a value which does not exceed the Desired Max Watts Available Setting
&
S=((-1.5*U)+V*sqrt((6*F*N)+((2.25*U^2)/(V^2))))/(3*V*F)
^set RMS Current Per Phase to the value which achieves the present desired full throttle electrical wattage value
&
if S*sqrt(2)>Y then S=Y/sqrt(2)
^if the peak current per phase exceeds the Max Motor Current Setting, set the RMS current per phase to a value which does not exceed the peak motor current setting
&
N=((((U*2*pi)/60)*(S*(60/(2*pi*V))*1.5))+(S^2*((1/2)*F)*3))
^set desired full throttle electrical wattage to a value equivalent to the present Peak Current Per Phase value at the present RPM
&
S=(M/100)*S
^set throttled rms current value to a value equal to a percentage of the full throttle current value, based on the throttle position
&
H=((((U*2*pi)/60)*(S*(60/(2*pi*V))*1.5))+(S^2*((1/2)*F)*3))
^set throttled electrical wattage to a value equivalent to the RMS Current Per Phase value based on the throttle position
&
W=S*sqrt(2)
^set Peak Current Per Phase FOC to a value equal to RMS Current Per Phase times the square root of 2
&
A=((((U*2*pi)/60)*(S*(60/(2*pi*V))*1.5))+(S^2*((1/2)*F)*3))/G
^set battery amp target to a value equal to the throttled electrical wattage divided by the pack voltage
&
repeat
Therefore:
Control Loop Targets:
A= XX.XXXa = Battery Amps
S= XX.XXXa = RMS Current Per Phase
W= XX.XXXa = S*sqrt(2) = Peak Current Per Phase FOC
H= XX.XXXw = Throttled Electrical Wattage
N= XX.XXXw = Desired Full Throttle Electrical Wattage
Maybe I'm missing something but what exactly is the purpose of this control mode other than being an interesting exercise? Seems like a solution in need of a genuine problem. To be fair I didn't read through it all, one of the more long winded posts I've read in a while.
For modifying vesc code I have been using Chibi studio on windows. Just install and begin building, it just works.
Also why bother with rms current? The vesc will be calculating output in terms of Q axis currents before transforming back to three phase so you may as well perform your calculations in the way you will code them.
@district9prawn The goal would be to obtain additional range from a given battery by limiting motor inefficiency during acceleration.
According to my calculations a 30mph-capable electric skateboard rider could automatically obtain approximately 48.25% longer range (about 10 extra miles per kilowatt hour) on flat ground in start and stop traffic in the following scenario...
----------------------------------
Suppose I'm an electric skateboard vendor, and a previous customer asks me what options they have to achieve greatest possible range and efficiency on their electric skateboard when commuting in start and stop city traffic. The customer's route to work features many stop signs and stop lights, so they start and stop very frequently, but they live in a completely flat area and don't expect to encounter any hills. The board we are discussing has a battery which typically runs at 45.98V, (4) 81.42kv hub motors which are 0.136ohms and has 83mm diameter tires. The customer states their only requirements are they want to ensure the board is capable of 30mph top speed on flat ground, and aside from that requirement, they also want highest possible range and electrical to mechanical conversion efficiency while repeatedly accelerating at full throttle during their start-and-stop morning commute. Should I recommend "efficiency control" or the "classical algorithm" to achieve this customer's requirements (at least 30mph top speed on flat ground and greatest possible range & conversion efficiency while repeatedly accelerating at full throttle in start and stop city commuter traffic)?
Stop Sign Separation Distance: 183.5 Meters
Full Throttle Acceleration Distance: 150 Meters
The 30mph-capable rider with “efficiency control” gets 148.25% as much range in start and stop traffic with stop signs placed 183.5 meters apart compared to the 30mph-capable “current control” rider, while both use full throttle acceleration for the first 150 meters of each acceleration cycle, followed by mechanical braking.
Efficiency Control: 51.62 kilometers = 32.07 miles per kilowatt hour
Classical Algorithm: 34.81 kilometers = 21.63 miles per kilowatt hour
30mph-Capable Hardware: (4) 81.42kv hub motors, 0.136ohm, 45.98v battery, 83mm tires, 11a motor current limit
Efficiency Control Settings: 96% Desired Efficiency Setting, 85w Min Wattage Setting, 434w Max Wattage Setting & 11a Motor Amp Limit
-------------------------
Results:
Efficiency Control: 32.07 miles per kilowatt hour
Current Control: 21.63 miles per kilowatt hour
Devin,
one last time....
When you drive an electric scateboard, you can save energy by pushing yourself along instead of hitting the throttle everytime. The same goes for "going fast". You can go faster by pushing the the throttle further, but it is obvious that's going to cost you energy and thus range of your battery.
People riding things (electric skateboards, cars, trucks) EXPECT to be able to trade energy consumption for "speed".
So when your algorithm is better than "full throttle" but gets the person riding that at the destination later than one using the classical control method then that's not fair.
If you want to prove that your algorithm is better, you should compare it against a few other ways of getting at the destination at the same time as the guy using your algorithm.
So with stop signs about 180 m apart and "accelerate to full speed" taking 150m I would expect that I'd accelerate for about 120m, then coast for 40m and then brake for the last 20m. How does my strategy compare to yours? Do I get to the end quicker? Do I use more or less energy than your algorithm? (I expect later and less).
Now, you've said time-and-time-again that your algorithm is better than "full throttle all the way". Ok. But now I'm going to ease off the throttle in just such a way that I arrive at the destination at the same time as your guy. Or what if I add a "coast" phase after getting to speed as fast as possible? Just enough to tie your guy in the race to the next stop-sign?
If you put into play the "full-throttle-to-120m-instead-of-150m strategy" & the comparison stops once a mechanical kWh is obtained from each system-- then I believe there's enough data above to conclude the "efficiency control" algorithm in the end uses less electrical kWh to obtain the same mechanical kWh.
The key distinction here is "automatic" vs "manual." If you were to try to (as you say) "ease off the throttle in just such a way that I arrive at the destination at the same time as your guy" then you're still using the "efficiency control" algorithm-- manually-- by watching the other rider who is using the efficiency algorithm and continually adjusting your thumb throughout each acceleration to match their motor current adjustments.
Day to day in the streets though I think it'd be hard to need to constantly compare my acceleration with a second rider who's using the "efficiency control" algorithm to know whether my thumb is always adjusting to the right position on the throttle to maximize the range -- and unless the algorithm exists in the first place, then there's no one for me to compare my acceleration to -- all the more reason it should be created.
Build it and they will come. Devin you've been touting the superiority of your algorithm for a couple of years now. Has anyone other than you been convinced, let alone attempted to write the VESC app necessary for it to be tested?
At this point it's clear to me you don't even believe in it yourself as you could have learnt programming and have come back with physical test results by now.
Let us do a thought experiement. Given a VESC and a motor configured for a certain max current that may not be exceeded. Suppose your goal is to drain the battery ASAP what would you do?
The optimal strategy to DRAIN the battery is to go full throttle all the way. That makes it the WORST strategy for conserving the battery. Therefore ANY algorithm that differs from "full throttle all the way" will perform better than what you are comparing against.
Ok, suppose there is a package delivery company which uses electric skateboard equipped riders with boards identical to the ones described above (w/ 1 kWh batteries). The delivery company has to deliver similar packages to the same customer on 2 consecutive days, and the customer lives 15 miles from the delivery company's office (30 mile round trip). The delivery company has 2 brand-new employees and 2 delivery skateboards-- the boards are identical except one with current control and one with efficiency control set up as described previously. The route to the customer's location is 15 miles on flat ground through a city with stop signs every 183 meters. Both delivery employees are told their boards have 32 mile range & 30 mph top speed, which is technically true, and both riders want to finish their routes as quickly as possible to impress their new employer and receive a bonus for fastest round-trip. On the first day, employee A uses the efficiency control board to deliver the package (using full throttle almost the entire time, except when braking for stop signs) and returns to the office without incident. On the second day, employee B uses the current control board, also full throttle most of the time, but unfortunately runs out of power after 21 miles, and therefore has to walk at ~3mph for the last 9 miles back to the office (the range employee B was told about is only possible under ideal conditions). Which rider completes the 30 mile round trip in less time? Is it employee B who had to walk the last 9 miles @ 3mph or employee A who was able to complete the entire trip under power with battery to spare?
So Devin are you gonna try and write the app? Or just sit in your argument booth?
I think I found a slightly more elegant formula for the FOC efficiency control, when calculating the electrical wattage from RPM, RMS current, KV & Resistance
N=((((U*2*pi)/60)*(S*(60/(2*pi*V))*1.5))+(S^2*((1/2)*F)*3))
can be simplified to:
N=(1.5*((V*F*S^2)+(S*U)))/V
where:
N= XX.XXXw = Full Throttle Electrical Wattage
V= 100 = KV
F= 0.025 = Winding Resistance Ohms (Lead to Lead) = Resistance per Phase Ohms * 2
S= XX.XXXa = RMS Current Per Phase
U= 1694 = Present RPM
I'm not sure whether or not this would reduce the execution times very significantly...
Comparison of FOC vs BLDC conversion efficiency w/ same hardware at 1000rpm constant speed
Assumptions:
100kv, 0.05ohm (2 phase - lead to lead), 50v battery, 1000rpm constant speed, 20a battery limit
---------------------------------
BLDC
1000rpm / 100kv = 10v BEMF
20a battery * 50v battery = 1000w
C=((50*(sqrt((10v bemf^2)+(4*0.05ohm*1000w electrical))+10v bemf))/50v battery)
C = duty % = 27.32050807568877293527
effective v = 13.66025403784438646764 = (C/100) * 50v battery
(13.66025403784438646764v effective - 10v bemf) / 0.05ohm = 73.2050807568877293528a motor current
60/(2*pi*100kv)=0.09549296585513720146133Nm/a
73.2050807568877293528a * 0.09549296585513720146133Nm/a = 6.990570277140041339212Nm
(1000rpm * 2 * pi) / 60 = 104.7197551196597746154rad/sec
104.7197551196597746154rad/sec * 6.990570277140041339212Nm = 732.0508075688772935278w mechanical
73.2050807568877293528a^2 * 0.05ohm = 267.949192431122706473w copper loss
732.0508075688772935278w / 1000w electrical = 73.20508075688772935278% efficiency
---------------------------------------------------
FOC
S=((-1.5*1000RPM)+100KV*sqrt((6*0.05ohm*1000w electrical)+((2.25*1000rpm^2)/(100kv^2))))/(3*100kv*0.05ohm)
S = 52.75252316519466688627a = RMS current per phase
74.60333370961916948537a peak current per phase = 52.75252316519466688627a RMS * sqrt(2)
60/(2*pi*100kv)=0.09549296585513720146133Nm/a
52.75252316519466688627a RMS * 0.09549296585513720146133Nm/a * 1.5 = 7.556242340079402858999Nm
52.75252316519466688627^2*((1/2)*0.05)*3 = 208.712152522079996706w copper loss
(1000rpm * 2 * pi) / 60 = 104.7197551196597746154rad/sec
104.7197551196597746154rad/sec * 7.556242340079402858999Nm = 791.2878474779200032939w mechanical
791.2878474779200032939w + 208.712152522079996706w copper loss = 1000w electrical watts
791.2878474779200032939w / 1000w electrical watts = 79.12878474779200032939% efficiency
-----------------------
Comparison:
79.12% efficiency FOC - 73.20% efficiency BLDC = 5.92
79.12% efficiency FOC / 73.20% efficiency BLDC = 108.0919301360744974377%
7.556242340079402858999Nm FOC / 6.990570277140041339212Nm BLDC = 108.0919301360744974377%
791.2878474779200032939w mechanical FOC / 732.0508075688772935278w mechanical BLDC = 108.0919301360744974377%
------------
Conclusion:
FOC provides 8.09% more torque, 8.09% more mechanical power & 8.09% more efficiency (5.92 additional percentage points of electrical to mechanical conversion efficiency) compared to BLDC w/ 100kv, 0.05ohm lead-to-lead, 50v battery, 20a battery limit @ 1000rpm constant speed
Comparison of FOC vs BLDC w/ same hardware & same 90% conversion efficiency at 1000rpm constant speed
Assumptions:
100kv, 0.05ohm (2 phase - lead to lead), 50v battery, 1000rpm constant speed, desired 90% conversion efficiency
---------------------------------
BLDC
1000rpm / 100kv = 10v BEMF
N=(-1)*((100*(D^2)*(K-100))/(F*(K^2)))
(-1)*((100*(10v BEMF^2)*(90 conversion efficiency %-100))/(0.05ohm*(90 conversion efficiency %^2))) = 246.9135802469135802469w electrical
N = 246.9135802469135802469w electrical
C=((50*(sqrt((D^2)+(4*F*N))+D))/G)
((50*(sqrt((10v bemf^2)+(4*0.05ohm*246.9135802469135802469w electrical))+10v bemf))/50v battery) = 22.22222222222222222222 duty%
C = 22.22222222222222222222 = duty %
effective v = 11.11111111111111111111v = (C/100) * 50v battery
(11.11111111111111111111v effective - 10v bemf) / 0.05ohm = 22.2222222222222222222a motor current
60/(2*pi*100kv)=0.09549296585513720146133Nm/a
22.2222222222222222222a * 0.09549296585513720146133Nm/a = 2.12206590789193781025Nm
(1000rpm * 2 * pi) / 60 = 104.7197551196597746154rad/sec
104.7197551196597746154rad/sec * 2.12206590789193781025Nm = 222.222222222222222222w mechanical
22.2222222222222222222a^2 * 0.05ohm = 24.69135802469135802464w copper loss
222.222222222222222222w mechanical + 24.69135802469135802464w copper loss = 246.9135802469135802469w electrical
222.222222222222222222w mechanical / 246.9135802469135802469w electrical = 90% efficiency
---------------------------------
FOC
S=((100*U)-(K*U))/(K*F*V)
S=((100*1000rpm)-(90 conversion efficiency % * 1000rpm))/(90 conversion efficiency % * 0.05ohm * 100kv)
S= 22.22222222222222222222a RMS current per phase
31.42696805273544552892a peak current per phase = 22.22222222222222222222a RMS * sqrt(2)
N=(1.5*((V*F*S^2)+(S*U)))/V
N=(1.5*((100kv*0.05ohm*22.22222222222222222222a^2)+(22.22222222222222222222a*1000rpm)))/100kv
N = 370.3703703703703703703w electrical
60/(2*pi*100kv)=0.09549296585513720146133Nm/a
22.22222222222222222222a RMS * 0.09549296585513720146133Nm/a * 1.5 = 3.183098861837906715377Nm
22.22222222222222222222a^2*((1/2)*0.05)*3 = 37.03703703703703703703w copper loss
(1000rpm * 2 * pi) / 60 = 104.7197551196597746154rad/sec
104.7197551196597746154rad/sec * 3.183098861837906715377Nm = 333.3333333333333333333w mechanical
333.3333333333333333333w mechanical + 37.03703703703703703703w copper loss = 370.3703703703703703703w electrical watts
333.3333333333333333333w mechanical / 370.3703703703703703703w electrical watts = 90% efficiency
---------------------------------
Comparison:
90% efficiency FOC - 90% efficiency BLDC = 0.00
90% efficiency FOC / 90% efficiency BLDC = 100%
3.183098861837906715377Nm FOC / 2.12206590789193781025Nm BLDC = 150%
333.3333333333333333333w mechanical FOC / 222.222222222222222222w mechanical BLDC = 150%
---------------------------------
Conclusion:
FOC provides 50% more torque & 50% more mechanical power compared to BLDC @ identical 90% conversion efficiency w/ 100kv, 0.05ohm lead-to-lead, 50v battery @ 1000rpm constant speed
I may be a little bit late to the game but this is of great interest to me.
I represent an undergraduate team (duke-ev.org) who builds ultra-efficient vehicles and we've been considering picking apart the vesc firmware to borrow some useful algorithms. I had made some edits to the firmware for a different project and I've gotten familiar enough with the firmware that I could probably get this implemented without too much difficulty. Benjamin has made it such a breeze to edit and flash firmware; I am very grateful.
Aside from the wildly unrealistic operating conditions our vehicle competes in, I do completely understand the appeal of this technique partly because I think about efficiency pretty much every waking moment. I think the big selling point is what you said earlier about how someone riding at partial throttle could theoretically match the acceleration proposed by your algorithm, but a human guessing what acceleration curve will make the optimal efficiency is never going to be as good as an algorithms forming a closed loop control to hit exactly the optimal efficiency. When we run our vehicle for record attempts, for example, we have 2-3 buttons which just apply the exact acceleration curves for optimal efficiency rather than using a thumb throttle.
I don't want to make it sound like our ridiculous use case is the only reason you would use devin's control, though. It's definitely extremely valuable to just make the board run efficiently on its own without the user needing to tweak their thumb at just the right amount. Maybe you could make the argument that you're splitting hairs on efficiency, but I could also make the argument that if you sell 1000 boards and each one runs 10 miles a day and saves 1% efficiency, over the course of a year that amounts to a lot of CO2 and $$$!
I'll do some more research and further consider implementing this into the firmware. In the mean time, devin I may DM you for more theoretical details and I hope more people can see the value that this offers.
Gerry Chen
This is exciting news, please keep us posted. If you need to send me a message I can be reached at: 142491@gmail.com -Devin
I've found an algorithm that's a bit more efficient... https://www.physicsforums.com/threads/canceling-orbital-motion.972943/
In summary one does a 215km/s engine burn to offset the solar system's orbital velocity around the milky way, then the craft plunges (from gravity) towards the Sagittarius A*, the ~4million solar mass super massive black hole close to the barycenter of the milky way, and eventually reaches any arbitrarily high desired speed (up to just below c = light speed).
A Land Based Oberth Maneuver:
https://www.physicsforums.com/threads/land-based-oberth-manuever.974146/
Conclusions
Using the same (202,000,000 J) amount of mechanical impulse energy at the top or bottom of the ramp, impulse at the top of the ramp resulted in 204,080,604.5 J KE at the bottom of the ramp while impulse at the bottom of the ramp resulted in 260,921,883.60 J KE at the bottom of the ramp, which is more than the total mechanical impulse energy.
Even after returning to the surface on a second ramp, the "impulse at bottom vehicle" had more kinetic energy than the total energy in the mechanical impulse, while the "impulse at top vehicle" had less.
The impulse at top vehicle did worse in terms of efficiency than a standard car pushing off the ground after returning to the surface, while the "impulse on bottom" vehicle did better.
---------------------
Vertical Drop Length: 4123.69 meters (29sec @ 1g - 2.56 miles)
Free-fall Velocity at Bottom of Ramp: 284.39 meters per second (636.16 miles per hour)
Water Tank Mass: 10000 kilograms
Passenger Vehicle Mass: 100 kilograms
Mechanical Impulse Energy: 202,000,000 J
-------------------
Impulse on Top (202,000,000 J):
m1 = 100kg
m2 = 10000kg
v1 = 2000m/s
v2 = 20m/s
m1v1 = m2v2
v2 = (m1v1)/m2
v2 = (100kg*2000m/s)/10000kg
v2 = 20m/s
m1 KE = (1/2)mv^2
m1 KE = (1/2)100kg*2000m/s^2
m1 KE = 200,000,000 J
m2 KE = (1/2)mv^2
m2 KE = (1/2)10000kg*20m/s^2
m2 KE = 2,000,000 J
m1 KE + m2 KE = 200,000,000 J + 2,000,000 J = 202,000,000 J = Mechanical Impulse Energy
Covering 4123.69 meters with initial 2000 meters per second velocity and 1 g acceleration takes 2.07 seconds.
2.07 seconds with 1 g acceleration is a velocity change of 20.3 meters per second
m1 velocity at ramp bottom with impulse on top: 2020.3m/s = 2000m/s + 20.3m/s
m1 KE (bottom of ramp, impulse on top) = (1/2)mv^2
m1 KE (bottom of ramp, impulse on top) = (1/2)100kg*2020.3m/s^2
m1 KE (bottom of ramp, impulse on top) = 204,080,604.5 J
-------------------
Impulse on Bottom (202,000,000 J):
Free-fall Velocity at Bottom of Ramp: 284.39 meters per second (636.16 miles per hour)
m1 = 100kg
m2 = 10000kg
v1 = 2000m/s
v2 = 20m/s
m1v1 = m2v2
v1 = (m2v2)/m1
v1 = (10000kg*20m/s)/100kg
v1 = 2000m/s
V1's actual velocity is 2000m/s + the 284.39 freefall velocity at the bottom of the ramp:
2000m/s + 284.39m/s = 2284.39m/s
m1 KE (bottom of ramp, impulse on bottom) = (1/2)mv^2
m1 KE (bottom of ramp, impulse on bottom) = (1/2)100kg*2284.39m/s^2
m1 KE (bottom of ramp, impulse on bottom) = 260,921,883.60 J
--------------------
Conclusions:
Max Velocity with no ramp: 2000m/s (4473.87mph @ ground)
Energy with 202,000,000 J Impulse on top: 200,000,000 J <----
Max Velocity "Standard Car" pushing off ground: 2009.97m/s (4496.19mph @ ground)
Energy with 202,000,000 J Impulse on top: 202,000,000 J <----
Max Velocity with impulse on top of ramp: 2020.3m/s (4519.28mph @ bottom)
Energy with 202,000,000 J Impulse on top: 204,080,604.5 J
Ground Level Exit Velocity with impulse on top of ramp: 2000.18m/s (4474.28mph @ ground)
Exit Energy with 202,000,000 J impulse on top of ramp: 200,036,002 J <----
Max Velocity with impulse at bottom of ramp: 2284.39m/s (5110.03mph @ bottom)
Energy with 202,000,000 J Impulse on bottom: 260,921,883.60 J
Ground Level Exit Velocity with impulse at bottom of ramp: 2266.64m/s (5070.33mph @ ground)
Exit Energy with 202,000,000 J impulse on bottom of ramp: 256,882,844 J <----
^
Even after returning to the surface on a second ramp, the "impulse at bottom vehicle" had more kinetic energy than the total energy in the mechanical impulse, while the "impulse at top vehicle" had less.
The impulse at top vehicle did worse in terms of efficiency than a standard car pushing off the ground after returning to the surface, while the "impulse on bottom" vehicle did better.