aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/Control/PIDAlgo.h
blob: 4792be9ecd32f739ce674fc1c0744a0ddf51993c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#ifndef MODULES_PIDALGO_H_
#define MODULES_PIDALGO_H_
#include <stdint.h>

typedef struct
{
    float epsilon;
    float dt;
    float MAX;
    float MIN;
    float Kp;
    float Kd;
    float Ki;
    float IntegralErrorMultiplier;
    float ProportionalErrorMultiplier;

}PID_Config_Params;
float PIDAlgorithmCalculation(float _setPoint,float _mesuredParam , PID_Config_Params *params, float *_pre_error, float *_integral);
float AdvancedPIDAlgorithmCalculation(float _setPoint,float _mesuredParam , PID_Config_Params *params, float *_pre_error, float *_integral);

#endif /* MODULES_PIDALGO_H_ */
SpeechProvider" /> public class DefaultSpeechProvider : ExtendedObject, ISpeechProvider { private SpeechSynthesizer _speech; private SoundPlayer _soundPlayer; private SoundPlayer _soundPlayerErr; private bool _mute; /// <summary> /// Gets or sets a value indicating whether this <see cref="ISpeechProvider" /> is mute. /// </summary> public bool Mute { get { return _mute; } set { _mute = value; RaisePropertyChangedAuto(); } } /// <summary> /// Initializes a new instance of the <see cref="DefaultSpeechProvider"/> class. /// </summary> public DefaultSpeechProvider() { _speech = new SpeechSynthesizer(); _soundPlayer = new SoundPlayer(EmbeddedResourceHelper.GetEmbeddedResourceStream("Tango.MachineStudio.Common.bip.wav")); _soundPlayerErr = new SoundPlayer(EmbeddedResourceHelper.GetEmbeddedResourceStream("Tango.MachineStudio.Common.error.wav")); _speech.SelectVoice(_speech.GetInstalledVoices().LastOrDefault(x => x.VoiceInfo.Gender == VoiceGender.Female).VoiceInfo.Name); } /// <summary> /// Speaks the specified text associated with an information sound. /// </summary> /// <param name="text">The text.</param> public void SpeakInfo(string text) { if (!Mute) { _soundPlayer.Play(); _speech.SpeakAsync(text); } } /// <summary> /// Speaks the specified text associated with an error sound. /// </summary> /// <param name="text">The text.</param> public void SpeakError(string text) { if (!Mute) { _soundPlayerErr.Play(); _speech.SpeakAsync(text); } } } }