Jump to content

Component: Car Seat (Scenarios): Difference between revisions

From Flowcode Help
XML import
 
m Text replacement - "width="90%" style="background-color:#D8C9D8; color:#4B008D;"" to "width="90%" class="mtx-class-macrohead""
 
(21 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
{| style="width:50%"
 
{| width="50%"
|-
|-
| width="20%" style="color: gray;" | Author
| width="20%" style="color:gray;" | Author
| Matrix TSL
| Matrix TSL
|-
|-
| width="20%" style="color: gray;" | Version
| width="20%" style="color:gray;" | Version
| 1.0 (Release)
| 1.0
|-
|-
| width="20%" style="color: gray;" | Category
| width="20%" style="color:gray;" | Category
| Scenarios
| Scenarios
|}
|}




==Car Seat component==
An electric car seat chassis with a series of motors and sensors. Students should work through exercises to learn the principles of electric car seats including how to save and load memory positions.


==[[File:Component Icon fde30de0_35ed_40ca_937a_88da6409c1d2.png|Image]] Car Seat component==
==Component Source Code==
An electric car seat chassis with a series of motors and sensors. Students should work
through exercises to learn the principles of electric car seats including how to save
and load memory positions.


==Examples==
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_CarSeatSource_v004.fcfx FC_Comp_Source_CarSeatSource_v004.fcfx]
''<span style="color:red;">No additional examples</span>''


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


==Downloadable macro reference==
==Detailed description==


''This component does not contain any downloadable macros''


==Simulation macro reference==


===<span style="font-weight: normal;"><u><tt>Save</tt></u></span>===
''<span style="color:red;">No additional information</span>''






'''Parameters'''


:[[Variable Types|BYTE]] ''SavePos''
::0 = pos A, 1 = pos B




'''Return value'''


:''This call does not return a value''




===<span style="font-weight: normal;"><u><tt>Load</tt></u></span>===
''<span style="color:red;">No additional information</span>''






'''Parameters'''


:[[Variable Types|BYTE]] ''Location''
::0 = A, 1 = B




'''Return value'''


:''This call does not return a value''
''No detailed description exists yet for this component''


==Examples==


===<span style="font-weight: normal;"><u><tt>Encoder3</tt></u></span>===
Returns value is equal to Rear Z Axis current value.


'''Parameters'''


:''This macro has no parameters''




'''Return value'''


:[[Variable Types|INT]]




===<span style="font-weight: normal;"><u><tt>Encoder2</tt></u></span>===
Returns value is equal to Front Z Axis current value.


'''Parameters'''


:''This macro has no parameters''




'''Return value'''


:[[Variable Types|INT]]




===<span style="font-weight: normal;"><u><tt>Encoder1</tt></u></span>===
Returns value is equal to X Axis current value (forward/ backwards movement).


'''Parameters'''


:''This macro has no parameters''




'''Return value'''


:[[Variable Types|INT]]
There is a detailed walk through of the scenario detailed at the link below to go with this component.


[[Car_Seat|Car Seat Scenario]]


===<span style="font-weight: normal;"><u><tt>CurrentSenseMotor3</tt></u></span>===
This macro is used to sense the current draw from DC motor 3. When it is not being used, it will draw no current. In normal operating conditions it will draw 3A, and under stall conditions (when the motor hits the end stops) it will draw 20A.


'''Parameters'''


:''This macro has no parameters''




'''Return value'''


:[[Variable Types|BYTE]]




===<span style="font-weight: normal;"><u><tt>CurrentSenseMotor2</tt></u></span>===
This macro is used to sense the current draw from DC motor 2. When it is not being used, it will draw no current. In normal operating conditions it will draw 3A, and under stall conditions (when the motor hits the end stops) it will draw 20A.


'''Parameters'''


:''This macro has no parameters''


==Macro reference==


'''Return value'''
===CurrentSenseMotor1===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''CurrentSenseMotor1'''
|-
| colspan="2" | This macro is used to sense the current draw from DC motor 1. When it is not being used, it will draw no current. In normal operating conditions it will draw 3A, and under stall conditions (when the motor hits the end stops) it will draw 20A. &nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}


:[[Variable Types|BYTE]]


===CurrentSenseMotor2===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''CurrentSenseMotor2'''
|-
| colspan="2" | This macro is used to sense the current draw from DC motor 2. When it is not being used, it will draw no current. In normal operating conditions it will draw 3A, and under stall conditions (when the motor hits the end stops) it will draw 20A. &nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}


===<span style="font-weight: normal;"><u><tt>Motor3</tt></u></span>===
Controls the Movement of the seat going up and down by the back


'''Parameters'''
===CurrentSenseMotor3===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''CurrentSenseMotor3'''
|-
| colspan="2" | This macro is used to sense the current draw from DC motor 3. When it is not being used, it will draw no current. In normal operating conditions it will draw 3A, and under stall conditions (when the motor hits the end stops) it will draw 20A. &nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}


:[[Variable Types|BYTE]] ''Direction''
::0 = Stop, 1 = Up, 2 = Down


===Encoder1===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''Encoder1'''
|-
| colspan="2" | Returns value is equal to X Axis current value (forward/ backwards movement).&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-s16-icon.png]] - INT
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}


'''Return value'''


