Difference between revisions of "Component: Stepper Motor Template (Mechatronics)"

From Flowcode Help
Jump to navigationJump to search
 
(5 intermediate revisions by the same user not shown)
Line 22: Line 22:
  
 
==Detailed description==
 
==Detailed description==
 +
 +
  
  
Line 55: Line 57:
  
  
''<span style="color:red;">No additional examples</span>''
 
  
==Macro reference==
 
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
+
''<span style="color:red;">No additional examples</span>''
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''IncrementStep'''
 
|-
 
| colspan="2" | Move the motor forward by one step.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetTarget'''
 
|-
 
| colspan="2" | 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.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-h32-icon.png]] - HANDLE
 
| width="90%" | target
 
|-
 
| colspan="2" | An object to be moved by the motor.&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''DecrementStep'''
 
|-
 
| colspan="2" | Move the motor backwards by one step.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''EnableMotor'''
 
|-
 
| colspan="2" | Turn on the motor.  This must be done before it will respond to any other macros.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''DisableMotor'''
 
|-
 
| colspan="2" | Turn off the motor.  It will no longer respond to any other macros.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
  
  
==Property reference==
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Connections
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | Driver
 
|-
 
| colspan="2" | &nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
| width="90%" | Coil 1
 
|-
 
| colspan="2" | Chip pin to which the first motor coil is connected.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
| width="90%" | Coil 2
 
|-
 
| colspan="2" | Chip pin to which the second motor coil is connected.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
| width="90%" | Coil 3
 
|-
 
| colspan="2" | Chip pin to which the third motor coil is connected.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
| width="90%" | Coil 4
 
|-
 
| colspan="2" | Chip pin to which the fourth motor coil is connected.&nbsp;
 
|-
 
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Motor Setup
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | Winding Type
 
|-
 
| colspan="2" | The polarity settings of the motor windings. Refer to the data-sheet for your chosen hardware to determine this value.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | Step Type
 
|-
 
| colspan="2" | 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.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 
| width="90%" | Steps Per Revolution
 
|-
 
| colspan="2" | 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.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-15-icon.png]]
 
| width="90%" | Angle Increment
 
|-
 
| colspan="2" | Amount of change in the shaft angle when the IncrementStep / DecrementStep functions are called.&nbsp;
 
|-
 
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Motor Simulation
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
 
| width="90%" | Rotating Part
 
|-
 
| colspan="2" | Select a panel object here that will represent the moving part of the motor - for example, an output shaft or actuator.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
 
| width="90%" | Rotation Centre
 
|-
 
| colspan="2" | Select a panel object to be the centre of rotation of the 'Rotating Part'.  If non is chosen, the 'Rotating Part' will revove around its own axes.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | Rotate Around
 
|-
 
| colspan="2" | The axis of the 'Rotaion Centre' object around which the 'Rotating Part' will rotate.&nbsp;
 
|-
 
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Coil Simulation
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
| width="90%" | Waveforms
 
|-
 
| colspan="2" | Allows waveforms to be auto generated on the data recorder window.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
| width="90%" | Coil Simulation
 
|-
 
| colspan="2" | Turn coil simulation on and off.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
 
| width="90%" | Coil 1
 
|-
 
| colspan="2" | Choose a panel object to represent the first coil.  The simulation will automatically change this object's color to visualise when it is energised.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
 
| width="90%" | Coil 2
 
|-
 
| colspan="2" | Choose a panel object to represent the second coil.  The simulation will automatically change this object's color to visualise when it is energised.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
 
| width="90%" | Coil 3
 
|-
 
| colspan="2" | Choose a panel object to represent the third coil.  The simulation will automatically change this object's color to visualise when it is energised.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
 
| width="90%" | Coil 4
 
|-
 
| colspan="2" | Choose a panel object to represent the fourth coil.  The simulation will automatically change this object's color to visualise when it is energised.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-1-icon.png]]
 
| width="90%" | Colour Non Active Coil
 
|-
 
| colspan="2" | Make coil object this colour when they are NOT energised.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-1-icon.png]]
 
| width="90%" | Colour Active Coil
 
|-
 
| colspan="2" | Make the coil objects this colour when they ARE energised,.&nbsp;
 
|-
 
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Target Object
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-15-icon.png]]
 
| width="90%" | Gear Ratio
 
|-
 
| colspan="2" | 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.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-15-icon.png]]
 
| width="90%" | X Linear Pitch
 
|-
 
| colspan="2" | 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.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-15-icon.png]]
 
| width="90%" | Y Linear Pitch
 
|-
 
| colspan="2" | 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.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-15-icon.png]]
 
| width="90%" | Z Linear Pitch
 
|-
 
| colspan="2" | 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.&nbsp;
 
|}==Macro reference==
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''IncrementStep'''
 
