Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
User Servo
#1
From a user servo how can I execute a standard servo algorithm like Sys.ServoCtrl ?

Is it as simple as

double (*servo)(struct MotorData *Mptr);
double myServoOut;

servo = pshm->ServoCtrl;
myServoOut = servo(Mptr);
Reply
#2
Even simpler

double user_pid_ctrl(MotorData *Mptr)
{
// Your custom super duper filter probable more than incrementing a P variable
pshm->P[100] += 1.0;
// The default servo algo.
return pshm->ServoCtrl(Mptr);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)