public class BrickletSilentStepperV2 extends Device
Device.Identity
Constructor and Description |
---|
BrickletSilentStepperV2(String uid,
IPConnection ipcon)
Creates an object with the unique device ID \c uid.
|
Modifier and Type | Method and Description |
---|---|
void |
addAllDataListener(BrickletSilentStepperV2.AllDataListener listener)
Adds a AllData listener.
|
void |
addGPIOStateListener(BrickletSilentStepperV2.GPIOStateListener listener)
Adds a GPIOState listener.
|
void |
addNewStateListener(BrickletSilentStepperV2.NewStateListener listener)
Adds a NewState listener.
|
void |
addPositionReachedListener(BrickletSilentStepperV2.PositionReachedListener listener)
Adds a PositionReached listener.
|
void |
addUnderVoltageListener(BrickletSilentStepperV2.UnderVoltageListener listener)
Adds a UnderVoltage listener.
|
void |
driveBackward()
Drives the stepper motor backward until
driveForward() or
stop() is triggered. |
void |
driveForward()
Drives the stepper motor forward until
driveBackward() or
stop() is called. |
void |
fullBrake()
Executes an active full brake.
|
BrickletSilentStepperV2.AllData |
getAllData()
Returns the following parameters: The current velocity,
the current position, the remaining steps, the stack voltage, the external
voltage and the current consumption of the stepper motor.
|
long |
getAllDataCallbackConfiguraton()
Returns the period as set by
setAllCallbackConfiguration(long) . |
BrickletSilentStepperV2.BasicConfiguration |
getBasicConfiguration()
Returns the configuration as set by
setBasicConfiguration(int, int, int, int, int, int, int, boolean) . |
int |
getBootloaderMode()
Returns the current bootloader mode, see
setBootloaderMode(int) . |
int |
getChipTemperature()
Returns the temperature as measured inside the microcontroller.
|
BrickletSilentStepperV2.CoolstepConfiguration |
getCoolstepConfiguration()
Returns the configuration as set by
setCoolstepConfiguration(int, int, int, int, int, int, int) . |
int |
getCurrentPosition()
Returns the current position of the stepper motor in steps.
|
int |
getCurrentVelocity()
Returns the *current* velocity of the stepper motor.
|
BrickletSilentStepperV2.DriverStatus |
getDriverStatus()
Returns the current driver status.
|
boolean |
getEnabled()
Returns *true* if the stepper driver is enabled, *false* otherwise.
|
int |
getErrorLEDConfig()
Returns the LED configuration as set by
setErrorLEDConfig(int) |
long |
getGPIOAction(int channel)
Returns the GPIO action for a channel as set by
setGPIOAction(int, long) . |
BrickletSilentStepperV2.GPIOConfiguration |
getGPIOConfiguration(int channel)
Returns the GPIO configuration for a channel as set by
setGPIOConfiguration(int, int, int) . |
boolean[] |
getGPIOState()
Returns the GPIO state for both channels.
|
Device.Identity |
getIdentity()
Returns the UID, the UID where the Bricklet is connected to,
the position, the hardware and firmware version as well as the
device identifier.
|
int |
getInputVoltage()
Returns the external input voltage.
|
int |
getMaxVelocity()
Returns the velocity as set by
setMaxVelocity(int) . |
int |
getMinimumVoltage()
Returns the minimum voltage as set by
setMinimumVoltage(int) . |
BrickletSilentStepperV2.MiscConfiguration |
getMiscConfiguration()
Returns the configuration as set by
setMiscConfiguration(boolean, int) . |
int |
getMotorCurrent()
Returns the current as set by
setMotorCurrent(int) . |
int |
getRemainingSteps()
Returns the remaining steps of the last call of
setSteps(int) . |
BrickletSilentStepperV2.SpeedRamping |
getSpeedRamping()
Returns the acceleration and deacceleration as set by
setSpeedRamping(int, int) . |
BrickletSilentStepperV2.SPITFPErrorCount |
getSPITFPErrorCount()
Returns the error count for the communication between Brick and Bricklet.
|
BrickletSilentStepperV2.SpreadcycleConfiguration |
getSpreadcycleConfiguration()
Returns the configuration as set by
setBasicConfiguration(int, int, int, int, int, int, int, boolean) . |
int |
getStatusLEDConfig()
Returns the configuration as set by
setStatusLEDConfig(int) |
BrickletSilentStepperV2.StealthConfiguration |
getStealthConfiguration()
Returns the configuration as set by
setStealthConfiguration(boolean, int, int, boolean, boolean, int) . |
BrickletSilentStepperV2.StepConfiguration |
getStepConfiguration()
Returns the step mode as set by
setStepConfiguration(int, boolean) . |
int |
getSteps()
Returns the last steps as set by
setSteps(int) . |
int |
getTargetPosition()
Returns the last target position as set by
setTargetPosition(int) . |
long |
getTimeBase()
Returns the time base as set by
setTimeBase(long) . |
long |
readUID()
Returns the current UID as an integer.
|
void |
removeAllDataListener(BrickletSilentStepperV2.AllDataListener listener)
Removes a AllData listener.
|
void |
removeGPIOStateListener(BrickletSilentStepperV2.GPIOStateListener listener)
Removes a GPIOState listener.
|
void |
removeNewStateListener(BrickletSilentStepperV2.NewStateListener listener)
Removes a NewState listener.
|
void |
removePositionReachedListener(BrickletSilentStepperV2.PositionReachedListener listener)
Removes a PositionReached listener.
|
void |
removeUnderVoltageListener(BrickletSilentStepperV2.UnderVoltageListener listener)
Removes a UnderVoltage listener.
|
void |
reset()
Calling this function will reset the Bricklet.
|
void |
setAllCallbackConfiguration(long period)
Sets the period with which the
BrickletSilentStepperV2.AllDataListener listener is triggered
periodically. |
void |
setBasicConfiguration(int standstillCurrent,
int motorRunCurrent,
int standstillDelayTime,
int powerDownTime,
int stealthThreshold,
int coolstepThreshold,
int classicThreshold,
boolean highVelocityChopperMode)
Sets the basic configuration parameters for the different modes (Stealth, Coolstep, Classic).
|
int |
setBootloaderMode(int mode)
Sets the bootloader mode and returns the status after the requested
mode change was instigated.
|
void |
setCoolstepConfiguration(int minimumStallguardValue,
int maximumStallguardValue,
int currentUpStepWidth,
int currentDownStepWidth,
int minimumCurrent,
int stallguardThresholdValue,
int stallguardMode)
Note: If you don't know what any of this means you can very likely keep all of
the values as default!
Sets the configuration relevant for Coolstep.
|
void |
setCurrentPosition(int position)
Sets the current steps of the internal step counter.
|
void |
setEnabled(boolean enabled)
Enables/Disables the driver chip.
|
void |
setErrorLEDConfig(int config)
Configures the error LED to be either turned off, turned on, blink in
heartbeat mode or show an error.
|
void |
setGPIOAction(int channel,
long action)
Sets the GPIO action for the given channel.
|
void |
setGPIOConfiguration(int channel,
int debounce,
int stopDeceleration)
Sets the GPIO configuration for the given channel.
|
void |
setMaxVelocity(int velocity)
Sets the maximum velocity of the stepper motor.
|
void |
setMinimumVoltage(int voltage)
Sets the minimum voltage, below which the
BrickletSilentStepperV2.UnderVoltageListener listener
is triggered. |
void |
setMiscConfiguration(boolean disableShortToGroundProtection,
int synchronizePhaseFrequency)
Note: If you don't know what any of this means you can very likely keep all of
the values as default!
Sets miscellaneous configuration parameters.
|
void |
setMotorCurrent(int current)
Sets the current with which the motor will be driven.
|
void |
setSpeedRamping(int acceleration,
int deacceleration)
Sets the acceleration and deacceleration of the stepper motor.
|
void |
setSpreadcycleConfiguration(int slowDecayDuration,
boolean enableRandomSlowDecay,
int fastDecayDuration,
int hysteresisStartValue,
int hysteresisEndValue,
int sineWaveOffset,
int chopperMode,
int comparatorBlankTime,
boolean fastDecayWithoutComparator)
Note: If you don't know what any of this means you can very likely keep all of
the values as default!
Sets the Spreadcycle configuration parameters.
|
void |
setStatusLEDConfig(int config)
Sets the status LED configuration.
|
void |
setStealthConfiguration(boolean enableStealth,
int amplitude,
int gradient,
boolean enableAutoscale,
boolean forceSymmetric,
int freewheelMode)
Note: If you don't know what any of this means you can very likely keep all of
the values as default!
Sets the configuration relevant for Stealth mode.
|
void |
setStepConfiguration(int stepResolution,
boolean interpolation)
Sets the step resolution from full-step up to 1/256-step.
|
void |
setSteps(int steps)
Sets the number of steps the stepper motor should run.
|
void |
setTargetPosition(int position)
Sets the target position of the stepper motor in steps.
|
void |
setTimeBase(long timeBase)
Sets the time base of the velocity and the acceleration of the Silent Stepper
Bricklet 2.0.
|
void |
setWriteFirmwarePointer(long pointer)
Sets the firmware pointer for
writeFirmware(int[]) . |
void |
stop()
Stops the stepper motor with the deacceleration as set by
setSpeedRamping(int, int) . |
int |
writeFirmware(int[] data)
Writes 64 Bytes of firmware at the position as written by
setWriteFirmwarePointer(long) before. |
void |
writeUID(long uid)
Writes a new UID into flash.
|
getAPIVersion, getResponseExpected, setResponseExpected, setResponseExpectedAll
public static final int DEVICE_IDENTIFIER
public static final String DEVICE_DISPLAY_NAME
public static final byte FUNCTION_SET_MAX_VELOCITY
public static final byte FUNCTION_GET_MAX_VELOCITY
public static final byte FUNCTION_GET_CURRENT_VELOCITY
public static final byte FUNCTION_SET_SPEED_RAMPING
public static final byte FUNCTION_GET_SPEED_RAMPING
public static final byte FUNCTION_FULL_BRAKE
public static final byte FUNCTION_SET_CURRENT_POSITION
public static final byte FUNCTION_GET_CURRENT_POSITION
public static final byte FUNCTION_SET_TARGET_POSITION
public static final byte FUNCTION_GET_TARGET_POSITION
public static final byte FUNCTION_SET_STEPS
public static final byte FUNCTION_GET_STEPS
public static final byte FUNCTION_GET_REMAINING_STEPS
public static final byte FUNCTION_SET_STEP_CONFIGURATION
public static final byte FUNCTION_GET_STEP_CONFIGURATION
public static final byte FUNCTION_DRIVE_FORWARD
public static final byte FUNCTION_DRIVE_BACKWARD
public static final byte FUNCTION_STOP
public static final byte FUNCTION_GET_INPUT_VOLTAGE
public static final byte FUNCTION_SET_MOTOR_CURRENT
public static final byte FUNCTION_GET_MOTOR_CURRENT
public static final byte FUNCTION_SET_ENABLED
public static final byte FUNCTION_GET_ENABLED
public static final byte FUNCTION_SET_BASIC_CONFIGURATION
public static final byte FUNCTION_GET_BASIC_CONFIGURATION
public static final byte FUNCTION_SET_SPREADCYCLE_CONFIGURATION
public static final byte FUNCTION_GET_SPREADCYCLE_CONFIGURATION
public static final byte FUNCTION_SET_STEALTH_CONFIGURATION
public static final byte FUNCTION_GET_STEALTH_CONFIGURATION
public static final byte FUNCTION_SET_COOLSTEP_CONFIGURATION
public static final byte FUNCTION_GET_COOLSTEP_CONFIGURATION
public static final byte FUNCTION_SET_MISC_CONFIGURATION
public static final byte FUNCTION_GET_MISC_CONFIGURATION
public static final byte FUNCTION_SET_ERROR_LED_CONFIG
public static final byte FUNCTION_GET_ERROR_LED_CONFIG
public static final byte FUNCTION_GET_DRIVER_STATUS
public static final byte FUNCTION_SET_MINIMUM_VOLTAGE
public static final byte FUNCTION_GET_MINIMUM_VOLTAGE
public static final byte FUNCTION_SET_TIME_BASE
public static final byte FUNCTION_GET_TIME_BASE
public static final byte FUNCTION_GET_ALL_DATA
public static final byte FUNCTION_SET_ALL_CALLBACK_CONFIGURATION
public static final byte FUNCTION_GET_ALL_DATA_CALLBACK_CONFIGURATON
public static final byte FUNCTION_SET_GPIO_CONFIGURATION
public static final byte FUNCTION_GET_GPIO_CONFIGURATION
public static final byte FUNCTION_SET_GPIO_ACTION
public static final byte FUNCTION_GET_GPIO_ACTION
public static final byte FUNCTION_GET_GPIO_STATE
public static final byte FUNCTION_GET_SPITFP_ERROR_COUNT
public static final byte FUNCTION_SET_BOOTLOADER_MODE
public static final byte FUNCTION_GET_BOOTLOADER_MODE
public static final byte FUNCTION_SET_WRITE_FIRMWARE_POINTER
public static final byte FUNCTION_WRITE_FIRMWARE
public static final byte FUNCTION_SET_STATUS_LED_CONFIG
public static final byte FUNCTION_GET_STATUS_LED_CONFIG
public static final byte FUNCTION_GET_CHIP_TEMPERATURE
public static final byte FUNCTION_RESET
public static final byte FUNCTION_WRITE_UID
public static final byte FUNCTION_READ_UID
public static final byte FUNCTION_GET_IDENTITY
public static final int STEP_RESOLUTION_1
public static final int STEP_RESOLUTION_2
public static final int STEP_RESOLUTION_4
public static final int STEP_RESOLUTION_8
public static final int STEP_RESOLUTION_16
public static final int STEP_RESOLUTION_32
public static final int STEP_RESOLUTION_64
public static final int STEP_RESOLUTION_128
public static final int STEP_RESOLUTION_256
public static final int CHOPPER_MODE_SPREAD_CYCLE
public static final int CHOPPER_MODE_FAST_DECAY
public static final int FREEWHEEL_MODE_NORMAL
public static final int FREEWHEEL_MODE_FREEWHEELING
public static final int FREEWHEEL_MODE_COIL_SHORT_LS
public static final int FREEWHEEL_MODE_COIL_SHORT_HS
public static final int CURRENT_UP_STEP_INCREMENT_1
public static final int CURRENT_UP_STEP_INCREMENT_2
public static final int CURRENT_UP_STEP_INCREMENT_4
public static final int CURRENT_UP_STEP_INCREMENT_8
public static final int CURRENT_DOWN_STEP_DECREMENT_1
public static final int CURRENT_DOWN_STEP_DECREMENT_2
public static final int CURRENT_DOWN_STEP_DECREMENT_8
public static final int CURRENT_DOWN_STEP_DECREMENT_32
public static final int MINIMUM_CURRENT_HALF
public static final int MINIMUM_CURRENT_QUARTER
public static final int STALLGUARD_MODE_STANDARD
public static final int STALLGUARD_MODE_FILTERED
public static final int OPEN_LOAD_NONE
public static final int OPEN_LOAD_PHASE_A
public static final int OPEN_LOAD_PHASE_B
public static final int OPEN_LOAD_PHASE_AB
public static final int SHORT_TO_GROUND_NONE
public static final int SHORT_TO_GROUND_PHASE_A
public static final int SHORT_TO_GROUND_PHASE_B
public static final int SHORT_TO_GROUND_PHASE_AB
public static final int OVER_TEMPERATURE_NONE
public static final int OVER_TEMPERATURE_WARNING
public static final int OVER_TEMPERATURE_LIMIT
public static final int STATE_STOP
public static final int STATE_ACCELERATION
public static final int STATE_RUN
public static final int STATE_DEACCELERATION
public static final int STATE_DIRECTION_CHANGE_TO_FORWARD
public static final int STATE_DIRECTION_CHANGE_TO_BACKWARD
public static final long GPIO_ACTION_NONE
public static final long GPIO_ACTION_NORMAL_STOP_RISING_EDGE
public static final long GPIO_ACTION_NORMAL_STOP_FALLING_EDGE
public static final long GPIO_ACTION_FULL_BRAKE_RISING_EDGE
public static final long GPIO_ACTION_FULL_BRAKE_FALLING_EDGE
public static final long GPIO_ACTION_CALLBACK_RISING_EDGE
public static final long GPIO_ACTION_CALLBACK_FALLING_EDGE
public static final int ERROR_LED_CONFIG_OFF
public static final int ERROR_LED_CONFIG_ON
public static final int ERROR_LED_CONFIG_SHOW_HEARTBEAT
public static final int ERROR_LED_CONFIG_SHOW_ERROR
public static final int BOOTLOADER_MODE_BOOTLOADER
public static final int BOOTLOADER_MODE_FIRMWARE
public static final int BOOTLOADER_MODE_BOOTLOADER_WAIT_FOR_REBOOT
public static final int BOOTLOADER_MODE_FIRMWARE_WAIT_FOR_REBOOT
public static final int BOOTLOADER_MODE_FIRMWARE_WAIT_FOR_ERASE_AND_REBOOT
public static final int BOOTLOADER_STATUS_OK
public static final int BOOTLOADER_STATUS_INVALID_MODE
public static final int BOOTLOADER_STATUS_NO_CHANGE
public static final int BOOTLOADER_STATUS_ENTRY_FUNCTION_NOT_PRESENT
public static final int BOOTLOADER_STATUS_DEVICE_IDENTIFIER_INCORRECT
public static final int BOOTLOADER_STATUS_CRC_MISMATCH
public static final int STATUS_LED_CONFIG_OFF
public static final int STATUS_LED_CONFIG_ON
public static final int STATUS_LED_CONFIG_SHOW_HEARTBEAT
public static final int STATUS_LED_CONFIG_SHOW_STATUS
public BrickletSilentStepperV2(String uid, IPConnection ipcon)
public void setMaxVelocity(int velocity) throws TinkerforgeException
setTargetPosition(int)
, setSteps(int)
, driveForward()
or
driveBackward()
.TinkerforgeException
public int getMaxVelocity() throws TinkerforgeException
setMaxVelocity(int)
.TinkerforgeException
public int getCurrentVelocity() throws TinkerforgeException
TinkerforgeException
public void setSpeedRamping(int acceleration, int deacceleration) throws TinkerforgeException
TinkerforgeException
public BrickletSilentStepperV2.SpeedRamping getSpeedRamping() throws TinkerforgeException
setSpeedRamping(int, int)
.TinkerforgeException
public void fullBrake() throws TinkerforgeException
stop()
if you just want to stop the motor.TinkerforgeException
public void setCurrentPosition(int position) throws TinkerforgeException
TinkerforgeException
public int getCurrentPosition() throws TinkerforgeException
setTargetPosition(int)
, setSteps(int)
, driveForward()
or
driveBackward()
). It also is possible to reset the steps to 0 or
set them to any other desired value with setCurrentPosition(int)
.TinkerforgeException
public void setTargetPosition(int position) throws TinkerforgeException
setTargetPosition(int)
is
called with 1000, the stepper motor will drive 500 steps forward. It will
use the velocity, acceleration and deacceleration as set by
setMaxVelocity(int)
and setSpeedRamping(int, int)
.
A call of setTargetPosition(int)
with the parameter *x* is equivalent to
a call of setSteps(int)
with the parameter
(*x* - getCurrentPosition()
).TinkerforgeException
public int getTargetPosition() throws TinkerforgeException
setTargetPosition(int)
.TinkerforgeException
public void setSteps(int steps) throws TinkerforgeException
setMaxVelocity(int)
and setSpeedRamping(int, int)
will be used.TinkerforgeException
public int getSteps() throws TinkerforgeException
setSteps(int)
.TinkerforgeException
public int getRemainingSteps() throws TinkerforgeException
setSteps(int)
.
For example, if setSteps(int)
is called with 2000 and
getRemainingSteps()
is called after the motor has run for 500 steps,
it will return 1500.TinkerforgeException
public void setStepConfiguration(int stepResolution, boolean interpolation) throws TinkerforgeException
TinkerforgeException
public BrickletSilentStepperV2.StepConfiguration getStepConfiguration() throws TinkerforgeException
setStepConfiguration(int, boolean)
.TinkerforgeException
public void driveForward() throws TinkerforgeException
driveBackward()
or
stop()
is called. The velocity, acceleration and deacceleration as
set by setMaxVelocity(int)
and setSpeedRamping(int, int)
will be used.TinkerforgeException
public void driveBackward() throws TinkerforgeException
driveForward()
or
stop()
is triggered. The velocity, acceleration and deacceleration as
set by setMaxVelocity(int)
and setSpeedRamping(int, int)
will be used.TinkerforgeException
public void stop() throws TinkerforgeException
setSpeedRamping(int, int)
.TinkerforgeException
public int getInputVoltage() throws TinkerforgeException
TinkerforgeException
public void setMotorCurrent(int current) throws TinkerforgeException
TinkerforgeException
public int getMotorCurrent() throws TinkerforgeException
setMotorCurrent(int)
.TinkerforgeException
public void setEnabled(boolean enabled) throws TinkerforgeException
stop()
function
before disabling the motor power. The stop()
function will **not**
wait until the motor is actually stopped. You have to explicitly wait for the
appropriate time after calling the stop()
function before calling
the setEnabled(boolean)
with false function.TinkerforgeException
public boolean getEnabled() throws TinkerforgeException
TinkerforgeException
public void setBasicConfiguration(int standstillCurrent, int motorRunCurrent, int standstillDelayTime, int powerDownTime, int stealthThreshold, int coolstepThreshold, int classicThreshold, boolean highVelocityChopperMode) throws TinkerforgeException
setMotorCurrent(int)
).
* Motor Run Current: The value sets the motor current when the motor is running.
Use a value of at least one half of the global maximum motor current for a good
microstep performance. The maximum allowed value is the current
motor current. The API maps the entered value to 1/32 ... 32/32 of the maximum
motor current. This value should be used to change the motor current during motor movement,
whereas the global maximum motor current should not be changed while the motor is moving
(see setMotorCurrent(int)
).
* Standstill Delay Time: Controls the duration for motor power down after a motion
as soon as standstill is detected and the Power Down Time is expired. A high Standstill Delay
Time results in a smooth transition that avoids motor jerk during power down.
* Power Down Time: Sets the delay time after a stand still.
* Stealth Threshold: Sets the upper threshold for Stealth mode.
If the velocity of the motor goes above this value, Stealth mode is turned
off. Otherwise it is turned on. In Stealth mode the torque declines with high speed.
* Coolstep Threshold: Sets the lower threshold for Coolstep mode.
The Coolstep Threshold needs to be above the Stealth Threshold.
* Classic Threshold: Sets the lower threshold for classic mode.
In classic mode the stepper becomes more noisy, but the torque is maximized.
* High Velocity Chopper Mode: If High Velocity Chopper Mode is enabled, the stepper control
is optimized to run the stepper motors at high velocities.
If you want to use all three thresholds make sure that
Stealth Threshold < Coolstep Threshold < Classic Threshold.TinkerforgeException
public BrickletSilentStepperV2.BasicConfiguration getBasicConfiguration() throws TinkerforgeException
setBasicConfiguration(int, int, int, int, int, int, int, boolean)
.TinkerforgeException
public void setSpreadcycleConfiguration(int slowDecayDuration, boolean enableRandomSlowDecay, int fastDecayDuration, int hysteresisStartValue, int hysteresisEndValue, int sineWaveOffset, int chopperMode, int comparatorBlankTime, boolean fastDecayWithoutComparator) throws TinkerforgeException
TinkerforgeException
public BrickletSilentStepperV2.SpreadcycleConfiguration getSpreadcycleConfiguration() throws TinkerforgeException
setBasicConfiguration(int, int, int, int, int, int, int, boolean)
.TinkerforgeException
public void setStealthConfiguration(boolean enableStealth, int amplitude, int gradient, boolean enableAutoscale, boolean forceSymmetric, int freewheelMode) throws TinkerforgeException
setBasicConfiguration(int, int, int, int, int, int, int, boolean)
.
* Amplitude: If autoscale is disabled, the PWM amplitude is scaled by this value. If autoscale is enabled,
this value defines the maximum PWM amplitude change per half wave.
* Gradient: If autoscale is disabled, the PWM gradient is scaled by this value. If autoscale is enabled,
this value defines the maximum PWM gradient. With autoscale a value above 64 is recommended,
otherwise the regulation might not be able to measure the current.
* Enable Autoscale: If set to true, automatic current control is used. Otherwise the user defined
amplitude and gradient are used.
* Force Symmetric: If true, A symmetric PWM cycle is enforced. Otherwise the PWM value may change within each
PWM cycle.
* Freewheel Mode: The freewheel mode defines the behavior in stand still if the Standstill Current
(see setBasicConfiguration(int, int, int, int, int, int, int, boolean)
) is set to 0.TinkerforgeException
public BrickletSilentStepperV2.StealthConfiguration getStealthConfiguration() throws TinkerforgeException
setStealthConfiguration(boolean, int, int, boolean, boolean, int)
.TinkerforgeException
public void setCoolstepConfiguration(int minimumStallguardValue, int maximumStallguardValue, int currentUpStepWidth, int currentDownStepWidth, int minimumCurrent, int stallguardThresholdValue, int stallguardMode) throws TinkerforgeException
getDriverStatus()
).
A lower value gives a higher sensitivity. You have to find a suitable value for your
motor by trial and error, 0 works for most motors.
* Stallguard Mode: Set to 0 for standard resolution or 1 for filtered mode. In filtered mode the Stallguard
signal will be updated every four full-steps.TinkerforgeException
public BrickletSilentStepperV2.CoolstepConfiguration getCoolstepConfiguration() throws TinkerforgeException
setCoolstepConfiguration(int, int, int, int, int, int, int)
.TinkerforgeException
public void setMiscConfiguration(boolean disableShortToGroundProtection, int synchronizePhaseFrequency) throws TinkerforgeException
TinkerforgeException
public BrickletSilentStepperV2.MiscConfiguration getMiscConfiguration() throws TinkerforgeException
setMiscConfiguration(boolean, int)
.TinkerforgeException
public void setErrorLEDConfig(int config) throws TinkerforgeException
TinkerforgeException
public int getErrorLEDConfig() throws TinkerforgeException
setErrorLEDConfig(int)
TinkerforgeException
public BrickletSilentStepperV2.DriverStatus getDriverStatus() throws TinkerforgeException
setBasicConfiguration(int, int, int, int, int, int, int, boolean)
. Example: If a ``Motor Run Current``
of 1000mA was set and the returned value is 15, the ``Actual Motor Current`` is 16/32*1000mA = 500mA.
* Stallguard Result: Indicates the load of the motor. A lower value signals a higher load. Per trial and error
you can find out which value corresponds to a suitable torque for the velocity used in your application.
After that you can use this threshold value to find out if a motor stall becomes probable and react on it (e.g.
decrease velocity).
During stand still this value can not be used for stall detection, it shows the chopper on-time for motor coil A.
* Stealth Voltage Amplitude: Shows the actual PWM scaling. In Stealth mode it can be used to detect motor load and
stall if autoscale is enabled (see setStealthConfiguration(boolean, int, int, boolean, boolean, int)
).TinkerforgeException
public void setMinimumVoltage(int voltage) throws TinkerforgeException
BrickletSilentStepperV2.UnderVoltageListener
listener
is triggered. The minimum possible value that works with the Silent Stepper
Bricklet 2.0 is 8V.
You can use this function to detect the discharge of a battery that is used
to drive the stepper motor. If you have a fixed power supply, you likely do
not need this functionality.TinkerforgeException
public int getMinimumVoltage() throws TinkerforgeException
setMinimumVoltage(int)
.TinkerforgeException
public void setTimeBase(long timeBase) throws TinkerforgeException
TinkerforgeException
public long getTimeBase() throws TinkerforgeException
setTimeBase(long)
.TinkerforgeException
public BrickletSilentStepperV2.AllData getAllData() throws TinkerforgeException
setBasicConfiguration(int, int, int, int, int, int, int, boolean)
) with the ``Motor Run Current``
(see getDriverStatus()
). This is an internal calculation of the
driver, not an independent external measurement.
The current consumption calculation was broken up to firmware 2.0.1, it is fixed
since firmware 2.0.2.
There is also a listener for this function, see BrickletSilentStepperV2.AllDataListener
listener.TinkerforgeException
public void setAllCallbackConfiguration(long period) throws TinkerforgeException
BrickletSilentStepperV2.AllDataListener
listener is triggered
periodically. A value of 0 turns the listener off.TinkerforgeException
public long getAllDataCallbackConfiguraton() throws TinkerforgeException
setAllCallbackConfiguration(long)
.TinkerforgeException
public void setGPIOConfiguration(int channel, int debounce, int stopDeceleration) throws TinkerforgeException
setGPIOAction(int, long)
.TinkerforgeException
public BrickletSilentStepperV2.GPIOConfiguration getGPIOConfiguration(int channel) throws TinkerforgeException
setGPIOConfiguration(int, int, int)
.TinkerforgeException
public void setGPIOAction(int channel, long action) throws TinkerforgeException
setGPIOConfiguration(int, int, int)
.TinkerforgeException
public long getGPIOAction(int channel) throws TinkerforgeException
setGPIOAction(int, long)
.TinkerforgeException
public boolean[] getGPIOState() throws TinkerforgeException
TinkerforgeException
public BrickletSilentStepperV2.SPITFPErrorCount getSPITFPErrorCount() throws TinkerforgeException
TinkerforgeException
public int setBootloaderMode(int mode) throws TinkerforgeException
TinkerforgeException
public int getBootloaderMode() throws TinkerforgeException
setBootloaderMode(int)
.TinkerforgeException
public void setWriteFirmwarePointer(long pointer) throws TinkerforgeException
writeFirmware(int[])
. The pointer has
to be increased by chunks of size 64. The data is written to flash
every 4 chunks (which equals to one page of size 256).
This function is used by Brick Viewer during flashing. It should not be
necessary to call it in a normal user program.TinkerforgeException
public int writeFirmware(int[] data) throws TinkerforgeException
setWriteFirmwarePointer(long)
before. The firmware is written
to flash every 4 chunks.
You can only write firmware in bootloader mode.
This function is used by Brick Viewer during flashing. It should not be
necessary to call it in a normal user program.TinkerforgeException
public void setStatusLEDConfig(int config) throws TinkerforgeException
TinkerforgeException
public int getStatusLEDConfig() throws TinkerforgeException
setStatusLEDConfig(int)
TinkerforgeException
public int getChipTemperature() throws TinkerforgeException
TinkerforgeException
public void reset() throws TinkerforgeException
TinkerforgeException
public void writeUID(long uid) throws TinkerforgeException
TinkerforgeException
public long readUID() throws TinkerforgeException
TinkerforgeException
public Device.Identity getIdentity() throws TinkerforgeException
getIdentity
in class Device
TinkerforgeException
public void addUnderVoltageListener(BrickletSilentStepperV2.UnderVoltageListener listener)
public void removeUnderVoltageListener(BrickletSilentStepperV2.UnderVoltageListener listener)
public void addPositionReachedListener(BrickletSilentStepperV2.PositionReachedListener listener)
public void removePositionReachedListener(BrickletSilentStepperV2.PositionReachedListener listener)
public void addAllDataListener(BrickletSilentStepperV2.AllDataListener listener)
public void removeAllDataListener(BrickletSilentStepperV2.AllDataListener listener)
public void addNewStateListener(BrickletSilentStepperV2.NewStateListener listener)
public void removeNewStateListener(BrickletSilentStepperV2.NewStateListener listener)
public void addGPIOStateListener(BrickletSilentStepperV2.GPIOStateListener listener)
public void removeGPIOStateListener(BrickletSilentStepperV2.GPIOStateListener listener)
Copyright © 2022 Tinkerforge GmbH. All rights reserved.