Jump to content

Component: DC Motor (Mechatronics): Difference between revisions

From Flowcode Help
No edit summary
No edit summary
Line 17: Line 17:
==Component Source Code==
==Component Source Code==


Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_DCMotor_2d.fcfx FC_Comp_Source_DCMotor_2d.fcfx]
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_temp/DCMotor_2d.fcfx FC_Comp_Source_temp/DCMotor_2d.fcfx]


Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_DCMotor_2d.fcfx FC_Comp_Source_DCMotor_2d.fcfx]
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_temp/DCMotor_2d.fcfx FC_Comp_Source_temp/DCMotor_2d.fcfx]


==Detailed description==
==Detailed description==
Line 68: Line 68:


For a DALI Master example see: [[Component: DALI Master (Comms: System)]]
For a DALI Master example see: [[Component: DALI Master (Comms: System)]]




Line 74: Line 76:


==Macro reference==
==Macro reference==
===Break===
{| 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;" | '''Break'''
|-
| colspan="2" | Actively drives both ends of the motor by setting the pins according to the 'Brake Pattern' property. 
|-
|-
| 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''
|}


===Coast===
===Coast===
Line 89: Line 105:




===Break===
===Disable===
{| 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;" | '''Break'''
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Disable'''
|-
|-
| colspan="2" | Actively drives both ends of the motor by setting the pins according to the 'Brake Pattern' property. 
| colspan="2" | Disable the motor output 
|-
|-
|-
|-
Line 103: Line 119:




===Disable===
===Enable===
{| 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;" | '''Disable'''
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Enable'''
|-
|-
| colspan="2" | Disable the motor output 
| colspan="2" | Enables the motor output 
|-
|-
|-
|-
Line 136: Line 152:




===Enable===
===GetSimAngle===
{| 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;" | '''Enable'''
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetSimAngle'''
|-
|-
| colspan="2" | Enables the motor output 
| colspan="2" | Gets the angle of the simulated motor shaft in degrees. 
|-
|-
|-
|-
| 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-f32-icon.png]] - FLOAT
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}
Line 165: Line 181:
|-
|-
| 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
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
===GetSimAngle===
{| 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;" | '''GetSimAngle'''
|-
| colspan="2" | Gets the angle of the simulated motor shaft in degrees. 
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-f32-icon.png]] - FLOAT
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}

Revision as of 11:59, 3 February 2023

Author Matrix TSL
Version 1.2
Category Mechatronics


DC Motor component

DC Motor that can be driven in one or both directions using digital output pins, PWM or HBRIDGE peripherals.

Component Source Code

Please click here to download the component source project: FC_Comp_Source_temp/DCMotor_2d.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_temp/DCMotor_2d.fcfx

Detailed description

No detailed description exists yet for this component

Examples

DALI Slave Example, listens for DALI messages and checks that the group is correct before attempting to process the request and if required reply to the master. DALI Slave Example1


For a DALI Master example see: Component: DALI Master (Comms: System)




Macro reference

Break

Break
Actively drives both ends of the motor by setting the pins according to the 'Brake Pattern' property. 
- VOID Return


Coast

Coast
Turn off power to the motor by setting the pins according to the 'Coast Pattern' property. 
- VOID Return


Disable

Disable
Disable the motor output 
- VOID Return


Enable

Enable
Enables the motor output 
- VOID Return


Forwards

Forwards
Set the motor turning in the forwards direction by setting the pins according to the 'Forwards Pattern' property. 
- UINT Duty
Sets the motor power for PWM or H-Bridge outputs 
- VOID Return


GetSimAngle

GetSimAngle
Gets the angle of the simulated motor shaft in degrees. 
- FLOAT Return


Reverse

Reverse
Set the motor turning in the reverse direction by setting the pins according to the 'Reverse Pattern' property. 
- UINT Duty
Sets the motor power for PWM or H-Bridge outputs 
- VOID Return



Property reference

Properties
Control Type
Control Method
Controls how the motor is controlled. On/Off requires output pins PWM requires a hardware PWM channel H-Bridge requires a hardware H-Bridge channel 
Bridge Type
 
Enable Method
Decides how the motor outputs are enabled. 
Connections
PinA
First control pin - set 'pattern' properties below to set the pin's function. 
PinB
Second control pin - set 'pattern' properties below to set the pin's function. 
Forwards Pattern
The state of pins A and B required to drive the motor in a forwards direction. 
Reverse Pattern
States of pins A and B required to drive the motor in a reverse direction. 
Coast Pattern
States of pins A and B required to stop the motor. 
Brake Pattern
States of pins A and B required to stop the motor. 
Simulation Settings
Label Colour
 
Speed
Speed of the motor when turned on. Positive speed -> Counter-clockwsie Negative speed -> Clockwise