Skip to content

PPMAC - Invalid lookahead definition when switching CS Groups #144

@LeandroMartinsdS

Description

@LeandroMartinsdS

Description

The redefineLookaheads method currently uses commands that are exclusive to TurboPMAC, making it ineffective for PowerPMAC. This difference can lead to incorrect or non-existent lookahead buffer allocation for coordinate systems, especially when switching between defined CsGroups.

Currently, the method performs the following operations:

strcpy(cmd, "DELETE ALL TEMPS");

This deletes all the temporary buffers: lookahead, gather, rotary and ccbuffer.

sprintf(cmd, "&%dDEFINE LOOKAHEAD 50,10", cs);

This sets:

  • A lookahead buffer size of 50
  • 10 synchronous assignments

In contrast, PowerPMAC expects:
strcpy(cmd, "delete all lookaheads");
sprintf(cmd, "&%d define lookahead 1024", cs);

Key differences between TurboPMAC and PowerPMAC relevant to this issue include:

  • PowerPMAC does not require a specific order to define lookahead buffers for each coordinate system, whereas TurboPMAC requires definitions from high-numbered to low-numbered coordinate systems.
  • PowerPMAC enforces a minimum lookahead buffer size of 1024.
  • PowerPMAC only accepts the define lookahead command for coordinate systems that have at least one assigned motor. While it is technically possible to set Coord[x].LHSize directly, the Power PMAC Software Reference Manual (May 19, 2023, p.853) states:
    “It is not possible to write to it directly in the Script environment.”

As a result, the current implementation is incompatible with PowerPMAC systems and may lead to incorrect or non-existent lookahead buffer allocation, particularly when switching between defined CsGroups or modifying the number of motors in a coordinate system.

Suggested solution

  • Abstract the command string in pmacHardwareInterface through a get function.
  • Define the correct syntax for each hardware in:
    • pmacHardwareTurbo
    • pmacHardwarePower.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions