Jump to content
OMRON Forums

help configuring a stepper driver with ACC24E3


laaguirre
 Share

Recommended Posts

Anyone has been able to drive the pfm on the ACC24E3?

 

Here is my configuration but I get no pulses - what is missing?

 

// Power PMAC Script PLC Program Template.

// The following Sample PLC PROGRAM is the standard template for creating Script PLC Programs.

// Sample PLC PROGRAM

// to test do:

// 1) download the file

// 2) type enable plc 3

// 3) type #1 out 10 and monitor the motor 1 status (should enable in open loop and send pulses..

// 3) type #1 k and follow with #1j/ and jog j+ to close the loop, move

/****************************************/

close

 

open plc 3

// --------------------User Code Goes Here------------------------

Sys.WpKey = $AAAAAAAA;

 

Gate3[0].Chan[0].OutputMode=8 // PFM on Output Format (1)

Gate3[0].Chan[0].EncCtrl=8

Gate3[0].Chan[0].TimerMode=3

Gate3[0].Chan[0].OutFlagD = 1; // enable pulse and direction outputs - phase D

Gate3[0].PfmClockDiv = 5 // Control the Frequency froma 100MHz/2^5

Gate3[0].Chan[0].PfmWidth = $f // Controls the Width $f is default

Gate3[0].Chan[0].OutputPol = 0 // Controls the Polarity - 0 default

Gate3[0].Chan[0].PfmDirPol = 0 // Controls the Polarity of the Dir - 0 default

// Gate3[0].Chan[1].PfmOutFormat=1 // lets see

 

Sys.WpKey = 0;

 

//Motor 1 Setup

 

Motor[1].ServoCtrl = 1;

Motor[1].PhaseCtrl = 0;

Motor[1].pDac=Acc24E3[0].Chan[0].Pfm.a

 

EncTable[1].type=1

EncTable[1].pEnc=Gate3[0].Chan[0].ServoCapt.a

//EncTable[2].pEnc1=Gate3[0].Chan[0].TimeBetweenCts.a

EncTable[1].index1=0

EncTable[1].index2=0

EncTable[1].index3=0

EncTable[1].MaxDelta=0

EncTable[1].ScaleFactor=1/256

 

 

// setting motor

Motor[1].pEnc= EncTable[1].a // Position address

Motor[1].pEnc2= EncTable[1].a // Velocity address

Motor[1].Servo.Kp=40

Motor[1].Servo.Kvfb=0

Motor[1].Servo.Kvff=40

Motor[1].Servo.Ki=0.001

Motor[1].AmpFaultLevel = 0

Motor[1].pLimits=0

Motor[1].FatalFeLimit = 5000000 // large number for testing

 

Disable PLC 3

close

/****************************************/

Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

I don't see anything wrong in the setup here. Using just the Gate3 hardware setup variables (no active motor trying to write to the PFM register), can you get any output signals by writing non-zero values directly to the Pfm element?

 

Do your Gate3 element settings "take" (i.e. can you read back the values you wrote)?

 

Does the channel's ServoCapt element change steadily when non-zero values are written to Pfm? (This wrap back occurs inside the ASIC.) Query it in the Watch Window.

 

The direction outputs are on the same pins as the U and V input flags for the channel. Can you see the value of the UVW element for the channel change as you put positive and negative commands in the Pfm element?

Link to comment
Share on other sites

  • 2 months later...

Has anyone figured out whether the Acc24E3 stepper example provided by laaguirre was correct? I am trying to set up a stepper with the Acc24E3 using his example (the IDE approach that I tried was not successful). What I am seeing is this:

 

1. Following error is counting up indefiinitely (fatal following error is disabled).

2. Motor position sometimes counts a few pulses at the start of a jog but will not count continuously.

3. I usually feel the stepper motor microstep whenever encoder counts up a pulse or two.

4. Tried lots of different divisors on both the PfmClock and EncClock. Can't seem to find any that work.

 

What (if anything) is wrong with the example presented by laaguirre?

 

 

 

Link to comment
Share on other sites

Mike,

 

Are you using the System Setup utility, under Tools in the IDE?

 

Also, it was suggested that you look at pages 12 and following of the "Power PMAC Basic Motor Setup" manual for configuring Pulse and Direction, which is commonly used for stepper motors.

Link to comment
Share on other sites

Here are the examples for setting pulse and direction output on ACC-24E3:

 

Sys.WpKey=$AAAAAAAA

Gate3[0].PfmClockDiv=5
Gate3[0].chan[0].OutputMode=$8
Gate3[0].chan[0].packoutdata=0
Gate3[0].chan[0].packindata=0
Gate3[0].Chan[0].PfmWidth=10
Gate3[0].Chan[0].OutFlagD=1

Motor[1].pDac=Gate3[0].Chan[0].Pfm.a
Motor[1].pLimits=0
Motor[1].pAmpFault=0
Motor[1].pAmpEnable=0
Motor[1].ServoCtrl=1

 

Now if you want to use internal pulse and direction counter for feedback:

Sys.WpKey=$AAAAAAAA

Gate3[0].EncClockDiv=5
Gate3[0].chan[0].EncCtrl = 8
Gate3[0].Chan[0].TimerMode=0

 

