Documentation
¶
Index ¶
- Constants
- func DefaultAnchorA() []float64
- func DefaultAnchorB() []float64
- func DefaultAnchorC() []float64
- func DefaultForwardMatrix() [][]float64
- func DefaultInverseMatrix() [][]float64
- type Axis
- type BaseKinematics
- type CoreKinematics
- type CurrentMove
- type DeltaKinematics
- type DeltaTower
- type Extruder
- type ExtruderNonLinear
- type HangprinterKinematics
- type Kinematics
- func (k Kinematics) AsBaseKinematics() (*BaseKinematics, error)
- func (k Kinematics) AsCoreKinematics() (*CoreKinematics, error)
- func (k Kinematics) AsDeltaKinematics() (*DeltaKinematics, error)
- func (k Kinematics) AsHangprinterKinematics() (*HangprinterKinematics, error)
- func (k Kinematics) AsScaraKinematics() (*ScaraKinematics, error)
- func (k Kinematics) AsZLeadscrewKinematics() (*ZLeadscrewKinematics, error)
- func (k Kinematics) GetName() KinematicsName
- type KinematicsName
- type Microstepping
- type MotorsIdleControl
- type Move
- type MoveCalibration
- type MoveCompensation
- type MoveCompensationType
- type MoveDeviations
- type MoveInputShaping
- type MoveInputShapingType
- type MoveQueueItem
- type ProbeGrid
- type ScaraKinematics
- type Skew
- type TiltCorrection
- type ZLeadscrewKinematics
Constants ¶
const ( // DefaultAnchorDz for HangprinterKinematics DefaultAnchorDz = 3000.0 // DefaultHangprinterPrintRadius is the default radius for hangprinter DefaultHangprinterPrintRadius = 1500.0 )
const ( // Cartesian kinematics Cartesian KinematicsName = "cartesian" // CoreXY kinematics CoreXY = "coreXY" // CoreXYU is a CoreXY kinematics with extra U axis CoreXYU = "coreXYU" // CoreXYUV is a CoreXY kinematics with extra UV axes CoreXYUV = "coreXYUV" // CoreXZ kinmatics CoreXZ = "coreXZ" // MarkForged kinematics MarkForged = "markForged" // FiveBarScara kinematics FiveBarScara = "FiveBarScara" // Hangprinter kinematics Hangprinter = "Hangprinter" // Delta kinematics Delta = "delta" // Polar kinematics Polar = "Polar" // RotaryDelta kinematics RotaryDelta = "Rotary delta" // Scara kinematics Scara = "Scara" // Unknown kinematics Unknown = "unknown" )
const ( DefaultDamping = 0.2 DefaultFrequency = 40 DefaultMinimumAcceleration = 10 )
const ( MoveInputShapingTypeNone MoveInputShapingType = "none" ZVD = "ZVD" ZVDD = "ZVDD" EI2 = "EI2" DAA = "DAA" )
const ( DefaultJerk = 15.0 DefaultMaxTravel = 200.0 DefaultStepsPerMmAxis = 80.0 )
Default values for Axis
const ( DefaultMaxExtruderSpeed = 100.0 DefaultStepsPerMmExtruder = 420.0 )
Default values for Extruder
Variables ¶
This section is empty.
Functions ¶
func DefaultForwardMatrix ¶
func DefaultForwardMatrix() [][]float64
DefaultForwardMatrix for CoreKinematics
func DefaultInverseMatrix ¶
func DefaultInverseMatrix() [][]float64
DefaultInverseMatrix for CoreKinematics
Types ¶
type Axis ¶
type Axis struct {
// Acceleration of this axis (in mm/s^2)
Acceleration float64 `json:"acceleration"`
// Babystep amount (in mm)
Babystep float64 `json:"babystep"`
// Current of the motor (in mA)
Current int64 `json:"current"`
// Drivers is a list of assigned drivers
Drivers []types.DriverId `json:"drivers"`
// Homed indicates homing status
Homed bool `json:"homed"`
// Jerk of the motor (in mm/s)
Jerk float64 `json:"jerk"`
// Letter assigned to this axis (always upper-case)
Letter string `json:"letter"`
// MachinePosition is the current machine position (in mm or nil if unknown)
MachinePosition *float64 `json:"machinePosition"`
// Max travel of this axis (in mm)
Max float64 `json:"max"`
// MaxProbed is ture if the maximum was probed
MaxProbed bool `json:"maxProbed"`
// Microstepping of this axis
Microstepping Microstepping `json:"microstepping"`
// Min travel of this axis (in mm)
Min float64 `json:"min"`
// MinProbed is true if the minimum was probed
MinProbed bool `json:"minProbed"`
// Speed is the maximum speed (in mm/s)
Speed float64 `json:"speed"`
// StepsPerMm for this axis
StepsPerMm float64 `json:"stepsPerMm"`
// UserPosition (in mm or nil if unknown)
UserPosition *float64 `json:"userPosition"`
// Visible is true if the axis is not explicitely hidden
Visible bool `json:"visible"`
// WorkplaceOffsets for this axis (in mm)
WorkplaceOffsets []float64 `json:"workplaceOffsets"`
}
Axis holds information about a configured axis
type BaseKinematics ¶
type BaseKinematics struct {
// Name of currently configured kinematics
Name KinematicsName `json:"name"`
}
BaseKinematics holds information about the configured kinematics
func (*BaseKinematics) AsKinematics ¶
func (bk *BaseKinematics) AsKinematics() Kinematics
AsKinematics converts this instance to Kinematics type
type CoreKinematics ¶
type CoreKinematics struct {
ZLeadscrewKinematics `mapstructure:",squash"`
// ForwardMatrix is the regular movement matrix
ForwardMatrix [][]float64 `json:"forwardMatrix"`
// InverseMatrix is the inverted movement matrix
InverseMatrix [][]float64 `json:"inverseMatrix"`
}
CoreKinematics holds information about core kinematics
func (*CoreKinematics) AsKinematics ¶
func (ck *CoreKinematics) AsKinematics() (Kinematics, error)
AsKinematics converts this instance to Kinematics type
type CurrentMove ¶
type CurrentMove struct {
// Acceleration of the current move (in mm/s^2)
Acceleration float64 `json:"acceleration"`
// Deceleration of the current move (in mm/s^2)
Deceleration float64 `json:"deceleration"`
// LaserPwm of the current move as 0..1 or nil if not applicable
LaserPwm *float64 `json:"laserPwm"`
// RequestedSpeed of the current move (in mm/s)
RequestedSpeed float64 `json:"requestedSpeed"`
// TopSpeed actually reached for the current move (in mm/s)
TopSpeed float64 `json:"topSpeed"`
}
CurrentMove holds information about the current move
type DeltaKinematics ¶
type DeltaKinematics struct {
BaseKinematics `mapstructure:",squash"`
// DeltaRadius in mm
DeltaRadius float64 `json:"deltaRadius"`
// HomedHeight in mm
HomedHeight float64 `json:"homedHeight"`
// PrintRadius in mm
PrintRadius float64 `json:"printRadius"`
// Towers holds information about the delta Towers
Towers []DeltaTower `json:"towers"`
// XTilt is how much Z needs to be raised for each unit of movement
// in the +X direction
XTilt float64 `json:"xTilt"`
// YTilt is how much Z needs to be raised for each unit of movement
// in the +Y direction
YTilt float64 `json:"yTilt"`
}
DeltaKinematics holds information about delta kinematics
func (*DeltaKinematics) AsKinematics ¶
func (dk *DeltaKinematics) AsKinematics() (Kinematics, error)
AsKinematics converts this instance to Kinematics type
type DeltaTower ¶
type DeltaTower struct {
// AngleCorrection represents tower position correction (in degrees)
AngleCorrection float64 `json:"angleCorrection"`
// Diagonal rod length (in mm)
Diagonal float64 `json:"diagonal"`
// EndstopAdjustment is the deviation of the ideal endstop position (in mm)
EndstopAdjustment float64 `json:"endstopAdjustment"`
// XPos is the X coordinate of this tower (in mm)
XPos float64 `json:"xPos"`
// YPos is the Y coordinate of this tower (in mm)
YPos float64 `json:"yPos"`
}
DeltaTower properties
type Extruder ¶
type Extruder struct {
// Acceleration of this extruder (in mm/s^2)
Acceleration float64 `json:"acceleration"`
// Current of the motor (in mA)
Current int64 `json:"current"`
// Driver is the assigned driver
Driver types.DriverId `json:"driver"`
// Filament is the name fo the currently loaded filament
Filament string `json:"filament"`
// Factor is the extrusion factor (1.0 equals 100%)
Factor float64 `json:"factor"`
// Jerk of the motor (in mm/s)
Jerk float64 `json:"jerk"`
// Microstepping of this extruder
Microstepping Microstepping `json:"microstepping"`
// NonLinear extrusion parameters (see M592)
NonLinear ExtruderNonLinear `json:"nonLinear"`
// Position of the extruder (in mm)
Position float64 `json:"position"`
// PressureAdvance (in s)
PressureAdvance float64 `json:"pressureAdvance"`
// RawPosition is the extruder position without factor applied (in mm)
RawPosition float64 `json:"rawPosition"`
// Speed is the maximum speed (in mm/s)
Speed float64 `json:"speed"`
// StepsPerMm for this extruder
StepsPerMm float64 `json:"stepsPerMm"`
}
Extruder holds information about an extruder drive
type ExtruderNonLinear ¶
type ExtruderNonLinear struct {
// A coefficient in the extrusion formula
A float64 `json:"a"`
// B coefficient in the extrusion formula
B float64 `json:"b"`
// UpperLimit of the nonlinear extrusion compensation
UpperLimit float64 `json:"upperLimit"`
}
ExtruderNonLinear contains non-linear extrusion parameters (see M592)
type HangprinterKinematics ¶
type HangprinterKinematics struct {
BaseKinematics `mapstructure:",squash"`
// AnchorA of the hangprinter
AnchorA []float64 `json:"anchorA"`
// AnchorB of the hangprinter
AnchorB []float64 `json:"anchorB"`
// AnchorC of the hangprinter
AnchorC []float64 `json:"anchorC"`
// AnchorDz of the hangprinter
AnchorDz float64 `json:"anchorDz"`
// PrintRadius in mm
PrintRadius float64 `json:"printRadius"`
}
HangprinterKinematics properties
func (*HangprinterKinematics) AsKinematics ¶
func (hk *HangprinterKinematics) AsKinematics() (Kinematics, error)
AsKinematics converts this instance to Kinematics type
type Kinematics ¶
type Kinematics map[string]interface{}
Kinematics is a placeholder type for SerDe
func (Kinematics) AsBaseKinematics ¶
func (k Kinematics) AsBaseKinematics() (*BaseKinematics, error)
AsBaseKinematics returns this instance as BaseKinematics
func (Kinematics) AsCoreKinematics ¶
func (k Kinematics) AsCoreKinematics() (*CoreKinematics, error)
AsCoreKinematics returns this instance as CoreKinematics
func (Kinematics) AsDeltaKinematics ¶
func (k Kinematics) AsDeltaKinematics() (*DeltaKinematics, error)
AsDeltaKinematics returns this instance as DeltaKinematics
func (Kinematics) AsHangprinterKinematics ¶
func (k Kinematics) AsHangprinterKinematics() (*HangprinterKinematics, error)
AsHangprinterKinematics returns this instance as HangprinterKinematics
func (Kinematics) AsScaraKinematics ¶
func (k Kinematics) AsScaraKinematics() (*ScaraKinematics, error)
AsScaraKinematics returns this instance as ScaraKinematics
func (Kinematics) AsZLeadscrewKinematics ¶
func (k Kinematics) AsZLeadscrewKinematics() (*ZLeadscrewKinematics, error)
AsZLeadscrewKinematics returns this instance as ZLeadscrewKinematics
func (Kinematics) GetName ¶
func (k Kinematics) GetName() KinematicsName
GetName returns the KinematicsName of this Kinematics instance
type KinematicsName ¶
type KinematicsName string
KinematicsName represents the supported kinmatics types
type Microstepping ¶
type Microstepping struct {
// Interpolated indicates if microstep interpolation is in use
Interpolated bool `json:"interpolated"`
// Value is the microstepping factor
Value uint16 `json:"value"`
}
Microstepping holds information about configured microstepping
type MotorsIdleControl ¶
type MotorsIdleControl struct {
// Timeout after which the motor currents are reduced (in s)
Timeout float64 `json:"timeout"`
// Factor of the reduction on a scale between 0 and 1
Factor float64 `json:"factor"`
}
MotorsIdleControl holds idle factor parameters for automatic MotorsIdleControl current reduction
type Move ¶
type Move struct {
// Axes is a list of configured axes
Axes []Axis `json:"axes"`
// Calibration holds information about automatic calibration
Calibration MoveCalibration `json:"calibration"`
// Compensation holds information about the currently configured compensation options
Compensation MoveCompensation `json:"compensation"`
// CurrentMove holds information about the current move
CurrentMove CurrentMove `json:"currentMove"`
// Extruders is a list of configured extrudersr
Extruders []Extruder `json:"extruders"`
// Idle current reduction parameters
Idle MotorsIdleControl `json:"idle"`
// Kinematics holds information about the currently configured kinematics
// Use one of the NewXXKinematics methods to convert it
Kinematics Kinematics `json:"kinematics"`
// PrintingAcceleration is maximum accelertion allowed while printing (in mm/s^2)
PrintingAcceleration float64 `json:"printingAcceleration"`
// Queue is a list of move queue items (DDA rings)
Queue []MoveQueueItem `json:"queue"`
// Shaping are the input shaping parameter
Shaping MoveInputShaping `json:"shaping"`
// SpeedFactor applied to every move (0.01..1 or greater)
SpeedFactor float64 `json:"speedFactor"`
// TravelAcceleration is maximum acceleration allowed while travelling (in mm/s^2)
TravelAcceleration float64 `json:"travelAcceleration"`
// VirtualPos is the virtual total extruder position
VirtualPos float64 `json:"virtualPos"`
// WorkspaceNumber is the index of the currently selected workplace (0..8)
WorkplaceNumber int `json:"workplaceNumber"`
}
Move holds information about the move subsystem
type MoveCalibration ¶
type MoveCalibration struct {
// Final calibration results (for Delta calibration)
Final MoveDeviations `json:"final"`
// Initial calibration resuls (for Delta calibration)
Initial MoveDeviations `json:"initial"`
// NumFactors is the number of factors used (for Delta calibration)
NumFactors int64 `json:"numFactors"`
}
MoveCalibration holds information about configured calibration options
type MoveCompensation ¶
type MoveCompensation struct {
// FadeHeight effective height before the bed compensation is turned off (in mm or nil if not configurea)
FadeHeight *float64 `json:"fadeHeight"`
// File is the full path to the currently used height map file or empty if none is used
File string `json:"file"`
// MeshDeviation are the deviations of the mesh grid of nil if not applicable
MeshDeviation *MoveDeviations `json:"meshDeviation"`
// ProbeGrid holds the settings of the current probe grid
ProbeGrid ProbeGrid `json:"probeGrid"`
// Skew holds information about the configured orthogonal axis parameters
Skew Skew
// Type is the type of compensation in use
Type MoveCompensationType `json:"type"`
}
MoveCompensation holds informatin about the configured compensation options
type MoveCompensationType ¶
type MoveCompensationType string
MoveCompensationType are the supported compensation types
const ( // None for no compensations None MoveCompensationType = "none" // Mesh for mesh compensation Mesh = "mesh" )
type MoveDeviations ¶
type MoveDeviations struct {
// Deviation RMS (in mm)
Deviation float64 `json:"deviation"`
// Mean deviation (in mm)
Mean float64 `json:"mean"`
}
MoveDeviations holds calibration or mesh grid results
type MoveInputShaping ¶
type MoveInputShaping struct {
// Damping factor
Damping float64 `json:"damping"`
// Frequency in Hz
Frequency float64 `json:"frequency"`
// MinimumAcceleration in mm/s
MinimumAcceleration float64 `json:"minimumAcceleration"`
// Type of configured input shaping
Type MoveInputShapingType `json:"type"`
}
MoveInputShaping describes parameters of input shaping
type MoveInputShapingType ¶
type MoveInputShapingType string
MoveInputShapingType are the possible input shaping methods
type MoveQueueItem ¶
type MoveQueueItem struct {
// GracePeriod is the minimum idle time in milliseconds before we should start a move
GracePeriod uint64 `json:"gracePeriod"`
// Length is the maximum number of moves that can be accomodated in the DDA ring
Length int64 `json:"length"`
}
MoveQueueItem is information about a DDA ring
type ProbeGrid ¶
type ProbeGrid struct {
// Axes are the axis letters of this heightmap
Axes []string `json:"axes"`
// Maxs are the end coordinates of the heightmap
Maxs []float64 `json:"maxs"`
// Mins are the start coordinates of the heightmap
Mins []float64 `json:"mins"`
// Radius is the probing radius on delta kinematics
Radius float64 `json:"radius"`
// Spacings between coordinates
Spacings []float64 `json:"spacings"`
}
ProbeGrid holds information about the configured probe grid (see M557)
type ScaraKinematics ¶
type ScaraKinematics ZLeadscrewKinematics
ScaraKinematics is the type for SCARA Kinematics
type Skew ¶
type Skew struct {
// CompensateXY indicates if TanXY value is applied to the X or Y axis value
CompensateXY bool `json:"compensateXY"`
// TanXY is the tangent of the skew angle for XY axes
TanXY float64 `json:"tanXY"`
// TaxXZ is the tangent of the skew angle for XZ axes
TanXZ float64 `json:"tanXZ"`
// TaxYZ is the tangent of the skew angle for YZ axes
TanYZ float64 `json:"tanYZ"`
}
Skew holds details about orthogonal axis compensation parameters
type TiltCorrection ¶
type TiltCorrection struct {
// CorrectionFactor for the compensation
CorrectionFactor float64 `json:"correctionFactor"`
// LastCorrections in mm
LastCorrections []float64 `json:"lastCorrections"`
// MaxCorrection allowed in mm
MaxCorrection float64 `json:"maxCorrection"`
// ScrewPitch of the Z leadscrews in mm
ScrewPitch float64 `json:"screwPitch"`
// ScrewX are the X coordinates of the leadscrews in mm
ScrewX []float64 `json:"screwX"`
// ScrewY are the Y coordinates of the leadscrews in mm
ScrewY []float64 `json:"screwY"`
}
TiltCorrection parameters for Z leadscrew compensation
type ZLeadscrewKinematics ¶
type ZLeadscrewKinematics struct {
BaseKinematics `mapstructure:",squash"`
// TiltCorrection are the parameters describing the tilt correction
TiltCorrection TiltCorrection `json:"tiltCorrection"`
}
ZLeadscrewKinematics is the base kinematics type that provides the ability to level the bed using Z leadscrews
func (*ZLeadscrewKinematics) AsKinematics ¶
func (zk *ZLeadscrewKinematics) AsKinematics() (Kinematics, error)
AsKinematics converts this instance to Kinematics type