remove trim function, add PII controller

the trim function causes instability , it should be re designed and put
in the desk top app.  Add add the difference equation for a PII
controller but need debuging