0

Variable speed control on Dual direction Math

Damir Pinezić 3 years ago updated 3 years ago 3

For some simple automatic modes I'm using Integer Parametar(Adjust Item) as speed setpoint in DMAC, like on the picture:


As this unit can go 360 all around, I would like to give it shortest path to final points, but for this I need to change direction of Controlling vars(for ex. Auto NEST Speed ,sometime need to be positive and sometime negative).


How can it be done, because I'm not able to find solution for this?

Does it help if you could set the parameter to a negative value?

(Check the channel inside Diagnostics>Adjust Groups>etc)


But I guess you would want something like a function that includes the rotation angle as well so can determine automatically.

Yes, it needs to be changed when the function/FSM starts and according to the angle


I made Math channel and function selector from the FSM(Finite State Machine), and according to the STATE I just negate SET speed like:

if StartAngle>180 then

Result:=SetSpeed*(-1)

else

Result:=SetSpeed

endif


The problem was that in my first soulution I had crash of the simulator and was concern to use this logic, but now it seems it is working.


TNX