### Re: "Peak Efficiency" Control Mode?

Posted:

**14 Oct 2017, 09:38**Throttle Response Update:

In theory this update to the code improves the dynamic throttle response produced by the algorithm at times when full throttle would result in the motor amp limit setting or duty cycle limit setting being reached.

Where:

M= 100 = Throttle % Setting

K= 90 = Desired Efficiency % Setting

L= 500 = Desired Min Watts Available Setting

P= 4500 = Desired Max Watts Available Setting

G= 48.2 = Battery Voltage

D= 16.94 = Back EMF Voltage

F= 0.025 = Winding Resistance Ohms

Y= 120 = Max Motor Amps

Z= 95 = Max Duty Cycle %

N= XX.XXXw = Desired Full Throttle Wattage

C= XX.XXX% = Duty Cycle

N=L

&

if D>((sqrt(F)*K*sqrt(L))/(10*sqrt(100-K))) then N=(-1)*((100*(D^2)*(K-100))/(F*(K^2)))

&

if N>P then N=P

&

if Y<((sqrt((D^2)+(4*F*N))-D)/(2*F)) then N=Y*(D+(F*Y))

&

if Z<((50*(sqrt((D^2)+(4*F*N))+D))/G) then N=(G*Z*(G*Z-(100*D)))/(10000*F)

&

C=10*((sqrt((25*(D^2))+(F*M*N))/G)+((5*D)/G))

&

repeat

Therefore:

M= 100% = Throttle % Setting

K= 90% = Desired Efficiency % Setting

L= 500w = Desired Min Watts Available Setting

P= 4500w = Desired Max Watts Available Setting

G= 48.2v = Battery Voltage

D= 16.94v = Back EMF Voltage

F= 0.025ohm = Winding Resistance Ohms

Y= 120a = Max Motor Amps

Z= 95% = Max Duty Cycle %

N= 1417.10w = Desired Full Throttle Wattage

C= 39.049% = Duty Cycle

——————————

Explanation:

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

&

repeat

—————————

Conclusion

In theory this code improves the dynamic throttle response when full throttle will result in reaching the motor amp limit or the duty cycle limit. With the last version, 100% throttle position was defined to supply the wattage necessary to achieve the desired efficiency setting, but if %100 throttle (desired efficiency wattage) resulted in reaching the motor amp limit or duty cycle limit, then all throttle positions that would result in exceeding duty cycle limit or motor amp limit would result in the same amount of power to the motor (to stay under the limits) leading to reduction in dynamic throttle response at the higher end of the throttle range when the duty cycle/motor amp limits could potentially be exceeded. This update in theory fixes and ensures a fully dynamic throttle response by always mapping “100% throttle” to the desired efficiency unless it results in exceeding motor amp/duty cycle limit, in which case 100% throttle would then correspond to the wattage required to stay under both limits, and % throttle would correspond to a % of this under-the-limits-wattage.

In theory this update to the code improves the dynamic throttle response produced by the algorithm at times when full throttle would result in the motor amp limit setting or duty cycle limit setting being reached.

Where:

M= 100 = Throttle % Setting

K= 90 = Desired Efficiency % Setting

L= 500 = Desired Min Watts Available Setting

P= 4500 = Desired Max Watts Available Setting

G= 48.2 = Battery Voltage

D= 16.94 = Back EMF Voltage

F= 0.025 = Winding Resistance Ohms

Y= 120 = Max Motor Amps

Z= 95 = Max Duty Cycle %

N= XX.XXXw = Desired Full Throttle Wattage

C= XX.XXX% = Duty Cycle

N=L

&

if D>((sqrt(F)*K*sqrt(L))/(10*sqrt(100-K))) then N=(-1)*((100*(D^2)*(K-100))/(F*(K^2)))

&

if N>P then N=P

&

if Y<((sqrt((D^2)+(4*F*N))-D)/(2*F)) then N=Y*(D+(F*Y))

&

if Z<((50*(sqrt((D^2)+(4*F*N))+D))/G) then N=(G*Z*(G*Z-(100*D)))/(10000*F)

&

C=10*((sqrt((25*(D^2))+(F*M*N))/G)+((5*D)/G))

&

repeat

Therefore:

M= 100% = Throttle % Setting

K= 90% = Desired Efficiency % Setting

L= 500w = Desired Min Watts Available Setting

P= 4500w = Desired Max Watts Available Setting

G= 48.2v = Battery Voltage

D= 16.94v = Back EMF Voltage

F= 0.025ohm = Winding Resistance Ohms

Y= 120a = Max Motor Amps

Z= 95% = Max Duty Cycle %

N= 1417.10w = Desired Full Throttle Wattage

C= 39.049% = Duty Cycle

——————————

Explanation:

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

&

repeat

—————————

Conclusion

In theory this code improves the dynamic throttle response when full throttle will result in reaching the motor amp limit or the duty cycle limit. With the last version, 100% throttle position was defined to supply the wattage necessary to achieve the desired efficiency setting, but if %100 throttle (desired efficiency wattage) resulted in reaching the motor amp limit or duty cycle limit, then all throttle positions that would result in exceeding duty cycle limit or motor amp limit would result in the same amount of power to the motor (to stay under the limits) leading to reduction in dynamic throttle response at the higher end of the throttle range when the duty cycle/motor amp limits could potentially be exceeded. This update in theory fixes and ensures a fully dynamic throttle response by always mapping “100% throttle” to the desired efficiency unless it results in exceeding motor amp/duty cycle limit, in which case 100% throttle would then correspond to the wattage required to stay under both limits, and % throttle would correspond to a % of this under-the-limits-wattage.