How to Change GearIn Ratio on the Fly?
Using the KAS Software with a PDMM controller on a 4 axis machine. Can I change the GearIn Ratios on the fly by changing the value of GatherGearIn?
Inst_MC_GearIn( TRUE, Axis5, Axis1, GatherGearIn, 750, 1000, 1000, 0, 0 );
Comments & Answers
Joe Parks said ...
Yes you can have a variable for the gear ratio numerator and denominator inputs to the MC_GearIn function block to change the gear ratio on the fly while your program is running and the slave will continuously follow the master and start accelerate/decelerate to use the new ratio right when the MC_GearIn function block is called
The first input to MC_GearIn is "Execute" which denotes that it has an automatic rising edge trigger inside. Your code might not work unless it is inside an IF/THEN statement that is not always running, and you have a paired line of code that starts with Inst_MC_GearIn( FALSE, Axis5 . . .) that resets the execute input so that when it is true later the function block instance sees a rising edge and will run again. If the gear ratio input changes and the execute input stays true you will not see the new gear ratio used because the function block instance needs to see a rising edge. Can add an additional variable and use it for the Execute input instead of writing in the constant TRUE and monitor that if the GatherGearIn variable changes to toggle the variable from false to true to automatically start using the new gear ratio
FYI, I changed the title of
FYI, I changed the title of your question to make it more meaningful and searchable.