[Da...] Posted September 26, 2019 Share Posted September 26, 2019 Hi all, I'm trying to figure out if there is a way to have the CMM move along one axis while recording xyz encoder positions every 0.5mm along the traveling axis and add a timestamp for each recorded interval. The results would be saved to something like a csv file. I figure PCM would be able to do this, but I don't know enough about it to get anything going. Any advice would be appreciated. Thanks! Link to comment Share on other sites More sharing options...
[Ro...] Posted September 26, 2019 Share Posted September 26, 2019 That would be a no from me, not in the way you want which would be to timestamp every so far, during a feature. You could take a time stamp at the start & finish of a program or feature by putting something like below in the presettings filePath2 = "C:\temp\forum\" dirPath2 = filePath2 + getRecordHead ("planid")+ ".csv" addToFile(dirPath2,(" ")) addToFile(dirPath2,getRecordHead ("planid")+(" ")+ date()) addToFile(dirPath2,("Start Time : "),time()) and below in the postsettings filePath2 = "C:\temp\forum\" dirPath2 = filePath2 + getRecordHead ("planid")+ ".csv" addToFile(dirPath2,("End Time : "),time()) This will create a CSV (excel) file and populate it with the start time and end time of each feature you put it in. Itll append the file every time it runs so itll act as a data log if you wish. You could add info such as "Line 1" or "Circle 9 at .250 IPS scan speed". You can do whatever you want, make it as simple or complex as you can. I would also say that depending on how complicated you want to get, putting stuff in the Pre & Post may actually cause the machine to pause & think for a moment, so basically by timing it you may inadvertently be slowing it down. But it won't be much, a second or two here or there at maximum would be my guess. Link to comment Share on other sites More sharing options...
[Da...] Posted September 26, 2019 Author Share Posted September 26, 2019 Thanks Roberto. The ultimate goal would be to record an array of CMM positions that is 1000mm x 50mm with 0.5mm spacing (so essentially 200,000 points) with timestamp info for each location in space. I have an example below that I tested. I put in the wait functions here because if I don't it will record the CMM position before it has arrived at its destination. Ideally I'd like to not have to stop every time I want to record a position and timestamp. 200,000 points would take around 55 hours to complete. If I could move from say 0 to 1000mm in Y in one complete motion and record position×tamp along the way that would cut down on time greatly. positionRS(200, 0, 200, baseSystem(), "Down") wait(5) addToFile("output.csv", getPositionCMM(), ";", dateAndTime()) for i=0 to 100 stepRS(0,0.5,0, baseSystem()) wait(1) addToFile("output.csv", getPositionCMM(), ";", dateAndTime()) next i Link to comment Share on other sites More sharing options...
[No...] Posted September 27, 2019 Share Posted September 27, 2019 Please sign in to view this quote. That's exactly the problem. Not possible with PCM. Link to comment Share on other sites More sharing options...
[Da...] Posted September 27, 2019 Author Share Posted September 27, 2019 Good to know, Norbert, thanks! Maybe this requires a direct connection to the controller, which opens up a bunch of other issues, I would assume. Link to comment Share on other sites More sharing options...
[Er...] Posted September 27, 2019 Share Posted September 27, 2019 How come you say it's not possible? There is no official "while" functions. But there are ways to mimic such behaviour. There are some methods that might be of use to you. We just need to strait out what you are asking. Your question just dont make sense to me. Are you intrested in the time for travel to specific coordinte? Or is it acceleration/deacceleration that is intresing? If you are intrested in the location. You already know what your list will contain, 0.5, 1.0, 1.5 etc, or most likely, nothing at all. Why, think of it this way. When x = 0.5 print. Depending on speed, interval of update etc, you may never hit exactly 0.5. And then nothing after will be printed either. (I dont know the method of the cmm reading the scales, or the intervall, or if it is continus. Or if all machines work the exact same for that matter. ) Lest say the last scenario doesnt happen. If the machine is moving continiously. And happens to read 0.5, it will either print as in my fist scenario. Or due to computer lag and language executions time, some other value will print. Like 0.608, depending on lag and how the function is written. Can you pleace describe what your purpouse is. Because to me, it's unclear what you ask about. Link to comment Share on other sites More sharing options...
[No...] Posted September 30, 2019 Share Posted September 30, 2019 The way I understood it he wants the machine (or an axis) to travel from point A to point B in one continuous motion, and to output the actual position every X seconds (or fractions of seconds) to a file, each line together with a timestamp.I also don't understand the purpose, but I still claim that this is not possible with PCM if the movement has to be a continuous one. Of course you could do it by moving in a stop-and-go manner in a loop (move distance X, write position, move distance X, write position...) but that's not what he wants. Link to comment Share on other sites More sharing options...
[Da...] Posted September 30, 2019 Author Share Posted September 30, 2019 Norbert, you are correct. The ultimate goal is to outfit the CMM with a hall effect sensor so we can map out magnetic fields in relation to actual geometry of the electromagnets. The current stop and go method I have will take about 55 hours to complete. If there was a way for me to capture xyz and timestamp data as the CMM traveled from point A to point B this would save an incredible amount of time. I spoke with Zeiss about this but they're reluctant to give away any of their secret sauce. Link to comment Share on other sites More sharing options...
[Er...] Posted September 30, 2019 Share Posted September 30, 2019 Im pretty sure you can do it with out stoping. But you have to use something called fork, and make two processes run simultainous. Im currently in England and working this week. But I'll write something for you when Im back and have a spare moment. These type of out of the box things are fun 🙂 Link to comment Share on other sites More sharing options...
[Da...] Posted September 30, 2019 Author Share Posted September 30, 2019 That would be a huge help. Thanks Eric! Link to comment Share on other sites More sharing options...
[Er...] Posted October 29, 2019 Share Posted October 29, 2019 Hey, Been a while, Ive had a lot to do and have Been knocked out by pneumonia for two weeks now. How ever, I managed to play a little with it just before I got sick and it did indeed work. Not perfect, but I can polished further. Ill post what Ive made so far once Im back at the office. Just letting you know that I havent forgotten 🙂 Link to comment Share on other sites More sharing options...
[Da...] Posted November 8, 2019 Author Share Posted November 8, 2019 Thanks, Eric. I think I may have found a solution. It involves using Calypso, PCM, and python together. I managed to find out how to establish a tcp connection to the controller using python and send and receive information. I'll be able to grab both position data and hall sensor data using python. With that figured out, the rest is pretty straight forward. Hope you start feeling better soon. Pneumonia can be tough to kick. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in