Jump to content
OMRON Forums

Using Sys.PosCtrl changes DesPos but not DAC register


tanakakai

Recommended Posts

As suggested by Curt during my training, I am using Motor[1].Ctrl = Sys.PosCtrl to force a direct open loop output to the Dac register.

 

The basic gist of the program is that it generates a sine wave by moving one axis of a circular motion.

 

When running my code (or jogging the motor) the desired position changes but there is no change to Acc24E2A[6].Chan[0].Dac[0] (the configured Dac register. DesPos was monitored in the scope to verify that it was in fact being generated correctly.

 

Currently I do not have an encoder connected to the system (as it's not supposed to use any feedback).

 

While Running:

 

Motor Status (True):

HomeComplete

FeWarn

ClosedLoop

AmpEna

PhaseFound

Csolve

 

Coordinate System Status (True):

FeWarn

TimerEnabled

HomeComplete

ClosedLoop

AmpEna

BlockRequest (flashes)

TimersEnabled

Csolve

ContMotion

SegEnabled

AddedDwellDis

ProgRunning

ProgActive

ProgProceeding

Link to comment
Share on other sites

  • Replies 8
  • Created
  • Last Reply

Top Posters In This Topic

This setup is working for me here today. Here are some things to look at:

 

What is the value of Motor[x].IqCmd (the servo output)? This should be 1/65536 of the desired position value, as it is scaled as a signed 16-bit value, not 32 bits.

 

Double check the motor's output address. It should report back as Acc24E2A[6].Chan[0].Pwm[0].a, which is the same address as Dac[0].

 

This register is scaled as 24 bits at the high end of the 32-bit data bus. It only has physical circuitry in the high 18 bits. This means that the low 14 bits written over the 32-bit data bus are lost, so a value of 16384 is required even to get 1 LSB out on the DAC. Full range on the DAC corresponds to +/-2G.

 

Try just jogging the motor while all key variables are monitored in the watch window. This should help you get a feeling for the numbers.

Link to comment
Share on other sites

Curt, I will check on the status of IqCmd.

 

I have verified that:

 

*Motor[1].pDac = Acc24E2A[6].Chan[0].Pwm[0].a

 

*Acc24E2A[6].Chan[0].Pwm[0] = 0 while DesPos changes (via monitoring w/ both the internal IDE scope)

 

The jog functions do the same thing. They will change DesPos but not the Dac register.

 

I am currently trying to replicate the issue after having to perform a full reset on the system.

 

edit:

 

Looking at IqCmd while using the Jog Ribbon, it does in fact change when I press the jog buttons. However, there is still no change in the Dac register. I am on Motor 1 and it is defined as:

 

Motor[1].pDac=Acc24E2A[6].Chan[0].Pwm[0].a

 

I know it's not the hardware, if I click "enable output" in system setup I can manually change output voltage. I can also write directly to the Dac address and get an output, I just can't get any output when working with the scripting language.

 

edit2:

Here are some pictures from the scope.

Signal.png.cbdf43374fc5e008187411e743250bd2.png

153854920_DacLevelinScope.png.d1a8c0f8b523f92a23aa9c3728fd77c1.png

Link to comment
Share on other sites

I note that your "PhaseFound" status bit is true, which implies that the setup element Motor[x].PhaseCtrl is greater than zero, enabling phase algorithms. If this is true for the motor, the output of the servo algorithm is not written directly to the pDac register, but used as an input to the phase commutation algorithm. Make sure PhaseCtrl is set to 0.
Link to comment
Share on other sites

As far as I can tell PhaseCtrl is set to zero (but PhaseFound is still true).

 

Here is the code I'm running as well:

undefine all;

Coord[1].SegMoveTime = 1;

global myrad = 1; //In Volts
global ctr;
global maxctr = 8;
global period = 1000;
global loc=0;
global valueof

&1#1->838861x  //Gain for Close-Loop output

Motor[1].Ctrl = Sys.PosCtrl;  //Set output for Open-Loop output
Motor[1].FatalFeLimit = 0; //Prevent disable from over error limit
Motor[1].MaxSpeed=300000;

open prog 1
// --------------------User Code Goes Here------------------------
Acc24E2A[6].Chan[0].AmpEna=1;
Motor[1].Desired.Pos = 0;


loc = 1;
tm(period) x(myrad);

loc = 2;
circle1 tm(period) ts 0 ta 0;

ctr = 0;

//Gather.Enable = 2;

loc = 3;
while (ctr < maxctr)
{
loc =4;
x(myrad) i(-myrad)
ctr ++
}

loc =5;
dwell 100;

//Gather.Enable = 0;

x0;

close
/****************************************/

PhaseCtrl.png.0bc7aba2e94e7f30d188571d4ffbeaae.png

Link to comment
Share on other sites

The most likely remaining possibility is that something else is overwriting the DAC register every servo cycle.

 

What happens if you set Motor[1].pDac to another register? Try:

 

Motor[1].pDac = Gate1[4].Chan[0].Dac[1].a

Motor[1].pDac = Gate1[4].Chan[3].Dac[1].a

Motor[1].pDac = Sys.Idata[256].a

 

Do you see your values in these registers?

 

Look at the other motor numbers. Are any of them activated (Motor[x].ServoCtrl > 0)? If so, are any of them writing to the same register?

Link to comment
Share on other sites

Motor[1].pDac = Gate1[6].Chan[0].Dac[1].a <- Did not work

Motor[1].pDac = Gate1[6].Chan[3].Dac[1].a <- Did not work

Motor[1].pDac = Sys.Idata[256].a <- Worked

 

No other motors were active. (Only checked motors 1-10, but there's no reason any motor beyond 2 would be assigned to anything, I only have 2 channels of motor output connected to the pmac)

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

×
×
  • Create New...