|-
 
| colspan="2" | Move the motor forward by one step.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetTarget'''
 
|-
 
| colspan="2" | 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.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-h32-icon.png]] - HANDLE
 
| width="90%" | target
 
|-
 
| colspan="2" | An object to be moved by the motor.&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
 +
==Macro reference==
  
 +
===DecrementStep===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 324: Line 89:
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
+
===DisableMotor===
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''EnableMotor'''
 
|-
 
| colspan="2" | Turn on the motor.  This must be done before it will respond to any other macros.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 350: Line 103:
  
  
 
+
===EnableMotor===
 
 
==Property reference==
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Connections
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | Driver
 
|-
 
| colspan="2" | &nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
| width="90%" | Coil 1
 
|-
 
| colspan="2" | Chip pin to which the first motor coil is connected.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
| width="90%" | Coil 2
 
|-
 
| colspan="2" | Chip pin to which the second motor coil is connected.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
| width="90%" | Coil 3
 
|-
 
| colspan="2" | Chip pin to which the third motor coil is connected.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
| width="90%" | Coil 4
 
|-
 
| colspan="2" | Chip pin to which the fourth motor coil is connected.&nbsp;
 
|-
 
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Motor Setup
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | Winding Type
 
|-
 
| colspan="2" | The polarity settings of the motor windings. Refer to the data-sheet for your chosen hardware to determine this value.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | Step Type
 
|-
 
| colspan="2" | 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.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 
| width="90%" | Steps Per Revolution
 
|-
 
| colspan="2" | 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.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-15-icon.png]]
 
| width="90%" | Angle Increment
 
|-
 
| colspan="2" | Amount of change in the shaft angle when the IncrementStep / DecrementStep functions are called.&nbsp;
 
|-
 
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Motor Simulation
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
 
| width="90%" | Rotating Part
 
|-
 
| colspan="2" | Select a panel object here that will represent the moving part of the motor - for example, an output shaft or actuator.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
 
| width="90%" | Rotation Centre
 
|-
 
| colspan="2" | Select a panel object to be the centre of rotation of the 'Rotating Part'.  If non is chosen, the 'Rotating Part' will revove around its own axes.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | Rotate Around
 
|-
 
| colspan="2" | The axis of the 'Rotaion Centre' object around which the 'Rotating Part' will rotate.&nbsp;
 
|-
 
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Coil Simulation
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
| width="90%" | Waveforms
 
|-
 
| colspan="2" | Allows waveforms to be auto generated on the data recorder window.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
| width="90%" | Coil Simulation
 
|-
 
| colspan="2" | Turn coil simulation on and off.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
 
| width="90%" | Coil 1
 
|-
 
| colspan="2" | Choose a panel object to represent the first coil.  The simulation will automatically change this object's color to visualise when it is energised.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
 
| width="90%" | Coil 2
 
|-
 
| colspan="2" | Choose a panel object to represent the second coil.  The simulation will automatically change this object's color to visualise when it is energised.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
 
| width="90%" | Coil 3
 
|-
 
| colspan="2" | Choose a panel object to represent the third coil.  The simulation will automatically change this object's color to visualise when it is energised.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
 
| width="90%" | Coil 4
 
|-
 
| colspan="2" | Choose a panel object to represent the fourth coil.  The simulation will automatically change this object's color to visualise when it is energised.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-1-icon.png]]
 
| width="90%" | Colour Non Active Coil
 
|-
 
| colspan="2" | Make coil object this colour when they are NOT energised.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-1-icon.png]]
 
| width="90%" | Colour Active Coil
 
|-
 
| colspan="2" | Make the coil objects this colour when they ARE energised,.&nbsp;
 
|-
 
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Target Object
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-15-icon.png]]
 
| width="90%" | Gear Ratio
 
|-
 
| colspan="2" | 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.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-15-icon.png]]
 
| width="90%" | X Linear Pitch
 
|-
 
| colspan="2" | 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.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-15-icon.png]]
 
| width="90%" | Y Linear Pitch
 
|-
 
| colspan="2" | 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.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-15-icon.png]]
 
| width="90%" | Z Linear Pitch
 
|-
 