or if you want to bring in the pulse and direction as feedback to the system:

Sys.WpKey=$AAAAAAAA

Gate3[0].EncClockDiv=5
Gate3[0].chan[0].EncCtrl = 0
Gate3[0].Chan[0].TimerMode=3

 

 

Link to comment
Share on other sites

Thanks Sina. I spoke with Greg yesterday. When we spoke, I had just discovered the fundamental problem with the posted example. It was that the Gate[0].Chan[0].PackOutData value was not set to zero. The posted example does not set PackOutData to zero and assumes its default value. In my case, it had a value of 2. This apparently caused the servo command to not be converted properly to the pulse frequency. None of the documentation that I referenced while debugging had indicated that the PackOutData parameter needed to be set for pulse/direction applications. It turns out that it is critical.

 

The following is my revised code which I am using to drive an Applied Motion HT13 stepper motor. I am microstepping 25,000 steps/rev and at a rate of 500,000 steps per second (20 rev/sec). Note also the use of deadband (KBreak and BreakPosError) to allow the stepper driver (Parker E-AC) to enter standby (low power) mode. If you don't apply a deadband, the PMAC will dither counts out to the drive. This constant dithering wakes it up so that it never goes into standby. Stepper motors run much cooler if you use standby power to hold position when no motion is requested. Deadband of at least one half step should probably be used in most stepper applications.

 

Mike

 

/****************************************/
// Power PMAC Script PLC Program Template.
// The following Sample PLC PROGRAM is the standard template for creating Script PLC Programs.
// Sample PLC PROGRAM
// to test do:
// 1) download the file
// 2) type enable plc 3
// 3) type #1 out 10 and monitor the motor 1 status (should enable in open loop and send pulses..
// 3) type #1 k and follow with #1j/ and jog j+ to close the loop, move
/****************************************/
close

open plc 1
// --------------------User Code Goes Here------------------------
Sys.WpKey=$AAAAAAAA;

Gate3[0].Chan[0].EncCtrl=8;
Gate3[0].Chan[0].TimerMode=3;
Gate3[0].Chan[0].PackInData=0;
Gate3[0].Chan[0].PackOutData=0;  // this is critical!!!!  otherwise, pulse stream is not generated properly
Gate3[0].Chan[0].OutFlagD=1;     // enable pulse and direction outputs - phase D
Gate3[0].PfmClockDiv=0;          // control the Frequency division 100MHz/2^0 
Gate3[0].EncClockDiv=0;          // this value must be less than or equal to PfmClockDiv per documentation
Gate3[0].Chan[0].PfmWidth=128;   // controls the Width $f is default
Gate3[0].Chan[0].OutputPol=2;    // controls the Polarity - 0 default
Gate3[0].Chan[0].PfmDirPol=0;    // controls the Polarity of the Dir - 0 default
Gate3[0].Chan[0].OutputMode=8;   // PFM on Output Format (1)

Sys.WpKey=0;

//Motor 1 Setup
Motor[1].ServoCtrl=1;
Motor[1].PhaseCtrl=0;
Motor[1].pDac=Acc24E3[0].Chan[0].Pfm.a;

EncTable[1].Type=3;
EncTable[1].pEnc=Gate3[0].Chan[0].ServoCapt.a;
EncTable[1].pEnc1=Gate3[0].Chan[0].TimerA.a;
EncTable[1].index1=0;
EncTable[1].index2=0;
EncTable[1].index3=0;
EncTable[1].MaxDelta=0;
EncTable[1].ScaleFactor=1/256;

// setting motor
Motor[1].pEnc= EncTable[1].a;    // Position address
Motor[1].pEnc2= EncTable[1].a;   // Velocity address
Motor[1].Servo.Kp=1;
Motor[1].Servo.Kd1=0;
Motor[1].Servo.Kd2=0;
Motor[1].Servo.Kd3=0;
Motor[1].Servo.Kd4=0;
Motor[1].Servo.Kd5=0;
Motor[1].Servo.Kd6=0;
Motor[1].Servo.Kd7=0;
Motor[1].Servo.Kvfb=0;
Motor[1].Servo.Kvff=1.5;
Motor[1].Servo.Kaff=0;
Motor[1].Servo.Ki=0;
Motor[1].Servo.Kbreak=0;        // zero gain in deadband area
Motor[1].Servo.BreakPosErr=1;   // deadband of 1 count should keep stepper driver from coming out of standby power mode
Motor[1].AmpFaultLevel=0;
Motor[1].pLimits=0;
Motor[1].pAmpEnable=0;
Motor[1].pAmpFault=0;
Motor[1].WarnFeLimit=0;   // disable following warning (for testing only)
Motor[1].FatalFeLimit=0;  // disable followeing error (for testing only)
Motor[1].MaxDac=32767;
Motor[1].MaxSpeed=500;    // 500 cts/msec = 500,000 cts/sec = 20 revs/sec @ 25,000 steps/rev
Motor[1].JogSpeed=50;     // 50 cts/msec = 50,000 cts/sec = 2 revs/sec @ 25,000 steps/rev

Disable PLC 1
close
/****************************************/

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share


×
×
  • Create New...