Jump to content
OMRON Forums

KEJR

Members
  • Posts

    297
  • Joined

  • Last visited

Everything posted by KEJR

  1. Hello, Charles and I worked on this one and identified some issues. We got the proper code as used in the firmware and it should be like this. I gave the routines names such that they can be used in C conditional statements nicely. double ProgIsRunning() { if ((Coord[n].Ldata.Status & 0x2e) == 0x20) return 1; else return 0; } double ProgIsActive() { if ((Coord[n].Ldata.Status & 0x20) == 0x20) return 1; else return 0; } double ProgIsProceeding() { if (((Coord[n].Ldata.Status & 0x2e) == 0x20) && (Coord[n].FeedHold != 1)) return 1; else return 0; } ex usage: //sleep for 1ms intervals until motion prog is done. while(ProgIsRunning()) MySleepSeconds(0.001);
  2. +1 For me I'd like to specify in C.S. units if possible. When you are doing lots of moves with variable distances sometimes you just want the PPMAC to get there at some max accel and some speed and calculate the best and shortest trajectory. Think of a pick and place machine, its moving all over the place traversing coordinates and the accel time is going to vary all over the place depending on whether it needs a 0.100" move or a 10.000" move. Rapid mode is one way to do this [i think?] but the units are set up using the system max accel or jog accel. I'm far from a PPMAC motion expert but this is the only solution I've found so far. Look up the max accel and max jog accel parameters, and rapid mode. I believe you set the system Ta parameters negative to use rate instead of time. I'd much rather have real accel and jerk command in the motion language that works with all modes, but it may not exist at this time. Anyone at Delta Tau have any advise? KEJR
  3. Hi Windell, I highly recommend using the IDE's auto assign feature and accessing C variables with the script mode macro defined in your C program. This allows you to do exactly what you want to in terms of programming by variable name in C and motion progs and adds many other benefits. Let me explain: in your PMH file you use assignments like this: global MyVar01; global MyVar02; etc. You can also add additional PMH files if you want to, they all get combined in the compile. In your C code you have the following defined and included, in this order: #define _PPScriptMode_ #include "../../Include/pp_proj.h" void MyFunction() { MyVar01++; MyVar02 = MyVar01 + 3.1415; } That's it.. Now in your code you refer to your variables by name, both in C code *and* in the motion programs! The icing on the cake is that you can type in your variables by name in the terminal and plot/scope tools and it just works. Under the hood the IDE is assigning and defining these for you in both the PMAC script environment and in the C include file "pp_proj.h" It looks like your predecessor was making duplicate defines in separate files (one for script and one for C program). I strongly discourage this because its more work and adds room for error. Maybe this was done in the early days of PPMAC, I don't know. If you can I'd advise to add your couple of variables using my method and see if it works and breaks anything in the compilation. Over time I would encourage you to start moving your #define statements to "global" statements and letting the IDE auto assign. It shouldn't be a lot of work with a text editor with column delete/insert and/or lots of Find/replace. Do you have any other software that accessing these by some hardcoded means? If you do just be careful in converting to all named variables. If your HMI or other software refers to your variables by name then you are likely OK but if they are hardcoded to "P100-P200" or whatever then you might be hosed and have to redefine them in those pieces of software somehow. Let me know how this goes... KEJR
  4. That all sounds great for the 11E but does this work for ethercat IO as well?
  5. Last night I went to rewrite my motion code to use your triggered moves as suggested and I had a heck of a time trying to get the IDE to digest the addressing for an IO bit on my ACC11E opto 24In/24Out card. My Mvar definition is: ptr TouchSensor ->u.io:$A00000.11.1; but the IDE doesn't seem to let me assign u.io:$A00000 to the capture address. I've tried all the different combinations of this to no avail. Does the trigger register only work for axis card addresses? the reason I ask is that we are moving toward and all ethercat system down the road (Henry's Lx86) and I'd like to know if the triggered move solution works for EtherCat IO addresses as well as the ACC11E that we are using now.
  6. Never mind, found it. so like so for X axis? pread XPlus = D6 //D6 is the X axis position after pread executes
  7. The question about reading position is not related to the stop at input problem. I have that working well now and plan on rewriting it for the triggered move as discussed. My end goal is to bump against the side of a hole with an electrical contact and get positions for X Center and Y Center. I need the absolute positions of +X, -X, +Y, and -Y to do this. Basically an electronic center find algorithm. How is pread used to get only one axis' position data? i.e. XPlus = pread //How does pread know to return only the X axis value?? I hope this makes more sense?
  8. I just wanted to say that I put everything in a buffered motion program and just abandoned the idea of putting all this in my C library. My end goal is to bump off of a hole to find center in XY. I have to say that the PPMAC's ability to have easy to use local variables scoped to a motion prog is very nice. I scoured the manuals last night and really didn't find a good way to get X and Y position (actual or commanded) from any of the coordinate system commands or data structures and save it to the local variables. I can get motor position from the data structures but is there a way to get C.S. position directly when in a motion program? I found the pread command but that seems more for reporting to something like the send() command (i.e. text string). Thank you.
  9. Hi Curt, User preference can be a real fickle thing! :o) Is there any reason I couldn't send something similar to your code: "&1 cpx do { inc X10 tm100 } while (MyGlobalVar == 1) dwell0" in a command sent from C environment? Also, am I correct in saying that code would stop within up to ten units (X10) from the point where MyGlobalVar changes value?. Is it just a matter of setting the increment units small enough such that the error is acceptable? e.g. using inch units, with a 0.001" tolerance (and adding 0.0005" margin): do { X0.0005 tm50 } while (MyInput == 0) dwell0 I'll have to go for the training one of these days to get my head wrapped better around the more complicated moves. I've typically only done very simple point to point rapid moves in a single axis which doesn't require much of PMAC motion programming skill! Most of my work with the Power PMAC has been in making it work as our entire machine controller and now I'm trying to refine our C++ API to include some of these basic motion tasks so that we can re-use more and more code and stay in our C++ editor for all but the most complex motion requirements. Thanks again.
  10. Anthony, I haven't done any work with message queues yet. You could try to call one of the functions and see if the IDE environment will be able to access and compile it. I'm still switching to secondary mode when we get an error and accessing the socket directly. The model works in my situation because when an error is sent to our HMI it requires a user response which by nature is not realtime :o) Once our error is acknowledged the thread switches back into primary mode and goes realtime. If you are sending out data in the RTI function Primary/Secondary isn't an option I believe because this is programmed in kernel space. Have you tried just using the send() function and running the getsends program at the shell with its output redirected to a file? This might be a good experiment and if it works you can write a C program to sqawn a getsends thread and get its stdio to send to a file or over a socket programatically, etc. I'd still prefer a FIFO but I am pretty sure send() will work if the other attempts fail.
  11. Curt, Thank you for your reply. First let me say that I am a fan of the Power PMAC and respect the work you all do. I can appreciate that you folks did a lot of work to make the PPMAC as close to the PMAC2/Turbo as possible on the surface. I can also appreciate that you need to go to the register/bit level when configuring your ASIC chips to do hardware capture. It would be great if in the future the PPMAC motion programming could get further away from the hardware when we can tolerate software performance. Maybe something like "until " command or "stop-if ", etc could be added to the motion parser? Expression could be something like "(MyGlobalVar = 1)" for instance. IMO these little things could be very helpful to aid in programming and readability of the code. Food for thought. I will probably do a function call in C and hard-code the trigger to a dedicated external input for this application. If I need to re-use this code for something else I will have to change the trigger setup, but it is doable. Thank you for your help.
  12. I wanted to add that I would be willing to use JOG commands through a cmd() call if this is an easier solution to this problem. My second example code could easily be replaced with jog commands for instance.
  13. Hello, First, let me say that this need not be fast, software capture is just fine. My motion program skills are very basic, so if there is a more obvious and simple solution please advise. I'd like to do a closed loop move in one axis in a C.S. from a C program until a Ptr variable is set from zero to one (i.e. digital IO ptr var). I'd like the PPMAC to sit at the point of contact once the bit is set. I prefer not to write a motion program for this as it will become a generic C API function I am writing. Is this as simple as doing a CPX command followed by motion program commands? I'm just rattling off the top of my head here: move X axis in CS1 from 0.000 units to 1.234 units and record current position until M100 is set. Once M100 is set move to the contact position. I don't know the syntax for reading current feed position in the X axis in a motion program command, so I just used "CurrentPos" below as a placeholder. "CPX &1; ABS; F1; X 1.234; while(M100 == 0) { P100=CurrentPos;} X P100" alternatively is there a way to do this in two different C calls: cmd("CPX &1; ABS; F1; X 1.234"); while(M100 == 0.000) { P100=ReadXPos(); } cmd("CPX &1; ABS; F1; X P100"); For brevity I excluded error handling checks. Am I unknowingly making life difficult or is this what you have to do? Thanks, KEJR
  14. What do you get when you type "ls /dev/sd*" ??? On my system I have a SDcard plugged in with one partition on it (sdb1). # ls /dev/sd* /dev/sda /dev/sda1 /dev/sda2 /dev/sdb /dev/sdb1 sda is the builtin flash drive and sda1 and sda2 are the PPMAC partitions. sdb is the SDcard drive and, in my case, sdb1 is the first and only partition (it happens to be ext2 which is not important at this stage). If you see the same devices above you can edit the fstab file to mount /dev/sdb1 to a directory of your choosing. I created /mnt/sdcard on my system and have the following fstab file: # /etc/fstab: static file system information. # # proc /proc proc defaults 0 0 /dev/sda1 /opt vfat ro 0 0 /dev/sda2 / ext2 ro 0 0 /dev/sdb1 /mnt/sdcard ext2 rw tmpfs /tmp tmpfs defaults Just add the line, change the filesystem, and save to /.readonly/etc/fstab and reboot and you should be all set. the automounters are convenient for desktops and people plugging in thumb drives but on a system I prefer to mount it statically for determinism. If your device listing if off from mine then you may have a problem with the kernel recognizing your sdcard hardware. Let us know how it goes.
  15. I'm logging in as ftp anonymous where anonymous has its root directory mapped to /mnt/sdcard/ftp. That explains things. I can't seem to log in as ftp:deltatau on my own but everything is working so far with the IDE and other FTP clients. Not to hijack the thread too much but does this seem to be a reasonable way to set up our FTP? If we ever want to tighten security on ftp with a password we will likely want to use a different login name but at that point I think we would be better off doing our transfers with an encrypted connection and dump FTP altogether.
  16. OK, so maybe I was wrong in my assumption everything was done over SSH ...
  17. KEJR

    PTPd on PPMAC

    I have not tried PTPd but I know that just installing the following package works for initializing the basic Linux time/date. Its not going to be nanosecond accurate but for basic tasks like file timestamping it should be perfect. ntpdate I believe you just need to do apt-get install ntpdate For details regarding installing software and the readonly filesystem stuff please see some other posts if you aren't already familiar with this.
  18. Its been while since I got into the FTP settings but I had reconfigured the FTP server to point to our SDcard and reformatted it for EXT2 (There was some obligatory chown and chmod involved there too). I kept the same ftp login and password but it appears that the PMAC project type stuff was still being sent to one of the RAM drives and then copied to [PPMAC internal] flash when a save command was issued. I can't recall the details but I remember saying to myself at the time "OK the IDE must be doing everything over SSH...." For login credentials of the IDE I kept the same root account and default password. Could your problem be that you are trying to log in with the IDE using the FTP credentials instead of the intended root account?
  19. Has anybody had any success with the beckhoff servo terminals? The packaging of the amps in a slice IO format and using a one cable hookup is attractive for the sub 200W class of servos. I'm curious if anyone has them working with PPMAC and what they thought of them? KEJR
  20. Just to clarify for everyone, LX86 is the "All Linux" version and the WX86 is the dual OS Win/Linux system. The WX86 uses a hypervisor software to divide the CPU cores and other resources like ethernet/UART/etc so as to run the two OS's concurrently (web search for hypervisor for more info). Sounds like Modbus is the same, its just that the 4 ethernet ports are divided into two for the WX86. Makes sense. Having realtime UARTS will be a great option for the LX86 machines. Thanks for looking into the readonly rootfs for the LX86. I will say that even if I ran the LX86 with X windows (i.e. full GUI) I would like the option to have the disk locked down (If nothing else just before releasing to production). For those of us who do development *and* get called to the floor when the proverbial "stuff" hits the fan it is cheap insurance against running around restoring things. Awesome! Thanks for your detailed reply Henry. I know they keep you busy over there but hearing a concise response from one of the lead design engineers really gets to the heart of the matter much quicker IMHO. For those of you following this thread, I will be receiving a system from Delta Tau to try out very soon. I hope to get a test application running and report on my progress. KEJR
  21. I didn't know that you could assign the ethercat shm to pointer vars, that is kind of interesting but doesn't realy answer my original question. How does the ethercat master know what IO module and IO bit to map to "ECAT[0].IO[0]". Is it possible to set this up with a text file or is the GUI screen of the IDE necessary for this initial step? Thank you, KEJR
  22. I just saw the flyer for the motion core computers. I have to say that it looks very promising for those of us who strive to go with an all networked Servo/IO solution. I haven't seen one in person, but I feel like Delta Tau is listening to its customer base and here is my take based on the flyer info: Pros: **** Fanless/reliability - No fans and internal cables to come loose... no large vents to easily get stripped-wire-shrapnel or metal chips into the works (OK, its not IP68 but this is more than appropriate for inside an enclosure). Form Factor - Can easily be mounted on an enclosure door or possibly panel mounted in an 8" or deeper box if you don't need the rear connectors. Performance - Like the ability to scale up in performance if needed. 24V power - 120V can be a pain to wire in some installations. COM PORTS!!!!!! - Lets face it the RS232 port is not dead ... There are tons of gadgets that speak simple ASCII RS232 commands and that's not going away. Dedicated EtherCat and Modbus - More on Modbus in the questions section.... Questions: ********* - Are the Com ports UART based and thus can be enabled for Xenomal serial drivers? - Is the Modbus dedicated port served by a realtime process now that it has a dedicated Ethernet port? - Are the USB/video connections opposite the power/Ethernet/com ports shown in the picture as I've guessed? - Are Linux host operating systems mounted with read only root? - Is the windows option capable of using windows embedded with Enhanced Write Filter (EWF)? - Is Windows/Linux-PPMAC communication done through a virtual Ethernet connection? Additionally, can windows get at PPMAC shared memory? - What are the price points for these units .. how do these compare to the Etherlite or UMAC CPUs? - How do we back up the drives on these, can it boot Acronis (or ghost, etc) off of a USB stick with a monitor/keyboard/mouse plugged in? It would be nice not to have to disassemble this to back up the drive! As an aside I am tempted to use this with the Linux only version, perhaps even headless with the Celeron unit. I don't necessarily see the reason or benefit to have windows running on the PPMAC itself but I don't doubt that this would be an attractive option for many. I am currently using C#.NET for our HMI and if it weren't for the fact that many smart camera controls are only available with windows I would go all Linux with QT (I still consider this an option for me and try to have alternatives for the smart camera displays/interfaces). I'm interested in others' opinions on this. All in all this looks like a very nice looking product. Please comment as I'd like to get others opinions. KEJR
  23. This reply is very late in the works but what I was wondering is if you could do the ethercat config in a similar way to how you do PMH files with M-vars (I'm not sure I *want* to do this but is it possible?). I can live with the GUI assignment the way it is. I'm just trying to adjust to the difference from this method to what we are used to (Backplane based PLCs). It would be nice to have inputs start at one block of addresses and outputs at another, etc. (0-999 for input, 1000-1999 for outputs, etc). At the end of the day its not that important, more of a convenience/organization thing. Thanks, KEJR
  24. Hello, Shansen is correct. I prefer that when dealing with realtime processes not to dynamically allocate memory. The RTI thread is a hard realtime thread in the xenomai kernel memory space and scheduler. Code in here should be written carefully and kept tight and deterministic. Another method you can try is to statically allocate global variables. I believe it is more efficient to do this, especially on large arrays and when you need persistence across multiple function calls. i.e. //Some Large Array double doubleArray[1024]; void realtimeinterrupt_plcc() { DoSomeArrayStuff(); }
  25. Hello, I have successfully configured some Beckhoff EtherCAT IO using the IDE. I find the way it auto-assigns IO numbers to the ECAT[] structure to be difficult to organize. Is there is a way to set up EtherCat IO assignment in a text file or something more amenable to change? We have used 100's of digital IO on projects so you can see how having a logical layout of IO assignment can help to prevent errors! BTW, the EtherCat IO is working good. I found that I had to set ECAT[0].Enable =1 before I saved. I don't believe this was in the manual for the IO setup. Thank you, KEJR
×
×
  • Create New...