| colspan="2" | 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.&nbsp;
 
|}==Macro reference==
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''IncrementStep'''
 
|-
 
| colspan="2" | Move the motor forward by one step.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetTarget'''
 
|-
 
| colspan="2" | 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.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-h32-icon.png]] - HANDLE
 
| width="90%" | target
 
|-
 
| colspan="2" | An object to be moved by the motor.&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''DecrementStep'''
 
|-
 
| colspan="2" | Move the motor backwards by one step.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 558: Line 117:
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
+
===IncrementStep===
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''DisableMotor'''
 
|-
 
| colspan="2" | Turn off the motor.  It will no longer respond to any other macros.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
 
 
 
 
==Property reference==
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Connections
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | Driver
 
|-
 
| colspan="2" | &nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
| width="90%" | Coil 1
 
|-
 
| colspan="2" | Chip pin to which the first motor coil is connected.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
| width="90%" | Coil 2
 
|-
 
| colspan="2" | Chip pin to which the second motor coil is connected.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
| width="90%" | Coil 3
 
|-
 
| colspan="2" | Chip pin to which the third motor coil is connected.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
| width="90%" | Coil 4
 
|-
 
| colspan="2" | Chip pin to which the fourth motor coil is connected.&nbsp;
 
|-
 
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Motor Setup
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | Winding Type
 
|-
 
| colspan="2" | The polarity settings of the motor windings. Refer to the data-sheet for your chosen hardware to determine this value.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | Step Type
 
|-
 
| colspan="2" | 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.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 
| width="90%" | Steps Per Revolution
 
|-
 
| colspan="2" | 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.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-15-icon.png]]
 
| width="90%" | Angle Increment
 
|-
 
| colspan="2" | Amount of change in the shaft angle when the IncrementStep / DecrementStep functions are called.&nbsp;
 
|-
 
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Motor Simulation
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
 
| width="90%" | Rotating Part
 
|-
 
| colspan="2" | Select a panel object here that will represent the moving part of the motor - for example, an output shaft or actuator.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
 
| width="90%" | Rotation Centre
 
|-
 
| colspan="2" | Select a panel object to be the centre of rotation of the 'Rotating Part'.  If non is chosen, the 'Rotating Part' will revove around its own axes.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | Rotate Around
 
|-
 
| colspan="2" | The axis of the 'Rotaion Centre' object around which the 'Rotating Part' will rotate.&nbsp;
 
|-
 
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Coil Simulation
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
| width="90%" | Waveforms
 
|-
 
| colspan="2" | Allows waveforms to be auto generated on the data recorder window.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
| width="90%" | Coil Simulation
 
|-
 
| colspan="2" | Turn coil simulation on and off.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
 
| width="90%" | Coil 1
 
|-
 
| colspan="2" | Choose a panel object to represent the first coil.  The simulation will automatically change this object's color to visualise when it is energised.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
 
| width="90%" | Coil 2
 
|-
 
| colspan="2" | Choose a panel object to represent the second coil.  The simulation will automatically change this object's color to visualise when it is energised.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
 
| width="90%" | Coil 3
 
|-
 
| colspan="2" | Choose a panel object to represent the third coil.  The simulation will automatically change this object's color to visualise when it is energised.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
 
| width="90%" | Coil 4
 
|-
 
| colspan="2" | Choose a panel object to represent the fourth coil.  The simulation will automatically change this object's color to visualise when it is energised.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-1-icon.png]]
 
| width="90%" | Colour Non Active Coil
 
|-
 
| colspan="2" | Make coil object this colour when they are NOT energised.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-1-icon.png]]
 
| width="90%" | Colour Active Coil
 
|-
 
| colspan="2" | Make the coil objects this colour when they ARE energised,.&nbsp;
 
|-
 
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Target Object
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-15-icon.png]]
 
| width="90%" | Gear Ratio
 
|-
 
| colspan="2" | 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.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-15-icon.png]]
 
| width="90%" | X Linear Pitch
 
|-
 
| colspan="2" | 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.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-15-icon.png]]
 
| width="90%" | Y Linear Pitch
 
|-
 
| colspan="2" | 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.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-15-icon.png]]
 
| width="90%" | Z Linear Pitch
 
|-
 
| colspan="2" | 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.&nbsp;
 
|}==Macro reference==
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 735: Line 131:
  
  
 +
===SetTarget===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 751: Line 148:
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''DecrementStep'''
 
|-
 
| colspan="2" | Move the motor backwards by one step.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''EnableMotor'''
 
