A controller for controlling braking of a wheel of a vehicle, the controller comprising: a first connection to a friction brake; a second connection to a motor/generator configured to drive the wheel in a driving mode and to brake the wheel in a regenerative braking mode; a third connection to a plurality of sensors sensing operating parameters of the vehicle; and a fuzzy logic module configured to determine a stability of the vehicle and the wheel based on data from the plurality of sensors and to allocate braking force between the friction brake and the motor/generator operating in the regenerative braking mode based on the stability of the vehicle and the wheel; characterized in that the controller determines a ratio of regenerative braking to the friction braking based on Y 1 = γ * MIN X 1 X 2 + 1 − γ * X 1 + X 2 / 2 Y 2 = γ * MIN Y 1 X 3 + 1 − γ * Y 1 + X 3 / 2 Y 3 = γ * MIN Y 2 X 4 + 1 − γ * Y 2 + X 4 / 2 where γ = fuzzy based weighting factor based on a speed of the vehicle, X 1 is an output of a first fuzzy logic operation based on an acceleration/deceleration of the wheel, X 2 is an output of a second fuzzy logic operation based on a jerk of the wheel, X 3 is an output of a third fuzzy logic operation based on a slip of the wheel, X 4 is an output of a fourth fuzzy logic operation based on a lateral acceleration of the vehicle, X 5 is an output of a fifth fuzzy logic operation based on a yaw rate of the vehicle, and the ratio of regenerative braking = γ * MIN Y 3 X 5 + 1 − γ * Y 3 + X 5 / 2. a first connection to a friction brake; a second connection to a motor/generator configured to drive the wheel in a driving mode and to brake the wheel in a regenerative braking mode; a third connection to a plurality of sensors sensing operating parameters of the vehicle; and a fuzzy logic module configured to determine a stability of the vehicle and the wheel based on data from the plurality of sensors and to allocate braking force between the friction brake and the motor/generator operating in the regenerative braking mode based on the stability of the vehicle and the wheel; characterized in that the controller determines a ratio of regenerative braking to the friction braking based on Y 1 = γ * MIN X 1 X 2 + 1 − γ * X 1 + X 2 / 2 Y 2 = γ * MIN Y 1 X 3 + 1 − γ * Y 1 + X 3 / 2 Y 3 = γ * MIN Y 2 X 4 + 1 − γ * Y 2 + X 4 / 2 where γ = fuzzy based weighting factor based on a speed of the vehicle, X 1 is an output of a first fuzzy logic operation based on an acceleration/deceleration of the wheel, X 2 is an output of a second fuzzy logic operation based on a jerk of the wheel, X 3 is an output of a third fuzzy logic operation based on a slip of the wheel, X 4 is an output of a fourth fuzzy logic operation based on a lateral acceleration of the vehicle, X 5 is an output of a fifth fuzzy logic operation based on a yaw rate of the vehicle, and the ratio of regenerative braking = γ * MIN Y 3 X 5 + 1 − γ * Y 3 + X 5 / 2. γ = fuzzy based weighting factor based on a speed of the vehicle, X 1 is an output of a first fuzzy logic operation based on an acceleration/deceleration of the wheel, X 2 is an output of a second fuzzy logic operation based on a jerk of the wheel, X 3 is an output of a third fuzzy logic operation based on a slip of the wheel, X 4 is an output of a fourth fuzzy logic operation based on a lateral acceleration of the vehicle, X 5 is an output of a fifth fuzzy logic operation based on a yaw rate of the vehicle, and the ratio of regenerative braking = γ * MIN Y 3 X 5 + 1 − γ * Y 3 + X 5 / 2.