See also: Tutorial 18: Maths FB
Add menu > Add Maths FB. 

To Open:
 or 
 or 


Add Connectors; Edit Output Data Type If you do not see the three buttons that are below the Orange Bar, then click the Orange Bar, possibly two times. Add Input button  Click to add an inputconnector to the Maths FB.
Add Output button  Click to add more outputconnectors to the Maths FB.
Output DataType
Little Bug: If you actually want the output to be Linear Coordinates [units], you MUST select a different DataType and then select LinearCoordinates again to initialise the units correctly. Update button


More information to help you write the equations in the Equation boxInputConnectors:
The DataChannels are labeled as 'p', 'v', and 'a', even if the data is not actually Position, Velocity, and Acceleration.
Inputconnector numbers start at 0 , then 1, 2, 3, ... Data on each InputConnector and Wire The datatype of each datachannel at an inputconnector is a function of the FB from which you connect the wire. If you connect a wire from a:
Equations: For example: datachannel #2 on the wire that is connected to inputconnector #3 from the top.
And, you might enter, as an equation:
Which is: '[Second datachannel, of the third Inputconnector] × [Third datachannel, fourth Inputconnector]1.2 You can write nonsense, so be careful. Units (see below for more information on Units) The units in the Maths FB are always SI Units : meters, radians, kilogramme, seconds. An input of 12mm in the model 'outside' the Maths FB, is 0.012m 'inside' the Maths FB. , and an angle of 90º, becomes pi∕2 radians when 'inside' the FB. If you want mm in an equation inside the Maths FB, you must multiply the value by 1000 in the equation. 

UNITS 'inside' the Maths FBThere are 4 possible sources of confusion with respect to 'units' when you use the Maths FB.
Set the Data Type in a Motion FB to Linear or Rotary units when you connect a wire from a Motion FB to a Maths FB. If you do not, then the output is 'Motion units' which has a scale very much larger than any useful unit.
Inside the Maths FB, the units are always SI. Thus:
If you multiply these together, the result 'inside' the Maths FB is 0.157  of course. You have the opportunity to convert the units of the output from the Maths FB to other units with the Output DataType list in the Maths FB.
Even though the values internally are SI, the units are converted back to units of the Machine Settings dialog at the outputconnector, for the units you select in the Output DataType dropdown box. For example: Machine Settings
Rotary units connected to a Linear Slider  that is, the opposite data type If you set the output units to Rotary Coordinates, then 0.157 becomes 0.157rads , which is 9º. at the output, when the Machine Settings are degrees. Linear Units connected to a Rotary Rocker If you set the output units to Linear Coordinates, then 0.157 becomes 157mm, when the Machine Settings are mm. 
The Calculator gives some of the 'standard' mathematical functions. When the open and closed brackets show in the function button, you must enter a value or an input variable  For example, Sin(p(1)) calculates the trigonometric 'Sin' of the position value of the second input. [p(0) is the first position input, p(1) is the second, p(2) is the third....] They include:



Example Maths FB
Example 1: Rack Motion from a Pinion. Assume we want to drive a Rack from a Pinion. The Motion of a Rack is given by the Motion of the Pinion. The standard equations we should use are:
The units in the Maths FB are always SI Units. Linear Dimensions: If the Linear Units in the Machine Settings dialog are mm, then the dimension of a Part is in mm. If you change the Linear Units to m, then the dimension of the Part is in m (meters). For example, a dimension of 100 while the Machine Settings are set to millimeters, will become 0.1 if you change the units to meters in the Machine Settings. When you add a wire to a Maths FB, it will use the SI units m (meters). In this case you must multiply the Displacement equation by 1000. Angular Dimensions: If the units in the Machine Settings dialog are degs (degrees), and we measure the angle of a Part, it will show as degrees. However, when you connect a wire to a Maths FB, it will use the SI units for the degs (degrees), that is: rads (radians) 

Example 2: Epitrochoid / Hypotrochoid: When you have parametric equations, you can give the output for the X parameter to a horizontal slider, and the Y parameter to a piggyback orthogonal slider. If you enter the equations for
See Tutorial 18 for full details of this example.


Make a Tool Translate at the end of a SCARA Robot.
