Jump to content
OMRON Forums

Reading analog value at set positions during a move


jackvoxel8.com
 Share

Recommended Posts

I am trying to generate a CompTable with an analog distance sensor I have mounted to my gantry.

 

My goal is to command a continuous move along one axis, then get readings from my analog distance sensor at set distances along that move (say every 20mm). Ideally I would like to put these readings directly into the CompTable array (after some transformations to convert raw sensor readings to motor counts).

 

I currently have a PLC that simply loops, looks at current position, and records the sensor value when current position is equal to desired position.

 

Is there a simpler or more automated way to accomplish this?

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

I am trying to trigger off of encoder position, not off of the analog input.

 

I've been reading through the User's Manual trying to figure out how to solve this, and I think a Capture/Compare Interrupt Service Routine might be what I need (p796)

 

Do you have any experience with those?

Link to comment
Share on other sites

It is possible to use the Capture/Compare ISR to start your routine extremely quickly on reaching a particular position (sub-servo cycle timing), but I'm not sure it will do you any good because you can't sample the ADC at that instant, so you lose the time advantage you gain by using the ISR.
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share


×
×
  • Create New...