Jump to content
OMRON Forums

tweekzilla

Members
  • Posts

    38
  • Joined

  • Last visited

Everything posted by tweekzilla

  1. Hi, I'm trying to extract the coordinate system parameter ProgRunning from a C program. I almost get it to work with the following code, except that the enum returned is either 0 or 1 - It does not for example return 2 if I engage a limit switch I've posted the enum definition here for clarity: enum progstatus {PROG_RUNNING, PROG_STOP_ON_PAUSE_STEP, PROG_STOP_ON_LIMIT, PROG_STOP_ON_BKPT, PROG_STOP_CODE_ERR, PROG_STOP_STACK_ERR, PROG_STOP_LVAR_STACK_ERR, PROG_STOP_CALL_ERR, PROG_STOP_AXIS_ASSIGN_ERR, PROG_STOP_KINEMATICS_ERR, PROG_NOT_IN_USE = 16}; And my code: #include // Global Gp Shared memory pointer #include "../../Include/pp_proj.h" #include static volatile GateArray3 *TickGate3IC; //ASIC structure pointer int main(void) { enum progstatus pp; int coor_status; InitLibrary(); pp = CoordStatus(1); printf("%d\n", (int)pp); CloseLibrary(); return -1; }
  2. Hi All, If I edit motion control program on the pmac (/var/ftp/userflash/Project/PMAC..../Motion.../proc2.pmc) and then run the program from the webgui - (&1b2r) it doesn't seem to reflect any of the edits I made to the file. Do I need to somehow reload/compile the programs after editing them?
  3. Reading the manual I don't think this is possible but I would like to be able to read the Pfm value that is pointed to by Motor[x].pDac - i.e. I don't want to have to keep a record of which motor is pointed to which hardware channel (hence the pointer in the first place). If I try and read the value via: int *temp; temp = pshm->Motor[1].pDac; printf("%i", *temp); My code just quits - no error no nothing. The problem is when you try and get the value from temp - i.e the printf statement. Reading the Pfm directly from the channel works fine. Is it possible to do this or would I need to keep a separate lookup for my C programs between motors and channels
  4. Is there a solution yet to the windows 8 issue - I have a standard US version and it also hangs at compile options - Language settings is English
  5. Fixed - User error - Issue with the plcs I was running
  6. I'm putting together a cabinet design and I was wondering if there are any solidworks models available for the modular rack system and boards?
  7. I just started to use the digital amplifier board for pulse and direction. There was no signal being produced on on the D output (with the usual setting for pulse and direction output). I then went to the PMAC system setup and Enabled the output on Acc24E3[0].Chan[0] and moved the PWM sliders around. There was no output as seen on an oscilloscope for either top/bottom A-D. The only output that appeared to be working was the PHACLK, ADCCLK and ADCSTB. Am I missing something obvious or is this a sign of a broken board?
  8. Some more information - Our current setup uses a 300hz Xenomai thread to log pmac variables into a posix message queue. A 10hz Xenomai thread then sends that data over the network and receives new position information from the control computer. The idea is that this thread then puts the new positions into the Rotary Buffer - the whole transaction is psudo deterministic with error checking etc. This gets really ugly if we have to open a telnet session in a xeonmai thread, log in, run gpascii and set things up. Ideally would be able to append the new positions directly from the C-code as they come in to the memory location of the next buffer command. An alternative would be if we could connect to a port on the PMACSERVER and send commands that way. This would be somewhat cleaner from a C-thread.
  9. Just to update on this - The following works fine (along with an expected lag due to the lookahead), unless you make P12=P13 then it will get stuck in a loop - i.e. setting P12 != P13 after setting P12=P13 does not execute the move. You also cannot exit the loop by setting P10 = 0. Maybe this is expected? open prog 3 dwell 0 EncTable[3].type = 10; //setup for trigger; EncTable[3].pEnc1 = Acc24E3[1].Chan[2].Status.a; //point to arming flag linear; X0 F180; while(P10 != 0) { X(P12) F100; x(P13) F50; } X1000 F100; close
  10. I'd like to be able to pass new position (and feed-rates) to a motion control program via P variables - The code below does indeed see the P-variables at startup but does not recheck the values whilst running. Is it possible to do the following? open prog 3 dwell 0 EncTable[3].type = 10; //setup for trigger; EncTable[3].pEnc1 = Acc24E3[1].Chan[2].Status.a; //point to arming flag linear; X0 F180; while(P0 != 0) { X(P1) F100; } X1000 F100; close
  11. Bump... This would be a very useful feature for our application.
  12. I have a TCP server that currently transmits various status/Positions etc on a deterministic basis (xenomai user-space task) to a python client. I would like to be able to use the same socket to transmit from the python client to the PMAC updated positions in a rotary buffer. Is there a way in a C program to add commands to the Rotary buffer?
  13. As an update I can confirm that the following works ok but as soon as you try and address the P variable the ISR hangs void CaptCompISR (void) { volatile GateArray3 *TickGate3IC; //ASIC structure pointer int *CaptCounter; //Logs number of ticks int *CaptPosStore; //Storage pointer TickGate3IC = GetGate3MemPtr(1); //Pointer to IC base CaptCounter = (int *)pushm + 0; // Sys.Idata[0] CaptPosStore = (int *)pushm + 1; (*CaptCounter)++; //Increment Counter *CaptPosStore = TickGate3IC->Chan[2].HomeCapt; //pshm->P[1]++; //This is the thing that crashes!!! TickGate3IC->IntCtrl = 0x04; //Clear interrupt }
  14. Hi, Yes I can confirm that I have the prototype in the header file and that the usrcode.c is set to compile. (usrcode.h is set to Content but I think that's correct). I can also confirm that the ISR does indeed work if you are not writing to a variable. I can also clear the PosCapt flag with a TickGate3IC->Chan[2].HomeCapt without the PMAC freezing I'm checking the equ status, however, I'm assuming the ISR should not interrupt unless the relevant bit in IntCtrl (23-16) are set.
  15. I've taken the example of the Capture Interrupt Routine from the manual in order to try and capture the encoder count on a channel that is being used as the external time-base. The idea is to latch the encoder count on an accurate tick. I'm using the USER flag input on Chan[2] of an ACC24E3[1]. I have tested that the external time-base and triggering work as expected - the problem is that whenever I enable the ISR and send the tick the PMAC CPU locks up. The code is shown below and is almost the same as the manual. I also set Acc24E3[1].IntCtrl = $40000 //Chan[2].PosCapt void CaptCompISR (void) { volatile GateArray3 *TickGate3IC; //ASIC structure pointer int *CaptCounter; //Logs number of ticks int *CaptPosStore; //Storage pointer TickGate3IC = GetGate3MemPtr(1); //Pointer to IC base CaptCounter = (int *)pushm + 65535; // Sys.Idata[65535] CaptPosStore = (int *)pushm + *CaptCounter + 65536; *CaptPosStore = TickGate3IC->Chan[2].HomeCapt; //Store position (*CaptCounter)++; //Increment Counter TickGate3IC->IntCtrl = 0x04; //Clear interrupt } Note that I am setting the tick by a simple switch that is pressed - I mention this incase there is a bounce issue.
  16. Thanks - I got it working (almost) - The signal was placed on the SIN input and the following register set: Acc24E3[1].Chan[2].EncCtrl = 13 1) It would not count using a TTL/CMOS square wave - I suspect the 220 Ohm termination packs may have something to do with this but I need to think about that - I possibly need a driver before the PMAC. 2) Using a standard 50 Ohm output on a function generator (1Vpp square wave) worked fine. I also wanted to clarify the serial encoder settings as the manual differs to your suggested settings - Can I confirm that if you wanted to use the serial encoder input as a supplemental quadrature encoder then as per the manual gate.SerialEncCtrl = 0 gate.chan[j].SerialEncEna = 1 //difference here
  17. Thanks Sina, Sorry for the slow response but I manged to get the above to work fine
  18. Thanks Curt - I now know it's possible! I've been trying to setup the pulse counter by inputting it into SENCDAT+- and trying to use it as a quadrature encoder (30khz 50% duty cycle)- The following have been set but I do not see ACC24E3[1].Chan[2].ServoCapt increasing. //setup pulse on Chan[2] for external timebase ACC24E3[1].SerialEncCtrl = 0; //Quadrature interface ACC24E3[1].Chan[2].EncCtrl = 0; Acc24E3[1].Chan[2].TimerMode = 0; ACC24E3[1].Chan[2].SerialEncCmd = 0; Acc24E3[1].Chan[2].SerialEncEna = 1; //External timebase setup EncTable[3].type=1; //Single-register read conversion EncTable[3].pEnc = Acc24E3[1].Chan[2].ServoCapt.a; //Combind pos reg EncTable[3].index1 = 0; //No left shift EncTable[3].index2 = 0; //No right shift EncTable[3].index3=0; EncTable[3].MaxDelta=0; EncTable[3].ScaleFactor = 1/(256*30) //for 1ms timebase I'm not even sure you can input a single pulse in the quadrature encoder for it to start counting incrementally. Also the manual hinted that you should be able to do this through the SIN/COS inputs but I have not worked that out yet.
  19. Is it possible to input an external timebase pulse into an ACC-24E3 sinusoidal feedback input or do we need a digital feedback card? Cheers Ross
  20. tweekzilla

    RTnet

    I noticed a post where DT was thinking of adding RTnet to the xenomai kernel. This would be very interesting for our project and I was wondering what the status of this was? Cheers Ross
  21. Hi All, I'm driving a stepper motor using a linear encoder as the feedback for the position. I would like to setup a deadband of say 0.3 mu from the Position error. This works fine using Kbreak and BreakPosErr so long as I don't have the integral term enabled. However to get the following error I need I do need to have a small integral term. I looked into using OutDbon and OutDboff but they are only valid when the DesVelZero is True and with the integral term on that value switches from false to true. Is there a way to use the integral term when moving and then setup the deadband such that Ki is disabled inside of 0.3mu? Cheers, Ross
  22. Those looks like the right thing - I'll order some and make sure and post here. Thanks Michael!
  23. Nope sorry, They look like a smaller version of an old printer cable - They have 36 pins and in the ACC-24E3 manual are called 36pin mini-d receptacle of which I need the plug version.
×
×
  • Create New...