Author
|
Matrix Ltd
|
Version
|
2.0
|
Category
|
|
Stepper Motor (Generic) component
A generic stepper motor model. Includes a visual simulation showing the activaton pattern of the coils. Make another object move along with the stepper shaft using the 'Target' property. The target object can rotate with the stepper shaft with a given gearing ratio, or be moved linearly according to a given lead screw pitch.
Detailed description
No detailed description exists yet for this component
Examples
Attaching a primitive to a stepper motor
This example links a panel primitive to the output of the motor.
Stepper Example 1
The linked object can be rotated or moved in a fixed direction by the motor.
Linear movement using a stepper motor
This example links two stepper motors together using linear type movements rather then rotational similar to a stepper attached to a lead screw.
Stepper Example 2
The stepper is linked to the objects on the panel using properties and grouping.
Creating a multi-axis actuator using stepper motors
This example links three stepper motors together using panel primitive objects and groups.
Stepper Example 3
Here we can see the actuator arm in motion.
Downloadable macro reference
|
IncrementStep
|
Move the motor forward by one step.
|
- VOID
|
Return
|
|
SetTarget
|
Assign a panel object to be moved by the motor. Once linked, the object will respond to the 'Motor Simulation' properties, and it will be moved whenever the motor is stepped.
|
[[File:]] -
|
target
|
An object to be moved by the motor.
|
- VOID
|
Return
|
|
DecrementStep
|
Move the motor backwards by one step.
|
- VOID
|
Return
|
|
EnableMotor
|
Turn on the motor. This must be done before it will respond to any other macros.
|
- VOID
|
Return
|
|
DisableMotor
|
Turn off the motor. It will no longer respond to any other macros.
|
- VOID
|
Return
|
|
SetTrim
|
Allows the level of trim for each servo channel to be adjusted progmatically.
|
- BYTE
|
Channel
|
The channel to set the position for. First channel is zero.
|
- BYTE
|
Trim
|
Legacy: 0=0us, 1=+25us, 2=+50us, 3=+75us, 4=+100us, 5=-25us, 6=-50us, 7=-75us, 8=-100us or Smooth: 0-200
|
- VOID
|
Return
|
|
IsAutoMoving
|
Is the AutoMoveToPosition movement complete. Returns 1 if the servos are still moving. Returns 0 if all servo movement is complete.
|
- BYTE
|
Return
|
|
SetAutoMoveSpeedInt
|
Sets the speed of the auto move to position macro. Default speed is shown in the Servo_Period_Multiplier property.
|
- UINT
|
Speed
|
1=Slowest (Default), 2= Double, 3=Triple, 4=Quadruple
|
- VOID
|
Return
|
|
IsServoAutoMoving
|
Is the AutoMoveToPosition movement complete for a specific servo output. Returns 1 if the servo is still moving. Returns 0 if the servo movement is complete.
|
- BYTE
|
Channel
|
Servo Motor Output Range: 0-7
|
- BYTE
|
Return
|
|
AutoMoveToPosition
|
Automatically moves towards the new position at a fixed rate determined by the AutoMoveSpeed.
|
- BYTE
|
Channel
|
The channel to assign the new position. Range: 0-7
|
- BYTE
|
Position
|
Position to automatically move to. Range: 0-255
|
- VOID
|
Return
|
|
EnableServo
|
Enables a servo channel effectivly setting the position of the motor to the value in the local position variable.
|
- BYTE
|
Channel
|
The channel to set the position for. First channel is zero.
|
- VOID
|
Return
|
|
SetAutoMoveSpeed
|
Sets the speed of the auto move to position macro. Default speed is shown in the Servo_Period_Multiplier property.
|
- BYTE
|
Speed
|
1=Slowest (Default), 2= Double, 3=Triple, 4=Quadruple
|
- VOID
|
Return
|
|
AutoMoveToPositionInt
|
Automatically moves towards the new 16-bit position at a fixed rate determined by the AutoMoveSpeed.
|
- BYTE
|
Channel
|
The channel to assign the new position. Range: 0-7
|
- UINT
|
Position
|
Position to automatically move to. Range: 0-65535
|
- VOID
|
Return
|
|
Initialise
|
Sets up the servo motor interrupts
|
- VOID
|
Return
|
|
WriteLEDs
|
Allows control of all 8-LEDs on the front of the Formula Flowcode.
|
- BYTE
|
LED_Byte
|
|
- VOID
|
Return
|
|
Initialise
|
Starts up the formula flowcode PWM for motor control and performs the wait for button press
|
- VOID
|
Return
|
Property reference
|
Properties
|
|
Winding Type
|
The polarity settings of the motor windings. Refer to the data-sheet for your chosen hardware to determine this value.
|
|
Step Type
|
Trade accuracy against torque by changing the type of stepping. Refer to the data-sheet for your chosen hardware to determine which modes your device supports.
|
|
Steps Per Revolution
|
The number of steps it takes for the motor shaft to turn a full circle (360 degrees). Refer to the data-sheet for your chosen hardware to determine this value.
|
|
Object
|
Choose an object here to be linked to the motor. When the motor moves, this object will also be moved according to the settings made in the other properties below. To move multiple objects, first make them into a single group, then set the group as the target.
|
|
Gear Ratio
|
Set a non-zero value here to make the target object rotate whenever the motor spins. The target will revolve around the same axis as the motor's own 'Moving Part' (e.g. drive shaft). A value of 1.00 make the target spin at the same speed as the motor. Choose other values to set the ratio of a 'virtual gearbox' to change the speed of the target's movement.
|
|
X Linear Pitch
|
Set this to a non-zero value to move the target object linearly along its X-Axis whenever the motor spins. The value is the distance to move (world units) per complete rotation of the motor shaft - i.e. it simulates a typical linear drive that uses a lead-screw, with the property value equal to the screw pitch.
|
|
Y Linear Pitch
|
Set this to a non-zero value to move the target object linearly along its Y-Axis whenever the motor spins. The value is the distance to move (world units) per complete rotation of the motor shaft - i.e. it simulates a typical linear drive that uses a lead-screw, with the property value equal to the screw pitch.
|
|
Z Linear Pitch
|
Set this to a non-zero value to move the target object linearly along its Z-Axis whenever the motor spins. The value is the distance to move (world units) per complete rotation of the motor shaft - i.e. it simulates a typical linear drive that uses a lead-screw, with the property value equal to the screw pitch.
|
|
Connections
|
|
Driver
|
|
|
Coil 1
|
Chip pin to which the first motor coil is connected.
|
|
Coil 2
|
Chip pin to which the second motor coil is connected.
|
|
Coil 3
|
Chip pin to which the third motor coil is connected.
|
|
Coil 4
|
Chip pin to which the fourth motor coil is connected.
|
|
Simulations
|
|
Waveforms
|
Allows waveforms to be auto generated on the data recorder window.
|
|
Coil Simulation
|
Turn coil simulation on and off.
|
|
Show Arrow
|
Show an arrow connected to the motor shaft to make it easier to see the position.
|