Main Page | Modules | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

Driver config
[L6470 - Library dor fully integrated microstepping motor driver with motion engine and SPI]


Functions

void otL6470.configStepMode (U8 stepMode)
U8 otL6470.getStepMode ()
void otL6470.setMaxSpeed (F32 stepsPerSecond)
F32 otL6470.getMaxSpeed ()
void otL6470.setMinSpeed (F32 stepsPerSecond)
F32 otL6470.getMinSpeed ()
void otL6470.setFullSpeed (F32 stepsPerSecond)
F32 otL6470.getFullSpeed ()
void otL6470.setAcc (F32 stepsPerSecondPerSecond)
F32 otL6470.getAcc ()
void otL6470.setDec (F32 stepsPerSecondPerSecond)
F32 otL6470.getDec ()
void otL6470.setOCThreshold (U8 threshold)
U8 otL6470.getOCThreshold ()
void otL6470.setStallThreshold (U8 threshold)
U8 otL6470.getStallThreshold ()
void otL6470.setPWMFreq (int divisor, int multiplier)
U32 otL6470.getPWMFreqDivisor ()
U32 otL6470.getPWMFreqMultiplier ()
void otL6470.setSlewRate (U16 slewRate)
U16 otL6470.getSlewRate ()
void otL6470.setOCShutdown (bool OCShutdown)
bool otL6470.getOCShutdown ()
void otL6470.setVoltageComp (bool vsCompMode)
bool otL6470.getVoltageComp ()
void otL6470.setSwitchMode (bool UserDisposal)
bool otL6470.getSwitchMode ()
void otL6470.setOscMode (int oscillatorMode)
U16 otL6470.getOscMode ()
void otL6470.setAccKVAL (U8 kvalInput)
U8 otL6470.getAccKVAL ()
void otL6470.setDecKVAL (U8 kvalInput)
U8 otL6470.getDecKVAL ()
void otL6470.setRunKVAL (U8 kvalInput)
U8 otL6470.getRunKVAL ()
void otL6470.setHoldKVAL (U8 kvalInput)
U8 otL6470.getHoldKVAL ()
void otL6470.setLoSpdOpt (bool enable)
bool otL6470.getLoSpdOpt ()

Function Documentation

void otL6470.configStepMode U8  stepMode  )  [inherited]
 

The dSPIN chip supports microstepping for a smoother ride. This function provides an easy front end for changing the microstepping mode.

Parameters:
stepMode Step value, from 0 to 7. 0 for full step, 7 for 1/64 of step.

F32 otL6470.getAcc  )  [inherited]
 

Read used acceleration value

Returns:
Acceleration value

U8 otL6470.getAccKVAL  )  [inherited]
 

Return current acceleration starting KVAL.

Returns:
Acceleration starting KVAL.

F32 otL6470.getDec  )  [inherited]
 

Read used deceleration value

Returns:
Deceleration value

U8 otL6470.getDecKVAL  )  [inherited]
 

Return current deceleration starting KVAL.

Returns:
Deceleration starting KVAL.

F32 otL6470.getFullSpeed  )  [inherited]
 

Read the threshold speed when will cease microstepping and go to full-step mode.

Returns:
Threshold speed

U8 otL6470.getHoldKVAL  )  [inherited]
 

Return current stopped starting KVAL.

Returns:
Stopped starting KVAL.

bool otL6470.getLoSpdOpt  )  [inherited]
 

Read current low-speed optimization option.

Returns:
Low-speed optimization option.

F32 otL6470.getMaxSpeed  )  [inherited]
 

Return the used maximum positioning speed

Returns:
Maximum positioning speed

F32 otL6470.getMinSpeed  )  [inherited]
 

Read the used minimum speed for positioning.

Returns:
Minimum speed for positioning.

bool otL6470.getOCShutdown  )  [inherited]
 

Read shutdown on overcurrent enable.

Returns:
True if enabled.

U8 otL6470.getOCThreshold  )  [inherited]
 

Read current overcurrent threshold

Returns:
Overcurrent threshold

U16 otL6470.getOscMode  )  [inherited]
 

Read the used oscillator mode, see page 50 of the data sheet.

Returns:
Oscillator mode.

U32 otL6470.getPWMFreqDivisor  )  [inherited]
 

Get current PWM divisor

Returns:
PWM divisor

U32 otL6470.getPWMFreqMultiplier  )  [inherited]
 

Get current PWM multiplier

Returns:
PWM multiplier

