Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- + hal_float_t *commandvds; /* pin: commanded derivative dummysig */
- + hal_float_t *commandv; /* pin: commanded derivative value */
- + hal_float_t *feedbackvds; /* pin: feedback derivative dummysig */
- + hal_float_t *feedbackv; /* pin: feedback derivative value */
- + /* compute command and feedback derivatives to dummysigs */
- + *(pid->commandvds) = (command - pid->prev_cmd) * periodrecip;
- + *(pid->feedbackvds) = (feedback - pid->prev_fb) * periodrecip;
- + /* and calculate derivative term as difference of derivatives */
- + *(pid->error_d) = *(pid->commandv) - *(pid->feedbackv);
- + retval = hal_pin_float_newf(HAL_IN, &(addr->feedbackv), comp_id,
- + "pid.%d.feedback-deriv", num);
- + if (retval != 0) {
- + return retval;
- + }
- + addr->feedbackvds = addr->feedbackv;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement