text: <s>[INST] Moving While Gearing I need consultation about MAM over MAG instruction. My system is combine with 1 virtual axis that run in fix speed, it' s belt coveyor and another axis is film feeding (A-B motor, MPL series and controlled with Kinetix6K). I've problem of deviation of belt conveyor speed that effect to servo speed that run by MAG instruction( belt conveyor is master and servo is slave). After I read Help document on RSLogix5000 in topic that we can put MAM instruction to conpensate the error but in Help document no have any sample code to apply to my system. Could you please recommend me or give me some sample code. Thank you **************************message for Help DocumentMoving While GearingAn incremental MAM instruction may be used for the slave axis (or master axis if the Axis Type is configured as Servo) while the electronic gearing is enabled. This is particularly useful to accomplish phase advance/retard control. The incremental move distance can be used to eliminate any phase error between the master and the slave, or to create an exact non-zero phase relationship. Incremental MAM instruction may also be used in conjunction with electronic gearing to compensate for material slip.Normally a gear ratio of 1 is used with phase adjustment. A 1:1 ratio ensures that the computed phase error does not change before performing the move to correct it. Electronic gearing is not normally used with absolute moves, since the ultimate endpoint is not predictable. To successfully execute a Motion Axis Gear instruction, the targeted axis must be configured as a Servo Axis Type and the axis must be in the Servo On state. If any of these conditions are not met than the instruction errors. [/INST] I believe you are mixing terms. A virtual axis exists only in the control code. It has no real component at all. If you want your film axis slave to follow your belt conveyor, there must be an encoder attached to the belt conveyor. The encoder can be wired into the K6K drive to its aux. encoder input. You would then use this encoder as a servo axis. You cannot issue motion commands, but you can issue home commands to it, and use it as the master axis for MAG. When I create drive trains as you describe, I add a scaling tag to the gear ratio. I would create a tag something like:GEAR_RATIO = MASTER_VALUE/SLAVE_VALUE*SCALING_FACTOR Usually, SCALING_FACTOR is equal to 1.0. A small variation away from 1.0 allows for the physical world (slippage of film, tolerance of drive roller, etc.) without ruining the basic factors. \\n </s>