Skip to content

# Class evam::KickDecor

template <class Motor, unsigned short kDefaultKickDuration, signed short kDefaultKickPower>

ClassList > evam > KickDecor

Decorator that applies a momentary kick to overcome static friction. More...

- `#include <evamKickDecor.h>`

Inherits the following classes: Tickable, Motor

## Public Functions

Type | Name
--- | ---
unsigned short | GetKickDuration () const Get kick pulse duration.
signed short | GetKickPower () const Get kick power.
void | Go (signed short aValue) Apply the control value with kick-start pulse.
void | SetKickDuration (unsigned short aDuration) Set kick pulse duration.
void | SetKickPower (signed short aPower) Set kick power.
void | SetupKickstart (unsigned short aKickDuration, signed short aKickPower) Configure kickstart parameters at once.

## Detailed Description

When starting from stop or changing direction, a power pulse is applied for a short duration to overcome inertia and static friction.

Template parameters:

- `Motor` Base motor class (must implement Go(signed short))
- `kDefaultKickDuration` Default kick pulse duration in milliseconds. Default: 20ms.
- `kDefaultKickPower` Default kick power. Range: -1000..1000. Default: 1000 (full power).

## Public Functions Documentation

### function GetKickDuration

Get kick pulse duration.

    inline unsigned short evam::KickDecor::GetKickDuration () const

Returns:

Kick duration in milliseconds.

### function GetKickPower

Get kick power.

    inline signed short evam::KickDecor::GetKickPower () const

Returns:

Kick power value in range -1000..1000.

### function Go

Apply the control value with kick-start pulse.

    inline void evam::KickDecor::Go (
        signed short aValue
    )

Parameters:

- `aValue` Desired control value, range -1000..1000.

### function SetKickDuration

Set kick pulse duration.

    inline void evam::KickDecor::SetKickDuration (
        unsigned short aDuration
    )

Parameters:

- `aDuration` Duration in milliseconds, must be > 0.

### function SetKickPower

Set kick power.

    inline void evam::KickDecor::SetKickPower (
        signed short aPower
    )

Parameters:

- `aPower` Power value, clamped to -1000..1000.

### function SetupKickstart

Configure kickstart parameters at once.

    inline void evam::KickDecor::SetupKickstart (
        unsigned short aKickDuration,
        signed short aKickPower
    )

Parameters:

- `aKickDuration` Kick pulse duration in milliseconds
- `aKickPower` Kick power, range -1000..1000

The documentation for this class was generated from the following file `src/evamKickDecor.h`