Thanks very much for getting back with me Juan. Your response was very insightful. I had originally decided on using a Mamdani controller and was in the middle of writing the rules. But you prompted me to read up on the Takagi-Sugeno controller some more. Let me do some more research and get back with you on that. I may even post my pseudocode here if I feel like it would be useful to other people. Again, thanks vey much.