beautypg.com

Horner APG XL6 OCS User Manual

Page 60

background image

CH.11 MAN0883-05-EN

March 4, 2010

Page 60 of 135

#1037

Example 3
To turn PWM 1 output ON all the time

Set %AQ1-2 = Same value as AQ7-8 (duty cycle count)
Set %AQ5-6 = Any value (prescale count)
Set %AQ7-8 = Non-Zero value (period count)

Example 4
To turn PWM 1 output OFF all the time

Set %AQ1-2 = 0 (duty cycle count)
Set %AQ5-6 = Any value (prescale count)
Set %AQ7-8 = Any value 0 (period count)


11.7

STP Examples

Example 1
10,000,000 steps control sequence

The following example starts at 2.5 kHz and ramps up to 5 kHz during the first 1,000,000
steps. Then, it runs at 5 kHz for the next 8,000,000 steps. Finally during the last 1,000,000
steps it slows to a stop.


Set %AQ1 = 2500 (Hz)

{Start Frequency}

Set %AQ2 = 5000 (Hz)

{Run Frequency}

Set %AQ3-4 = 1000000 (Steps)

{Accel Count}

Set %AQ5-6 = 8000000 (Steps)

{Run Count}

Set %AQ7-8 = 1000000 (Steps)

{Decel Count}


Example 2
5,000,000 steps control sequence

The following example starts at 0.5 kHz and ramps up to 1 kHz during the first 2,000,000
steps. Then, it runs at 1 kHz for the next 2,000,000 steps. Finally during the last 1,000,000
steps it slows to a stop.


Set %AQ1 = 500 (Hz)

{Start Frequency}

Set %AQ2 = 1000 (Hz)

{Run Frequency}

Set %AQ3-4 = 2000000 (Steps)

{Accel Count}

Set %AQ5-6 = 2000000 (Steps)

{Run Count}

Set %AQ7-8 = 1000000 (Steps)

{Decel Count}


Example 3
6,000,000 steps control sequence

The following example starts at 50 Hz and ramps up to 250 Hz during the first 150,000
steps. Then, it runs at 250 Hz for the next 5,500,000 steps. Finally during the last 350,000
steps it slows to a stop.


Set %AQ1 = 50 (Hz)

{Start Frequency}

Set %AQ2 = 250 (Hz)

{Run Frequency}

Set %AQ3-4 = 150000 (Steps)

{Accel Count}

Set %AQ5-6 = 5500000 (Steps)

{Run Count}

Set %AQ7-8 = 350000 (Steps)

{Decel Count}


Note: The highest usable frequency is 65 KHz for the PWM output.