U8 otL6470.getRunKVAL  )  [inherited]
 

Return current running starting KVAL.

Returns:
Running starting KVAL.

U16 otL6470.getSlewRate  )  [inherited]
 

Get current slew rate.

Returns:
slew rate.

U8 otL6470.getStallThreshold  )  [inherited]
 

Read stall current threshold value.

Returns:
Stall current threshold value.

U8 otL6470.getStepMode  )  [inherited]
 

Read currently used step.

Returns:
Current step value

bool otL6470.getSwitchMode  )  [inherited]
 

Read the SW_MODE bit sets the external switch to act as HardStop interrupt (false) or not (true).

Returns:
External switch activity

bool otL6470.getVoltageComp  )  [inherited]
 

Read motor voltage compensation enable.

Returns:
True if enabled

void otL6470.setAcc F32  stepsPerSecondPerSecond  )  [inherited]
 

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.

Parameters:
stepsPerSecondPerSecond Value for acceleration

void otL6470.setAccKVAL U8  kvalInput  )  [inherited]
 

Acceleration starting KVAL. Value that can be assigned to the PWM modulators during acceleration (compensation excluded).

Parameters:
kvalInput Acceleration starting KVAL, default 29.

void otL6470.setDec F32  stepsPerSecondPerSecond  )  [inherited]
 

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.

Parameters:
stepsPerSecondPerSecond Value for deceleration

void otL6470.setDecKVAL U8  kvalInput  )  [inherited]
 

Deceleration starting KVAL. Value that can be assigned to the PWM modulators during deceleration (compensation excluded).

Parameters:
kvalInput Deceleration starting KVAL, default 29.

void otL6470.setFullSpeed F32  stepsPerSecond  )  [inherited]
 

Above this threshold, the dSPIN will cease microstepping and go to full-step mode.

Parameters:
stepsPerSecond Threshold speed

void otL6470.setHoldKVAL U8  kvalInput  )  [inherited]
 

Stopped starting KVAL. Value that is assigned to the PWM modulators when the motor is stopped (compensation excluded).

Parameters:
kvalInput Stopped starting KVAL, default 29.

void otL6470.setLoSpdOpt bool  enable  )  [inherited]
 

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.

void otL6470.setMaxSpeed F32  stepsPerSecond  )  [inherited]
 

This is the maximum speed the dSPIN will attempt to produce.

Parameters:
stepsPerSecond Maximum postioning speed

void otL6470.setMinSpeed F32  stepsPerSecond  )  [inherited]
 

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.

Parameters:
stepsPerSecond Minimum postioning speed

void otL6470.setOCShutdown bool  OCShutdown  )  [inherited]
 

Do we shutdown the drivers on overcurrent or not?

Parameters:
OCShutdown Set true to enable

void otL6470.setOCThreshold U8  threshold  )  [inherited]
 

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

void otL6470.setOscMode int  oscillatorMode  )  [inherited]
 

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.

Parameters:
oscillatorMode Always use DSPIN_CONFIG_INT_16MHZ

void otL6470.setPWMFreq int  divisor,
int  multiplier
[inherited]
 

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.

Parameters:
divisor PLL divisor
multiplier PLL multiplier

void otL6470.setRunKVAL U8  kvalInput  )  [inherited]
 

Running starting KVAL. Value that is assigned to the PWM modulators when the motor is running at constant speed (compensation excluded).

Parameters:
kvalInput Running starting KVAL, default 29.

void otL6470.setSlewRate U16  slewRate  )  [inherited]
 

Slew rate of the output in V/us. Can be 180, 290, or 530.

Parameters:
slewRate can be: DSPIN_CONFIG_SR_180V_us or DSPIN_CONFIG_SR_290V_us or DSPIN_CONFIG_SR_530V_us

void otL6470.setStallThreshold U8  threshold  )  [inherited]
 

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

Parameters:
threshold Stall current threshold

void otL6470.setSwitchMode bool  UserDisposal  )  [inherited]
 

The switch input can either hard-stop the driver _or_ activate an interrupt. This bit allows you to select what it does.

Parameters:
UserDisposal True if external switch don't act HardStop

void otL6470.setVoltageComp bool  vsCompMode  )  [inherited]
 

Enable/disable motor voltage compensation.

Parameters:
vsCompMode True if enable voltage compensation.
footer

otStudio - Library Reference - (C) 2020-25 Officina Turini, All Rights Reserved
Document built with Doxygen 1.4.0