|
The dSPIN chip supports microstepping for a smoother ride. This function provides an easy front end for changing the microstepping mode.
|
|
Read used acceleration value
|
|
Return current acceleration starting KVAL.
|
|
Read used deceleration value
|
|
Return current deceleration starting KVAL.
|
|
Read the threshold speed when will cease microstepping and go to full-step mode.
|
|
Return current stopped starting KVAL.
|
|
Read current low-speed optimization option.
|
|
Return the used maximum positioning speed
|
|
Read the used minimum speed for positioning.
|
|
Read shutdown on overcurrent enable.
|
|
Read current overcurrent threshold
|
|
Read the used oscillator mode, see page 50 of the data sheet.
|
|
Get current PWM divisor
|
|
Get current PWM multiplier
|
|
Return current running starting KVAL.
|
|
Get current slew rate.
|
|
Read stall current threshold value.
|
|
Read currently used step.
|
|
Read the SW_MODE bit sets the external switch to act as HardStop interrupt (false) or not (true).
|
|
Read motor voltage compensation enable.
|
|
Set the acceleration rate, in steps per second per second. This value is converted to a dSPIN friendly value. Any value larger than 29802 will disable acceleration, putting the chip in "infinite" acceleration mode.
|
|
Acceleration starting KVAL. Value that can be assigned to the PWM modulators during acceleration (compensation excluded).
|
|
Set the deceleration rate, in steps per second per second. This value is converted to a dSPIN friendly value. Any value larger than 29802 will disable deceleration, putting the chip in "infinite" deceleration mode.
|
|
Deceleration starting KVAL. Value that can be assigned to the PWM modulators during deceleration (compensation excluded).
|
|
Above this threshold, the dSPIN will cease microstepping and go to full-step mode.
|
|
Stopped starting KVAL. Value that is assigned to the PWM modulators when the motor is stopped (compensation excluded).
|
|
Enable or disable the low-speed optimization option. With LSPD_OPT enabled, motion starts from 0 instead of MIN_SPEED and low-speed optimization keeps the driving sine wave prettier than normal until MIN_SPEED is reached. |
|
This is the maximum speed the dSPIN will attempt to produce.
|
|
Set the minimum speed allowable in the system. This is the speed a motion starts with; it will then ramp up to the designated speed or the max speed, using the acceleration profile.
|
|
Do we shutdown the drivers on overcurrent or not?
|
|
Set overcurrent threshold value. The available range is from 375 mA to 6 A, in steps of 375 mA, as shown in DSPIN_OCD_TH_xxxmA defines |
|
There are a number of clock options for this chip it can be configured to accept a clock, drive a crystal or resonator, and pass or not pass the clock signal downstream. Theoretically, you can use pretty much any frequency you want to drive it; practically, this library assumes it's being driven at 16MHz. Also, the device will use these bits to set the math used to figure out steps per second and stuff like that.
|
|
This is a multiplier/divider setup for the PWM frequency when microstepping. Divisors of 1-7 are available; multipliers of .625-2 are available. Seedatasheet for more details; it's not clear what the frequency being multiplied/divided here is, but it is clearly *not* the actual clock freq.
|
|
Running starting KVAL. Value that is assigned to the PWM modulators when the motor is running at constant speed (compensation excluded).
|
|
Slew rate of the output in V/us. Can be 180, 290, or 530.
|
|
Set stall current threshold value. Threshold range is 0 to 127 equivalent to a current 31.25 mA to 4 A. Bit resolution is 31.25mA
|
|
The switch input can either hard-stop the driver _or_ activate an interrupt. This bit allows you to select what it does.
|
|
Enable/disable motor voltage compensation.
|