|
|
| (9 intermediate revisions by 2 users not shown) |
| Line 15: |
Line 15: |
| | DC Motor that can be driven in one or both directions using digital output pins, PWM or HBRIDGE peripherals. | | DC Motor that can be driven in one or both directions using digital output pins, PWM or HBRIDGE peripherals. |
| | | | |
| − | ==Component Source Code== | + | ==Version information== |
| | | | |
| − | Please click here to download the component source project: [https://www.flowcode.co.uk/wikicopy/componentsource/FC_Comp_Source_DCMotor_2d.fcfx FC_Comp_Source_DCMotor_2d.fcfx]
| + | Library Version, Component Version, Date, Author, Info |
| − | | + | 2, 1.2, 13-11-24, BR, Altered property tooltips to make them more meaningful |
| − | 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]
| |
| | | | |
| | ==Detailed description== | | ==Detailed description== |
| Line 29: |
Line 28: |
| | | | |
| | | | |
| − |
| |
| − |
| |
| − |
| |
| − |
| |
| − |
| |
| − |
| |
| − |
| |
| − |
| |
| − | ''No detailed description exists yet for this component''
| |
| − |
| |
| − | ==Examples==
| |
| | | | |
| | | | |
| Line 52: |
Line 40: |
| | | | |
| | | | |
| | + | ''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.
| |
| − | {{Fcfile|DALI_Slave.fcfx|DALI Slave Example1}}
| |
| | | | |
| | + | Simple example showing how to drive the motor component by only using Enable and two port pins. |
| | | | |
| − | For a DALI Master example see: [[Component: DALI Master (Comms: System)]]
| + | {{Fcfile|DC_Motor_pin_control.fcfx|DC Motor pin control}} |
| | | | |
| | ==Macro reference== | | ==Macro reference== |
| | | | |
| | + | ===Break=== |
| | {| 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;" | '''Coast''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Break''' |
| | |- | | |- |
| − | | colspan="2" | Turn off power to the motor by setting the pins according to the 'Coast Pattern' property. | + | | colspan="2" | Actively drives both ends of the motor by setting the pins according to the 'Brake Pattern' property. |
| | |- | | |- |
| | |- | | |- |
| Line 76: |
Line 66: |
| | | | |
| | | | |
| | + | ===Coast=== |
| | {| 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;" | '''Coast''' |
| | |- | | |- |
| − | | colspan="2" | Actively drives both ends of the motor by setting the pins according to the 'Brake Pattern' property. | + | | colspan="2" | Turn off power to the motor by setting the pins according to the 'Coast Pattern' property. |
| | |- | | |- |
| | |- | | |- |
| Line 89: |
Line 80: |
| | | | |
| | | | |
| | + | ===Disable=== |
| | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
| | |- | | |- |
| Line 102: |
Line 94: |
| | | | |
| | | | |
| − | {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| + | ===Enable=== |
| − | |-
| |
| − | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| |
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Forwards'''
| |
| − | |-
| |
| − | | colspan="2" | Set the motor turning in the forwards direction by setting the pins according to the 'Forwards Pattern' property.
| |
| − | |-
| |
| − | |-
| |
| − | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| |
| − | | width="90%" | Duty
| |
| − | |-
| |
| − | | colspan="2" | Sets the motor power for PWM or H-Bridge outputs
| |
| − | |-
| |
| − | | 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 133: |
Line 108: |
| | | | |
| | | | |
| | + | ===Forwards=== |
| | {| 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;" | '''Reverse''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Forwards''' |
| | |- | | |- |
| − | | colspan="2" | Set the motor turning in the reverse direction by setting the pins according to the 'Reverse Pattern' property. | + | | colspan="2" | Set the motor turning in the forwards direction by setting the pins according to the 'Forwards Pattern' property. |
| | |- | | |- |
| | |- | | |- |
| Line 151: |
Line 127: |
| | | | |
| | | | |
| | + | ===GetSimAngle=== |
| | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
| | |- | | |- |
| Line 164: |
Line 141: |
| | | | |
| | | | |
| − | | + | ===Reverse=== |
| − | | |
| − | ==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;" | Control Type
| |
| − | |-
| |
| − | |-
| |
| − | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| |
| − | | width="90%" | Control Method
| |
| − | |-
| |
| − | | colspan="2" | 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
| |
| − | |-
| |
| − | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| |
| − | | width="90%" | Bridge Type
| |
| − | |-
| |
| − | | colspan="2" |
| |
| − | |-
| |
| − | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| |
| − | | width="90%" | Enable Method
| |
| − | |-
| |
| − | | colspan="2" | Decides how the motor outputs are enabled.
| |
| − | |-
| |
| − | | 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-5-icon.png]]
| |
| − | | width="90%" | PinA
| |
| − | |-
| |
| − | | colspan="2" | First control pin - set 'pattern' properties below to set the pin's function.
| |
| − | |-
| |
| − | | width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| |
| − | | width="90%" | PinB
| |
| − | |-
| |
| − | | colspan="2" | Second control pin - set 'pattern' properties below to set the pin's function.
| |
| − | |-
| |
| − | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| |
| − | | width="90%" | Forwards Pattern
| |
| − | |-
| |
| − | | colspan="2" | The state of pins A and B required to drive the motor in a forwards direction.
| |
| − | |-
| |
| − | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| |
| − | | width="90%" | Reverse Pattern
| |
| − | |-
| |
| − | | colspan="2" | States of pins A and B required to drive the motor in a reverse direction.
| |
| − | |-
| |
| − | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| |
| − | | width="90%" | Coast Pattern
| |
| − | |-
| |
| − | | colspan="2" | States of pins A and B required to stop the motor.
| |
| − | |-
| |
| − | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| |
| − | | width="90%" | Brake Pattern
| |
| − | |-
| |
| − | | colspan="2" | States of pins A and B required to stop the motor.
| |
| − | |-
| |
| − | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| |
| − | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation Settings
| |
| − | |-
| |
| − | |-
| |
| − | | width="10%" align="center" | [[File:Fc9-type-2-icon.png]]
| |
| − | | width="90%" | Label Colour
| |
| − | |-
| |
| − | | colspan="2" |
| |
| − | |-
| |
| − | | width="10%" align="center" | [[File:Fc9-type-15-icon.png]]
| |
| − | | width="90%" | Speed
| |
| − | |-
| |
| − | | colspan="2" | Speed of the motor when turned on. Positive speed -> Counter-clockwsie Negative speed -> Clockwise
| |
| − | |}==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;" | '''Coast'''
| |
| − | |-
| |
| − | | colspan="2" | Turn off power to the motor by setting the pins according to the 'Coast 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''
| |
| − | |}
| |
| − | | |
| − | | |
| − | {| 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''
| |
| − | |}
| |
| − | | |
| − | | |
| − | {| 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;" | '''Disable'''
| |
| − | |-
| |
| − | | colspan="2" | Disable the motor output
| |
| − | |-
| |
| − | |-
| |
| − | | 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;" | '''Forwards'''
| |
| − | |-
| |
| − | | colspan="2" | Set the motor turning in the forwards direction by setting the pins according to the 'Forwards Pattern' property.
| |
| − | |-
| |
| − | |-
| |
| − | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| |
| − | | width="90%" | Duty
| |
| − | |-
| |
| − | | colspan="2" | Sets the motor power for PWM or H-Bridge outputs
| |
| − | |-
| |
| − | | 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;" | '''Enable'''
| |
| − | |-
| |
| − | | colspan="2" | Enables the motor output
| |
| − | |-
| |
| − | |-
| |
| − | | 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 328: |
Line 158: |
| | | 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;" | '''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''
| |
| − | |}
| |
| − |
| |
| − |
| |
| | | | |
| | | | |
| Line 360: |
Line 175: |
| | | width="90%" | Control Method | | | width="90%" | Control Method |
| | |- | | |- |
| − | | colspan="2" | 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 | + | | colspan="2" | Controls how the motor is controlled. On/Off requires basic output pins, motor is full speed or stopped. PWM requires a hardware PWM channel and allows the motor speed to be controlled. H-Bridge requires a hardware H-Bridge channel and allows the motor speed to be controlled. |
| | |- | | |- |
| | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] |
| | | width="90%" | Bridge Type | | | width="90%" | Bridge Type |
| | |- | | |- |
| − | | colspan="2" | | + | | colspan="2" | Half Bridge - Motor can only be controlled in one direction. Full Bridge - Motor can be controlled in both directions. |
| | |- | | |- |
| | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] |
| Line 407: |
Line 222: |
| | |- | | |- |
| | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] |
| − | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation Settings | + | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Software PWM Settings |
| − | |-
| |
| − | |-
| |
| − | | width="10%" align="center" | [[File:Fc9-type-2-icon.png]]
| |
| − | | width="90%" | Label Colour
| |
| − | |-
| |
| − | | colspan="2" |
| |
| − | |-
| |
| − | | width="10%" align="center" | [[File:Fc9-type-15-icon.png]]
| |
| − | | width="90%" | Speed
| |
| − | |-
| |
| − | | colspan="2" | Speed of the motor when turned on. Positive speed -> Counter-clockwsie Negative speed -> Clockwise
| |
| − | |}==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;" | '''Coast'''
| |
| − | |-
| |
| − | | colspan="2" | Turn off power to the motor by setting the pins according to the 'Coast 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''
| |
| − | |}
| |
| − | | |
| − | | |
| − | {| 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''
| |
| − | |}
| |
| − | | |
| − | | |
| − | {| 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;" | '''Disable'''
| |
| − | |-
| |
| − | | colspan="2" | Disable the motor output
| |
| − | |-
| |
| − | |-
| |
| − | | 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;" | '''Forwards'''
| |
| − | |-
| |
| − | | colspan="2" | Set the motor turning in the forwards direction by setting the pins according to the 'Forwards Pattern' property.
| |
| − | |-
| |
| − | |-
| |
| − | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| |
| − | | width="90%" | Duty
| |
| − | |-
| |
| − | | colspan="2" | Sets the motor power for PWM or H-Bridge outputs
| |
| − | |-
| |
| − | | 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;" | '''Enable'''
| |
| − | |-
| |
| − | | colspan="2" | Enables the motor output
| |
| − | |-
| |
| − | |-
| |
| − | | 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;" | '''Reverse'''
| |
| − | |-
| |
| − | | colspan="2" | Set the motor turning in the reverse direction by setting the pins according to the 'Reverse Pattern' property.
| |
| − | |-
| |
| − | |-
| |
| − | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| |
| − | | width="90%" | Duty
| |
| − | |-
| |
| − | | colspan="2" | Sets the motor power for PWM or H-Bridge outputs
| |
| − | |-
| |
| − | | 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;" | '''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''
| |
| − | |}
| |
| − | | |
| − | | |
| − | | |
| − | | |
| − | ==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;" | Control Type
| |
| | |- | | |- |
| | |- | | |- |
| | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] |
| − | | width="90%" | Control Method | + | | width="90%" | Timer |
| | |- | | |- |
| − | | colspan="2" | 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 | + | | colspan="2" | Timer Peripheral to use to monitor the passage of time. |
| | |- | | |- |
| | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] |
| − | | width="90%" | Bridge Type | + | | width="90%" | Prescaler |
| | |- | | |- |
| − | | colspan="2" | | + | | colspan="2" | Scaler applied to the timer, Small scalers allow for finer resolution but will limit the max time and also put more load on the microcontroller. Recommended to use as large a setting as possible which still provides enough accuracy. |
| | |- | | |- |
| − | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | + | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] |
| − | | width="90%" | Enable Method | + | | width="90%" | Resolution |
| | |- | | |- |
| − | | colspan="2" | Decides how the motor outputs are enabled. | + | | colspan="2" | Number of discrete values that the duty can have. e.g. 16 would allow duty values of 0-15 Recommend keeping this value low to avoid excessive amounts of interrupts. |
| | |- | | |- |
| − | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | + | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] |
| − | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Connections | + | | width="90%" | Frequency (Hz) |
| | |- | | |- |
| | + | | colspan="2" | The frequency of the PWM output in Hz. Recommend keeping this low as possible to avoid having excessive amounts of interrupts. |
| | |- | | |- |
| − | | width="10%" align="center" | [[File:Fc9-type-5-icon.png]] | + | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] |
| − | | width="90%" | PinA | + | | width="90%" | Required Interrupt Rate (Hz) |
| | |- | | |- |
| − | | colspan="2" | First control pin - set 'pattern' properties below to set the pin's function. | + | | colspan="2" | The calculated required rate of interrupts |
| | |- | | |- |
| − | | width="10%" align="center" | [[File:Fc9-type-5-icon.png]] | + | | width="10%" align="center" | [[File:Fc9-type-15-icon.png]] |
| − | | width="90%" | PinB | + | | width="90%" | Accuracy |
| − | |-
| |
| − | | colspan="2" | Second control pin - set 'pattern' properties below to set the pin's function.
| |
| − | |-
| |
| − | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| |
| − | | width="90%" | Forwards Pattern
| |
| | |- | | |- |
| − | | colspan="2" | The state of pins A and B required to drive the motor in a forwards direction. | + | | colspan="2" | How close we can get to the required timings with the selected timer and prescaler |
| | |- | | |- |
| | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] |
| − | | width="90%" | Reverse Pattern | + | | width="90%" | Off Time Setting |
| − | |-
| |
| − | | colspan="2" | States of pins A and B required to drive the motor in a reverse direction.
| |
| | |- | | |- |
| − | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| + | | colspan="2" | Decides what to do when output PWM output is low. |
| − | | width="90%" | Coast Pattern
| |
| − | |-
| |
| − | | colspan="2" | States of pins A and B required to stop the motor.
| |
| − | |-
| |
| − | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| |
| − | | width="90%" | Brake Pattern
| |
| − | |-
| |
| − | | colspan="2" | States of pins A and B required to stop the motor. | |
| | |- | | |- |
| | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] |
| Line 599: |
Line 274: |
| | | colspan="2" | Speed of the motor when turned on. Positive speed -> Counter-clockwsie Negative speed -> Clockwise | | | colspan="2" | Speed of the motor when turned on. Positive speed -> Counter-clockwsie Negative speed -> Clockwise |
| | |} | | |} |
| | + | |
| | + | ==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 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] |