|-
 
| colspan="2" | Turn on the motor.  This must be done before it will respond to any other macros.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''DisableMotor'''
 
|-
 
| colspan="2" | Turn off the motor.  It will no longer respond to any other macros.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
  
  

Latest revision as of 11:57, 3 November 2023

Author Matrix Ltd
Version 1.2
Category Mechatronics


Stepper Motor Template component

Enables the creation of a stepper motor component by specifying objects for its appearance. 'Attach to...' property should be exposed in any components buit from this - this sets a target object to be joined to the motor shaft. The target can then be rotated around the axis with a custom gear ration, or moved linearly according to the pitch of a given lead screw.

Component Source Code

Please click here to download the component source project: FC_Comp_Source_Stepper_Motor_Base.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_Stepper_Motor_Base.fcfx

Detailed description

No detailed description exists yet for this component

Examples

No additional examples







Macro reference

DecrementStep

Fc9-comp-macro.png DecrementStep
Move the motor backwards by one step. 
Fc9-void-icon.png - VOID Return


DisableMotor

Fc9-comp-macro.png DisableMotor
Turn off the motor. It will no longer respond to any other macros. 
Fc9-void-icon.png - VOID Return


EnableMotor

Fc9-comp-macro.png EnableMotor
Turn on the motor. This must be done before it will respond to any other macros. 
Fc9-void-icon.png - VOID Return


IncrementStep

Fc9-comp-macro.png IncrementStep
Move the motor forward by one step. 
Fc9-void-icon.png - VOID Return


SetTarget

Fc9-comp-macro.png 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. 
Fc9-h32-icon.png - HANDLE target
An object to be moved by the motor. 
Fc9-void-icon.png - VOID Return


Property reference

Fc9-prop-icon.png Properties
Fc9-conn-icon.png Connections
Fc9-type-16-icon.png Driver
 
Fc9-type-5-icon.png Coil 1
Chip pin to which the first motor coil is connected. 
Fc9-type-5-icon.png Coil 2
Chip pin to which the second motor coil is connected. 
Fc9-type-5-icon.png Coil 3
Chip pin to which the third motor coil is connected. 
Fc9-type-5-icon.png Coil 4
Chip pin to which the fourth motor coil is connected. 
Fc9-conn-icon.png Motor Setup
Fc9-type-16-icon.png Winding Type
The polarity settings of the motor windings. Refer to the data-sheet for your chosen hardware to determine this value. 
Fc9-type-16-icon.png 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. 
Fc9-type-14-icon.png 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. 
Fc9-type-15-icon.png Angle Increment
Amount of change in the shaft angle when the IncrementStep / DecrementStep functions are called. 
Fc9-conn-icon.png Motor Simulation
Fc9-type-17-icon.png Rotating Part
Select a panel object here that will represent the moving part of the motor - for example, an output shaft or actuator. 
Fc9-type-17-icon.png Rotation Centre
Select a panel object to be the centre of rotation of the 'Rotating Part'. If non is chosen, the 'Rotating Part' will revove around its own axes. 
Fc9-type-16-icon.png Rotate Around
The axis of the 'Rotaion Centre' object around which the 'Rotating Part' will rotate. 
Fc9-conn-icon.png Coil Simulation
Fc9-type-7-icon.png Waveforms
Allows waveforms to be auto generated on the data recorder window. 
Fc9-type-7-icon.png Coil Simulation
Turn coil simulation on and off. 
Fc9-type-17-icon.png Coil 1
Choose a panel object to represent the first coil. The simulation will automatically change this object's color to visualise when it is energised. 
Fc9-type-17-icon.png Coil 2
Choose a panel object to represent the second coil. The simulation will automatically change this object's color to visualise when it is energised. 
Fc9-type-17-icon.png Coil 3
Choose a panel object to represent the third coil. The simulation will automatically change this object's color to visualise when it is energised. 
Fc9-type-17-icon.png Coil 4
Choose a panel object to represent the fourth coil. The simulation will automatically change this object's color to visualise when it is energised. 
Fc9-type-1-icon.png Colour Non Active Coil
Make coil object this colour when they are NOT energised. 
Fc9-type-1-icon.png Colour Active Coil
Make the coil objects this colour when they ARE energised,. 
Fc9-conn-icon.png Target Object
Fc9-type-15-icon.png 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. 
Fc9-type-15-icon.png 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. 
Fc9-type-15-icon.png 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. 
Fc9-type-15-icon.png 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.