:''This call does not return a value''
===Encoder2===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''Encoder2'''
|-
| colspan="2" | Returns value is equal to Front Z Axis current value.&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-s16-icon.png]] - INT
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




===<span style="font-weight: normal;"><u><tt>CurrentSenseMotor1</tt></u></span>===
===Encoder3===
This macro is used to sense the current draw from DC motor 1. When it is not being used, it will draw no current. In normal operating conditions it will draw 3A, and under stall conditions (when the motor hits the end stops) it will draw 20A.
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''Encoder3'''
|-
| colspan="2" | Returns value is equal to Rear Z Axis current value.&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-s16-icon.png]] - INT
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}


'''Parameters'''


:''This macro has no parameters''
===Load===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''Load'''
|-
| colspan="2" | Moves the seat back into the last saved position stored in the allocated save slot.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Location
|-
| colspan="2" | 0 = A, 1 = B&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''
|}




'''Return value'''
===Motor1===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''Motor1'''
|-
| colspan="2" | Moves the Car Seat Forwards and Backwards &nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Direction
|-
| colspan="2" | 0 = Stop, 1 = Forward, 2 = Backward&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''
|}


:[[Variable Types|BYTE]]


===Motor2===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''Motor2'''
|-
| colspan="2" | Controls the Movement of the seat going up and down by the front&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Direction
|-
| colspan="2" | 0 = Stop, 1 = Up, 2 = Down&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''
|}


===<span style="font-weight: normal;"><u><tt>Motor2</tt></u></span>===
Controls the Movement of the seat going up and down by the front


'''Parameters'''
===Motor3===
 
{| class="mtx-class-macrotable wikitable"
:[[Variable Types|BYTE]] ''Direction''
|-
::0 = Stop, 1 = Up, 2 = Down
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
 
| width="90%" class="mtx-class-macrohead" | '''Motor3'''
 
|-
'''Return value'''
| colspan="2" | Controls the Movement of the seat going up and down by the back &nbsp;
 
|-
:''This call does not return a value''
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Direction
===<span style="font-weight: normal;"><u><tt>Motor1</tt></u></span>===
|-
Moves the Car Seat Forwards and Backwards
| colspan="2" | 0 = Stop, 1 = Up, 2 = Down&nbsp;
 
|-
'''Parameters'''
| 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''
:[[Variable Types|BYTE]] ''Direction''
|}
::0 = Stop, 1 = Forward, 2 = Backward
 
 
'''Return value'''
 
:''This call does not return a value''




===Save===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''Save'''
|-
| colspan="2" | Saves the current position of the seat into the allocated save slot.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | SavePos
|-
| colspan="2" | 0 = pos A, 1 = pos B&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==
==Property reference==
<span style="font-weight: normal;"><u>Show seat base?</u></span>


This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''Show_Hide''.
{| class="mtx-class-macrotable wikitable"
 
|-
''<span style="color:red;">No additional information</span>''
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]]
| width="90%" class="mtx-class-macrohead" | '''Properties'''  
|-
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Show seat base?
|-
| colspan="2" | Controls if the base of the car seat is shown on the simulation panel.&nbsp;
|}

Latest revision as of 14:23, 13 July 2026

Author Matrix TSL
Version 1.0
Category Scenarios


Car Seat component

An electric car seat chassis with a series of motors and sensors. Students should work through exercises to learn the principles of electric car seats including how to save and load memory positions.

Component Source Code

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

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

Detailed description

No detailed description exists yet for this component

Examples

There is a detailed walk through of the scenario detailed at the link below to go with this component.

Car Seat Scenario






Macro reference

CurrentSenseMotor1

CurrentSenseMotor1
This macro is used to sense the current draw from DC motor 1. When it is not being used, it will draw no current. In normal operating conditions it will draw 3A, and under stall conditions (when the motor hits the end stops) it will draw 20A.  
- BYTE Return


CurrentSenseMotor2

CurrentSenseMotor2
This macro is used to sense the current draw from DC motor 2. When it is not being used, it will draw no current. In normal operating conditions it will draw 3A, and under stall conditions (when the motor hits the end stops) it will draw 20A.  
- BYTE Return


CurrentSenseMotor3

CurrentSenseMotor3
This macro is used to sense the current draw from DC motor 3. When it is not being used, it will draw no current. In normal operating conditions it will draw 3A, and under stall conditions (when the motor hits the end stops) it will draw 20A.  
- BYTE Return


Encoder1

Encoder1
Returns value is equal to X Axis current value (forward/ backwards movement). 
- INT Return


Encoder2

Encoder2
Returns value is equal to Front Z Axis current value. 
- INT Return


Encoder3

Encoder3
Returns value is equal to Rear Z Axis current value. 
- INT Return


Load

Load
Moves the seat back into the last saved position stored in the allocated save slot. 
- BYTE Location
0 = A, 1 = B 
- VOID Return


Motor1

Motor1
Moves the Car Seat Forwards and Backwards  
- BYTE Direction
0 = Stop, 1 = Forward, 2 = Backward 
- VOID Return


Motor2

Motor2
Controls the Movement of the seat going up and down by the front 
- BYTE Direction
0 = Stop, 1 = Up, 2 = Down 
- VOID Return


Motor3

Motor3
Controls the Movement of the seat going up and down by the back  
- BYTE Direction
0 = Stop, 1 = Up, 2 = Down 
- VOID Return


Save

Save
Saves the current position of the seat into the allocated save slot. 
- BYTE SavePos
0 = pos A, 1 = pos B 
- VOID Return


Property reference

Properties
Show seat base?
Controls if the base of the car seat is shown on the simulation panel.