Package yams.motorcontrollers.simulation
Class DCMotorSimSupplier
java.lang.Object
yams.motorcontrollers.simulation.DCMotorSimSupplier
- All Implemented Interfaces:
SimSupplier
DCMotorSim Supplier
-
Constructor Summary
ConstructorsConstructorDescriptionDCMotorSimSupplier(DCMotorSim simulation, SmartMotorController smartMotorController) Construct the DCMotorSim supplier -
Method Summary
Modifier and TypeMethodDescriptionvoidFeed inputvoidFeed the update sim watchGet the current draw of from the sim.Get the mechanism position.Get the mechanism stator voltage.Gets the supply voltage for the motor controller.Get the mechanism velocity.Get the rotor position.Get the rotor velocity.booleanGet the updated sim watchdog.booleanCheck if the input was fed.voidsetMechanismPosition(Angle position) Set the Mechanism positionvoidsetMechanismStatorDutyCycle(double dutyCycle) Set the dutycyle of the mechanism stator.voidsetMechanismStatorVoltage(Voltage volts) Set mechanism voltage, mostly used for SysId testing.voidsetMechanismVelocity(AngularVelocity velocity) Set the Mechanism velocity.voidStarve the input.voidStarve the update sim watch.voidUpdate the sim state.
-
Constructor Details
-
DCMotorSimSupplier
Construct the DCMotorSim supplier- Parameters:
simulation- Simulatoin instancesmartMotorController- SMC for the DCMotorSim..
-
-
Method Details
-
updateSimState
public void updateSimState()Description copied from interface:SimSupplierUpdate the sim state.- Specified by:
updateSimStatein interfaceSimSupplier
-
getUpdatedSim
public boolean getUpdatedSim()Description copied from interface:SimSupplierGet the updated sim watchdog.- Specified by:
getUpdatedSimin interfaceSimSupplier- Returns:
- Updated sim.
-
feedUpdateSim
public void feedUpdateSim()Description copied from interface:SimSupplierFeed the update sim watch- Specified by:
feedUpdateSimin interfaceSimSupplier
-
starveUpdateSim
public void starveUpdateSim()Description copied from interface:SimSupplierStarve the update sim watch.- Specified by:
starveUpdateSimin interfaceSimSupplier
-
isInputFed
public boolean isInputFed()Description copied from interface:SimSupplierCheck if the input was fed.- Specified by:
isInputFedin interfaceSimSupplier- Returns:
- Input fed.
-
feedInput
public void feedInput()Description copied from interface:SimSupplierFeed input- Specified by:
feedInputin interfaceSimSupplier
-
starveInput
public void starveInput()Description copied from interface:SimSupplierStarve the input.- Specified by:
starveInputin interfaceSimSupplier
-
setMechanismStatorDutyCycle
public void setMechanismStatorDutyCycle(double dutyCycle) Description copied from interface:SimSupplierSet the dutycyle of the mechanism stator.- Specified by:
setMechanismStatorDutyCyclein interfaceSimSupplier- Parameters:
dutyCycle- Dutycycle value.
-
getMechanismSupplyVoltage
Description copied from interface:SimSupplierGets the supply voltage for the motor controller.- Specified by:
getMechanismSupplyVoltagein interfaceSimSupplier- Returns:
- Supply voltage to the motor controller
-
getMechanismStatorVoltage
Description copied from interface:SimSupplierGet the mechanism stator voltage.- Specified by:
getMechanismStatorVoltagein interfaceSimSupplier- Returns:
- Stator voltage of the mechanism.
-
setMechanismStatorVoltage
Description copied from interface:SimSupplierSet mechanism voltage, mostly used for SysId testing.- Specified by:
setMechanismStatorVoltagein interfaceSimSupplier- Parameters:
volts- Voltage to set.
-
getMechanismPosition
Description copied from interface:SimSupplierGet the mechanism position.- Specified by:
getMechanismPositionin interfaceSimSupplier- Returns:
- mechanism angle.
-
setMechanismPosition
Description copied from interface:SimSupplierSet the Mechanism position- Specified by:
setMechanismPositionin interfaceSimSupplier- Parameters:
position- Position of the mechanism.
-
getRotorPosition
Description copied from interface:SimSupplierGet the rotor position.- Specified by:
getRotorPositionin interfaceSimSupplier- Returns:
- rotor position.
-
getMechanismVelocity
Description copied from interface:SimSupplierGet the mechanism velocity.- Specified by:
getMechanismVelocityin interfaceSimSupplier- Returns:
- Mechanism velocity.
-
setMechanismVelocity
Description copied from interface:SimSupplierSet the Mechanism velocity.- Specified by:
setMechanismVelocityin interfaceSimSupplier- Parameters:
velocity- Mechanism velocity.
-
getRotorVelocity
Description copied from interface:SimSupplierGet the rotor velocity.- Specified by:
getRotorVelocityin interfaceSimSupplier- Returns:
- rotor velocity.
-
getCurrentDraw
Description copied from interface:SimSupplierGet the current draw of from the sim.- Specified by:
getCurrentDrawin interfaceSimSupplier- Returns:
- Current draw.
-