Jump to content

Component: DC Motor (): Difference between revisions

From Flowcode Help
No edit summary
No edit summary
Line 16: Line 16:


==Detailed description==
==Detailed description==




Line 24: Line 26:


==Examples==
==Examples==





Revision as of 13:34, 17 November 2021

Author Matrix Ltd.
Version 1.2
Category


DC Motor component

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

Detailed description

No detailed description exists yet for this component

Examples

Simple example showing how to drive the motor components and how to create sub assemblies attached to the motor output shafts in the simulation panels. Motors

Downloadable macro reference

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


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


Disable
Disable the motor output 
- VOID Return


Forwards
Set the motor turning in the forwards 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


Enable
Enables the motor output 
- VOID Return


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 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. 
Channel
PWM Channel selector 
Alt Pin Enable
Alternative Pin Enable (if available on target device) 
Port
 
Remap Pin
 
Period Register
PWM Period Register value 
Prescaler Divide
Prescaler Divider value 
PWM Timer
Timer associated with PWM to drive the output. Warning - All PWM channels linked to the same timer will share the same period and prescaler settings. 
Frequency (KHz)
 
Direction Pin
 
Channel
PWM Channel selector 
Polarity
Selects the active output voltage. Active high - Pins will be low when inactive and high when active. Active Low- Pins will be high when inactive and low when active. 
Timer
Timer associated with PWM to drive the output. Warning - All PWM channels linked to the same timer will share the same period and prescaler settings. 
Prescaler Divide
Prescaler Divider value 
Period Register
PWM Period Register value 
A Pin
Output Pin A 
B Pin
Output Pin B 
C Pin
Output Pin C 
D Pin
Output Pin D 
A Remap Pin
Remap Pin A - Specifies the pin used for the A output. Only available on devices supporting remappable hardware pins. 
B Remap Pin
Remap Pin B - Specifies the pin used for the B output. Only available on devices supporting remappable hardware pins. 
C Remap Pin
Remap Pin C - Specifies the pin used for the C output. Only available on devices supporting remappable hardware pins. 
D Remap Pin
Remap Pin D - Specifies the pin used for the D output. Only available on devices supporting remappable hardware pins. 
Frequency (KHz)
Calculated PWM output frequency in KHz. 
Rising Bits
Number of bits assigned to the rising edge dead band counter. Auto populated based on selected target chip. 
Falling Bits
Number of bits assigned to the falling edge dead band counter. Auto populated based on selected target chip. 
Rising Count
Number of cycles to wait after a falling edge and before a rising edge. 
Falling Count
Number of cycles to wait after a rising edge and before a falling edge. 
Speed
Speed of the motor when turned on. Positive speed -> Counter-clockwsie Negative speed -> Clockwise  
Acceleration
Speed change per second when the motor us powered. Set to zero for instantaneous speed changes.  
Deceleration
Speed change per second when the motor is coasting with no power. Set to zero for instantaneous speed changes. 
Show Actuator
When active, an actuator is shown on the motor spindle to make the animation easier to observe. 
Forwards Direction
Which way the motor will rotate when the 'forwards' command is sent. 
Target Object
An object or group to link the motor to - the object will move along with the motor. 
Connections
PinA
First 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. 
Simulations