Documentation ¶
Index ¶
- type PiServo
- func (s *PiServo) GetState() State
- func (s *PiServo) InitLastFreq(freq float64)
- func (s *PiServo) IsSpike(offset int64) bool
- func (s *PiServo) MeanFreq() float64
- func (s *PiServo) Sample(offset int64, localTs uint64) (float64, State)
- func (s *PiServo) SetLastFreq(freq float64)
- func (s *PiServo) SetMaxFreq(freq float64)
- func (s *PiServo) SyncInterval(interval float64)
- type PiServoCfg
- type PiServoFilter
- type PiServoFilterCfg
- type PiServoFilterSample
- type Servo
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PiServo ¶
type PiServo struct { Servo // contains filtered or unexported fields }
PiServo is an integral servo
func NewPiServo ¶
func NewPiServo(s Servo, cfg *PiServoCfg, freq float64) *PiServo
NewPiServo to create servo structure
func (*PiServo) InitLastFreq ¶
InitLastFreq function to reset last freq and drift
func (*PiServo) SetLastFreq ¶
SetLastFreq function to set last freq
func (*PiServo) SetMaxFreq ¶
SetMaxFreq is to adjust frequency range supported by PHC
func (*PiServo) SyncInterval ¶
SyncInterval inform a clock servo about the master's sync interval in seconds
type PiServoCfg ¶
type PiServoCfg struct { PiKp float64 PiKi float64 PiKpScale float64 PiKpExponent float64 PiKpNormMax float64 PiKiScale float64 PiKiExponent float64 PiKiNormMax float64 }
PiServoCfg is an integral servo config
func DefaultPiServoCfg ¶
func DefaultPiServoCfg() *PiServoCfg
DefaultPiServoCfg to create default pi servo config
type PiServoFilter ¶
type PiServoFilter struct {
// contains filtered or unexported fields
}
PiServoFilter is a filter state structure
func NewPiServoFilter ¶
func NewPiServoFilter(s *PiServo, cfg *PiServoFilterCfg) *PiServoFilter
NewPiServoFilter to create new filter instance
func (*PiServoFilter) MeanFreq ¶
func (f *PiServoFilter) MeanFreq() float64
MeanFreq to return best calculated frequency
func (*PiServoFilter) Sample ¶
func (f *PiServoFilter) Sample(s *PiServoFilterSample)
Sample to add a sample to filter and recalculate value
type PiServoFilterCfg ¶
type PiServoFilterCfg struct {
// contains filtered or unexported fields
}
PiServoFilterCfg is a filter configuration
func DefaultPiServoFilterCfg ¶
func DefaultPiServoFilterCfg() *PiServoFilterCfg
DefaultPiServoFilterCfg to create a default pi servo filter config
type PiServoFilterSample ¶
type PiServoFilterSample struct {
// contains filtered or unexported fields
}
PiServoFilterSample is a structure of offset and frequency
type Servo ¶
type Servo struct { StepThreshold int64 FirstStepThreshold int64 FirstUpdate bool OffsetThreshold int64 // contains filtered or unexported fields }
Servo structure has values common for any type of servo
func DefaultServoConfig ¶
func DefaultServoConfig() Servo
DefaultServoConfig generates default servo struct