View Single Post
Old 10-14-2014, 03:28 PM   #1203 (permalink)
freebeard
Master EcoModder
 
freebeard's Avatar
 
Join Date: Aug 2012
Location: northwest of normal
Posts: 28,501
Thanks: 8,061
Thanked 8,864 Times in 7,317 Posts
Quote:
Note really a quote, but I wanted it indented
vBulletin supports CODE, it just doesn't have a button for it:
Code:
ShouldBeClamped = Kp*error + Ki*sumOfErrors;
if (ShouldBeClamped)>VdClamped /* this is too high, limit 
{
sumOfErrors=(Vbus-(Kp*error))/Ki; /* calculate sumOfErrors
Id = Id - IdLimit; /* change Id so it can ramp up again
/* next time around
}

newVd = Kp*error + Ki*sumOfErrors.
If lines aren't wrapped you get a horizontal scroll bar.
  Reply With Quote
The Following 2 Users Say Thank You to freebeard For This Useful Post:
MPaulHolmes (10-14-2014), thingstodo (10-14-2014)