Jump to content
OMRON Forums

RafaelFalcaro

Members
  • Posts

    28
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

RafaelFalcaro's Achievements

Explorer

Explorer (4/14)

  • Reacting Well Rare
  • Collaborator Rare
  • First Post
  • Week One Done
  • One Month Later

Recent Badges

0

Reputation

  1. Hi, I've set up a network folder on my PowerPMAC and when I try to write files to it via BGCPLC, the controller goes into WatchDog. I did a more simplistic test, outside the PMAC environment, by creating a C program and compiling it in the controller's Linux environment. When running, the same problem occurs (the controller goes into WatchDog). Here is the program used: #include <stdio.h> int main(int argc, char *argv[]) { FILE *fp; int i = 0; fp = fopen("/mnt/data/test.csv", "w"); printf("Ok 0\n"); if (fp == NULL) { printf("Fail\n"); return 0; } printf("Ok 1\n"); for (i = 0; i < 1000000; i++) { fprintf(fp, "%d\n", i); } printf("Ok 2\n"); fclose(fp); printf("Ok 3\n"); return 0; } When run, the program creates the file correctly, and goes through the instructions up to the debug message "Ok 2". After that, communication with the controller is lost due to the error. I imagine that the "fclose()" function is causing the problem. Here is my controller configuration: Here is my /etc/fstab file used to mount the network folder: Here is the permission level of the mounted folder: PS 1: I did the same test with a controller with a PowerPC CPU and the problem didn't occur PS 2: I did the same test on different networks, knowing that some were more overloaded and others much less so PS 3: writing to a original folder on the controller (such as /tmp) everything works correctly PS 4: using linux programs (such as nano, touch etc.) to write files to the network folder everything works correctly
  2. Thanks for the suggestion, Leandro! But it didn't work... the oscillation of the graph below happens when I execute a move. Also, the 1-cycle delay that the snippet of code you suggested doesn't change the fact that the return from the Servo loop has an effect on the PFM at any instant of the Servo Period, which in my opinion is the big problem. Looking at the user manual, in the "Phase and Servo Hardware and Software Synchronization" section, I understand that the solution is to parameterize the motor that uses the PFM so that the PowerPMAC commutes it (PhaseCtrl > 0), but I could not define the required registers for this to work fine.
  3. Continuing the tests here, I'm coming to the conclusion that it won't be possible to do what I need, because of the fact that the return of the servo loop has an effect on the PFM immediately at the end of the calculation, and not at the instant of the next Servo interruption. Because of this detail, the calculation that takes ServoPeriod into account is not true, as ServoOut can be updated at any time within the ServoPeriod interval. And I also believe that it is not possible to measure what that instant was for each Motor, only for the entire Servo cycle (Sys.ServoTime), as this would be possible to deduct such time from the ServoPeriod and adjust the ServoOut. Is there any register that measures this time between the start of the Servo Interrupt and the end of the loop calculation of motor n? Or even, a register that configures the controller to only use the new return value of the servo loop in the next Servo Interrupt?
  4. Hello Leandro, Yes, the pfm_clock_div value is correct. Making the mask with 0b1111 or 0xF don't give the same result? Anyway, my PfmClockDiv is zero (I'm using 100MHz clock on the PFM), so I did the test below and the overshoot keeps happening. // Calculates PFM clock frequency Gate3 = GetGate3MemPtr(0); pfm_clock_div = 0; pfm_clk_freq = 100e6 / pow(2, pfm_clock_div);
  5. Hello, I'm trying to use PowerPMAC as a high frequency pulse generator through PFM. I'm using a custom servo loop, where I monitor the positioning error of my motor and calculate what the PFM output frequency should be so that enough pulses are generated for it to reach the desired position in the next servo cycle, saturating at 5 MHz. Here is the code: double custom_pfm(struct MotorData *Mptr) { // Auxiliar variables double servo_out, servo_period, pfm_clk_freq, pos_error; unsigned int pfm_clock_div; volatile GateArray3 *Gate3; // If closed loop is enabled if (Mptr->ClosedLoop == 1) { // Calculates position error relative to JogPos pos_error = ((Mptr->JogPos) - (Mptr->HomePos)) - ((Mptr->ActPos) - (Mptr->HomePos)); // Calculates PFM clock frequency Gate3 = GetGate3MemPtr(0); pfm_clock_div = ((Gate3->HardwareClockCtrl) >> 16) & 0b1111; pfm_clk_freq = 100e6 / pow(2, pfm_clock_div); // Calculates Servo Period servo_period = (pshm->ServoPeriod) / 1000; // Calculates Servo Out servo_out = ((pos_error / servo_period) * 65536) / pfm_clk_freq; // Saturates at 5 MHz if (servo_out > 3276.8) { return 3276.8; } else if (servo_out < -3276.8) { return -3276.8; } // Return Servo Out return servo_out; } // Return 0 if closed loop is not enabled return 0.0; } The implementation is working relatively well, but this type of overshoot happens, which I would like to solve: The EncTable used by the motor is configured like this: Gate3[0].Chan[0].TimerMode = 3 EncTable[11].Type = 1 EncTable[11].pEnc = PowerBrick[0].Chan[0].TimerA.a EncTable[11].index1 = 0 EncTable[11].index2 = 0 EncTable[11].index3 = 0 EncTable[11].MaxDelta = 0 EncTable[11].ScaleFactor = 1/256 Why does overshoot happen? I imagined that by calculating exactly the frequency needed to generate the pulses, the behavior of the position curve would be a ramp that stops exactly at the setpoint...
  6. Thanks for the reply, Steve. I would like to kown more details about these "software communication ports" and the telnet protocol. Can I capture the messages that the "send" command sends through a telnet server listening on a port like localhost:23 ?
  7. Hi, I'm tryng to pass a string as parameter to "system" command in a PLC like this: open plc SYSLOG_TEST system "logger -i -p user.debug -t test_plc %s", "Testing syslog on Delta Tau" disable plc SYSLOG_TEST close I'm getting this error: ...\21-SyslogTest.plc(30,1) : Error : ( error #31) data error in equation : system "logger -i -p user.debug -t test_plc %s", "Testing syslog on Delta Tau" But, at the POWER PMAC SOFTWARE REFERENCE MANUAL, the "system" command description says this: Firmware version: 2.6.0.0 What am I doing wrong?
  8. Hello, I would like to know how the Power PMAC "send" command works at a low level. I'm trying to use it to do system event logging with the Linux rsyslog service. In this service, I can configure a message source from a communication port.
  9. Thanks for the reply, @steve.milici! But what I really need is to view information about reboots prior to the current system session.
  10. Hello, Is there a system log file where records about controller reboot are stored? Because of the overwriting of the /.readonly/ storage region over the system usage region, logs in /var/log are lost.
  11. Hi, Is it possible to read some P-variable from my MACRO Ring Slave?
  12. Hi @Sangmo, thanks for the reply! So I understand that the ISR function is executed on any edge of my trigger signal, is that right? I'm asking because in the Power PMAC User Manual (page 787) there is an information that for PMAC3-style ICs the detection is done via “edge-triggered” capture logic: If this is correct, what is the need to configure the Gate3[0].Chan[0].CaptCtrl register, since it only matters which trigger source (Gate3[0].Chan[0].CaptFlagSel)?
  13. Hello, I'm using PowerPMAC's ISR interrupt to perform axes position acquisition, with the trigger source being the UserFlag signal. The implementation is functional, however the interrupt is being executed at each edge of the trigger, regardless of its direction (rising or falling). I would like the interrupt to happen only on the falling edge of the UserFlag signal. Here are the settings I made: Gate3[0].IntCtrl = $10000 Gate3[0].Chan[0].CaptCtrl = 10 Gate3[0].Chan[0].CaptFlagSel = 3 Gate3[0].Chan[0].CaptFlagChan = 0 UserAlgo.CaptCompIntr = 1 Here is the code inside the ISR: void CaptCompISR (void) { volatile GateArray3 *MyFirstGate3IC; // ASIC structure pointer int *CaptCounter; // Logs number of triggers int *CaptPosStore; // Storage pointer MyFirstGate3IC = GetGate3MemPtr(0); // Pointer to IC base CaptCounter = (int *)pushm + 65535; // Sys.Idata[65535] CaptPosStore = (int *)pushm + *CaptCounter + 65536; *CaptPosStore = MyFirstGate3IC->Chan[0].HomeCapt; // Store in array (*CaptCounter)++; // Increment counter MyFirstGate3IC->IntCtrl = 1; // Clear interrupt source }
  14. Hello, I would like to measure the instantaneous voltage (in a PLC, for example) that is on the phases of a stepper motor through the PowerPMAC registers, would it be possible? I can currently measure the current like this: m1_current = sqrt(pow(Motor[1].IaMeas,2)+pow(Motor[1].IbMeas,2))*(33.85/32768)
×
×
  • Create New...