ETrobocon2017 - 片山研究所モデルベース開発推進事業部
公開メンバ関数 | 公開変数類 | 限定公開メンバ関数 | 全メンバ一覧
SpeedControl クラス

PID制御による速度制御クラス [詳解]

#include "SpeedControl.h"

SpeedControl の継承関係図
Inheritance graph
SpeedControl 連携図
Collaboration graph

公開メンバ関数

 SpeedControl ()
 
std::int32_t calculateSpeedForPid (std::int32_t curAngleL, std::int32_t curAngleR)
 
std::int16_t getSpeed100ms ()
 
- 基底クラス Pid に属する継承公開メンバ関数
 Pid (double p_gain, double i_gain, double d_gain, double target)
 
void setPid (double _p_gain, double _i_gain, double _d_gain, double _target)
 
void wrapper_of_constructor (double _p_gain, double _i_gain, double _d_gain, double _diff, double _integral, double _target, double _output)
 

公開変数類

std::int16_t speed_value_all
 

限定公開メンバ関数

std::int8_t calcDistance4ms (std::int32_t curAngleL, std::int32_t curAngleR)
 
- 基底クラス Pid に属する継承限定公開メンバ関数
void calculate (double light_value)
 
double get_output ()
 
double limitOutput (double pid_value)
 

詳解

PID制御による速度制御クラス

このクラスはPidクラスを継承しています。

SpeedControl.h18 行目に定義があります。

構築子と解体子

◆ SpeedControl()

SpeedControl::SpeedControl ( )

コンストラクタ

SpeedControl.cpp9 行目に定義があります。

関数詳解

◆ calcDistance4ms()

std::int8_t SpeedControl::calcDistance4ms ( std::int32_t  curAngleL,
std::int32_t  curAngleR 
)
protected

4ms間の移動距離を取得する

引数
curAngleL左モータ回転角
curAngleR右モータ回転角
戻り値
進んだ距離[mm/4ms]

SpeedControl.cpp34 行目に定義があります。

被呼び出し関係図:

◆ calculateSpeedForPid()

std::int32_t SpeedControl::calculateSpeedForPid ( std::int32_t  curAngleL,
std::int32_t  curAngleR 
)

速度制御をするための前進値(forward)を計算する

引数
curAngleL左モータ回転角
curAngleR右モータ回転角
戻り値
forward 前進値

SpeedControl.cpp20 行目に定義があります。

呼び出し関係図:
被呼び出し関係図:

◆ getSpeed100ms()

std::int16_t SpeedControl::getSpeed100ms ( )

SpeedControl.cpp52 行目に定義があります。

被呼び出し関係図:

メンバ詳解

◆ speed_value_all

std::int16_t SpeedControl::speed_value_all

0.1sで進んだ距離[mm/0.1s]

SpeedControl.h31 行目に定義があります。


このクラス詳解は次のファイルから抽出されました: