Difference between revisions of "Component: Stepper Motor Template (Mechatronics)"
From Flowcode Help
Jump to navigationJump to search(15 intermediate revisions by the same user not shown) | |||
Line 14: | Line 14: | ||
==Stepper Motor Template component== | ==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. | 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: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_Stepper_Motor_Base.fcfx FC_Comp_Source_Stepper_Motor_Base.fcfx] | ||
+ | |||
+ | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_Stepper_Motor_Base.fcfx FC_Comp_Source_Stepper_Motor_Base.fcfx] | ||
==Detailed description== | ==Detailed description== | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
''No detailed description exists yet for this component'' | ''No detailed description exists yet for this component'' | ||
Line 22: | Line 44: | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | ||
− | + | ''<span style="color:red;">No additional examples</span>'' | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
+ | ==Macro reference== | ||
+ | ===DecrementStep=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''DecrementStep''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Move the motor backwards by one step. |
|- | |- | ||
|- | |- | ||
− | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | |
− | |||
− | |||
− | |||
− | |||
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | ||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
+ | ===DisableMotor=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''DisableMotor''' |
− | |||
− | |||
|- | |- | ||
+ | | colspan="2" | Turn off the motor. It will no longer respond to any other macros. | ||
|- | |- | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
Line 215: | Line 103: | ||
+ | ===EnableMotor=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''EnableMotor''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Turn on the motor. This must be done before it will respond to any other macros. |
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | |||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
Line 233: | Line 117: | ||
+ | ===IncrementStep=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''IncrementStep''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Move the motor forward by one step. |
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | |||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
Line 251: | Line 131: | ||
+ | ===SetTarget=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetTarget''' |
|- | |- | ||
− | | colspan="2" | | + | | 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. |
|- | |- | ||
|- | |- | ||
− | | width="10%" align="center" | [[File:Fc9- | + | | width="10%" align="center" | [[File:Fc9-h32-icon.png]] - HANDLE |
− | | width="90%" | | + | | width="90%" | target |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | An object to be moved by the motor. |
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
Line 273: | Line 149: | ||
|} | |} | ||
+ | |||
+ | ==Property reference== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
− | | width="10%" align="center" style="background-color:#D8C9D8; | + | | width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]] |
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | 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% | + | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] |
− | | width="90% | + | | width="90%" | Driver |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | |
|- | |- | ||
+ | | 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. |
− | |||
|- | |- | ||
− | | | + | | 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. |
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | | width="10% | + | | width="10%" align="center" | [[File:Fc9-type-5-icon.png]] |
− | | width="90% | + | | width="90%" | Coil 3 |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Chip pin to which the third motor coil is connected. |
|- | |- | ||
+ | | 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. |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | | width="10%" align="center" style="background-color:# | + | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] |
− | | width="90%" style="background-color:# | + | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Motor Setup |
|- | |- | ||
|- | |- | ||
Line 347: | Line 210: | ||
|- | |- | ||
| colspan="2" | Amount of change in the shaft angle when the IncrementStep / DecrementStep functions are called. | | colspan="2" | Amount of change in the shaft angle when the IncrementStep / DecrementStep functions are called. | ||
+ | |- | ||
+ | | 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="10%" align="center" | [[File:Fc9-type-17-icon.png]] | ||
Line 362: | Line 229: | ||
|- | |- | ||
| colspan="2" | The axis of the 'Rotaion Centre' object around which the 'Rotating Part' will rotate. | | colspan="2" | The axis of the 'Rotaion Centre' object around which the 'Rotating Part' will rotate. | ||
+ | |- | ||
+ | | 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="10%" align="center" | [[File:Fc9-type-7-icon.png]] | ||
Line 402: | Line 273: | ||
|- | |- | ||
| colspan="2" | Make the coil objects this colour when they ARE energised,. | | colspan="2" | Make the coil objects this colour when they ARE energised,. | ||
+ | |- | ||
+ | | 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="10%" align="center" | [[File:Fc9-type-15-icon.png]] | ||
Line 422: | Line 297: | ||
|- | |- | ||
| 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. | | 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. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|} | |} |
Latest revision as of 11:57, 3 November 2023
Author | Matrix Ltd |
Version | 1.2 |
Category | Mechatronics |
Contents
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
DecrementStep | |
Move the motor backwards by one step. | |
- VOID | Return |
DisableMotor
DisableMotor | |
Turn off the motor. It will no longer respond to any other macros. | |
- VOID | Return |
EnableMotor
EnableMotor | |
Turn on the motor. This must be done before it will respond to any other macros. | |
- VOID | Return |
IncrementStep
IncrementStep | |
Move the motor forward by one step. | |
- VOID | Return |
SetTarget