RobotC subroutine to compute Vex 269 motor currents

I have written a subroutine that implements the excel H bridge model equations in robotC.   I have not checked the computational time of the routine but it should be ok.  The program can be down loaded from here.  The program uses the exp() and log() features of RobotC.   It is a function that has a prototype like this:

float current_calc_269( float rpm, float cmd ,float v_battery) {

//subroutine written by Vamfun…Mentor Vex 1508, 599.

//7.13.2012… blog info

//Vex motor 269 assumed

// inputs:  rpm, motor speed in rpm  Note:***Program assumes that with positive command, rpm is positive.***

//          cmd, motor command [127 ,-127]

//          v_battery, average battery voltage >0

// Output:  i_bar ,average motor current per PWM cycle in amps




Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: