Speed Control#

Toolbox for a standard SpeedControl with a PI-Controller in parallel form. It outputs only the reference torque for a subsequent setpoint and current-control module. It can not control a machine on its own.

Setup#

typedef struct uz_SpeedControl_t uz_SpeedControl_t#

Object definition for uz_SpeedControl_t.

Configuration#

struct uz_SpeedControl_config#

Configuration struct for SpeedControl. Accessible by the user.

Public Members

struct uz_PI_Controller_config config_controller#

Configuration struct for speed-Controller

In order to configure the SpeedControl check the configuration section of the PI-Controller for further information.

Example#

Listing 151 Example function call for configuration#
 1#include "uz/uz_SpeedControl/uz_speedcontrol.h"
 2int main(void) {
 3   struct uz_SpeedControl_config SC_config = {
 4      .config_controller.Kp = 10.0f,
 5      .config_controller.Ki = 10.0f,
 6      .config_controller.samplingTime_sec = 0.00005f,
 7      .config_controller.upper_limit = 10.0f,
 8      .config_controller.lower_limit = -10.0f,
 9   };
10}

Init function#

uz_SpeedControl_t *uz_SpeedControl_init(struct uz_SpeedControl_config config)#

Initialization of the SpeedController object.

Parameters:
  • config – uz_SpeedControl_config configuration struct

Returns:

Pointer to uz_SpeedControl_t object

Example#

Listing 152 Example function call to init the SpeedController for the SpeedControl. config according to configuration section#
1int main(void) {
2   uz_SpeedControl_t* SC_instance = uz_SpeedControl_init(SC_config);
3}

Description#

Allocates the memory for the SpeedControl instance. Furthermore the input values of the configuration struct are asserted.

Reset#

void uz_SpeedControl_reset(uz_SpeedControl_t *self)#

Resets the PI-Controller inside the uz_SpeedControl_t.

Parameters:
  • self – pointer to uz_SpeedControl_t object

Example#

Listing 153 Example function call to reset the SpeedControl. SpeedControl instance via init-function.#
1int main(void) {
2   uz_SpeedControl_reset(SC_instance);
3}

Description#

Resets the PI-Controller of the SpeedControl. The initial condition for the integrator after the reset is 0.0f.

Functions#