Editing Pulse burst positioning
Your changes will be displayed to readers once an authorized user accepts them. (help) |
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 10: | Line 10: | ||
==How to use== | ==How to use== | ||
Pulse burst is the minimalistic yet high performing position setpoint method available. Suitable signal may be generated by various means: | Pulse burst is the minimalistic yet high performing position setpoint method available. Suitable signal may be generated by various means: | ||
− | * | + | *[[PLC]] |
*A simple timer & counter circuit | *A simple timer & counter circuit | ||
*Microcontroller [[GPIO]] pin | *Microcontroller [[GPIO]] pin | ||
Line 17: | Line 17: | ||
====Drive parameterization==== | ====Drive parameterization==== | ||
In [[Argon]] the following configuration enables burst pulse mode: | In [[Argon]] the following configuration enables burst pulse mode: | ||
− | *Set | + | *Set [[CM]] as Position control |
− | *Set | + | *Set [[CRI]] as Pulse train & direction |
− | *Set | + | *Set [[CAL]] and [[CVL]] to your desired acceleration and velocity values |
*Wire J5 connector according to [[Argon_user_guide/J5_connector_electrical_interfacing#Complete_example_with_pulse_.26_direction|this diagram]] | *Wire J5 connector according to [[Argon_user_guide/J5_connector_electrical_interfacing#Complete_example_with_pulse_.26_direction|this diagram]] | ||
====Doing incremental move==== | ====Doing incremental move==== | ||
The C-style code below generates the signaling. | The C-style code below generates the signaling. | ||
− | < | + | <pre> |
void IncrementalMove( int distance ) | void IncrementalMove( int distance ) | ||
{ | { | ||
Line 38: | Line 38: | ||
for( i=0; i< abs(distance); i++ ) | for( i=0; i< abs(distance); i++ ) | ||
{ | { | ||
− | Delay_ms(0.001); | + | Delay_ms(0.001); |
SetPulseOutputPin(1); | SetPulseOutputPin(1); | ||
− | Delay_ms(0.001); | + | Delay_ms(0.001); |
SetPulseOutputPin(0); | SetPulseOutputPin(0); | ||
} | } | ||
− | }</ | + | }</pre> |
* SetPulseOutputPin sets the digital state of HSIN1 pin on Argon | * SetPulseOutputPin sets the digital state of HSIN1 pin on Argon | ||
Line 50: | Line 50: | ||
====Monitoring when motion is complete==== | ====Monitoring when motion is complete==== | ||
Returns ''true'' when motion has successfully finished. ''False'' if timeout expired or drive faulted. | Returns ''true'' when motion has successfully finished. ''False'' if timeout expired or drive faulted. | ||
− | < | + | <pre>bool WaitForMoveDone( double timeout ) |
− | bool WaitForMoveDone( double timeout ) | + | |
{ | { | ||
double waited=0; | double waited=0; | ||
Line 64: | Line 63: | ||
/*motion is not complete, wait some time and poll again*/ | /*motion is not complete, wait some time and poll again*/ | ||
− | Delay_ms( | + | Delay_ms(0.01); |
waited=waited+0.01; | waited=waited+0.01; | ||
} | } | ||
Line 70: | Line 69: | ||
/*return false because timeouted */ | /*return false because timeouted */ | ||
return false; | return false; | ||
− | }</ | + | }</pre> |
*GetMotionCompletePinState reads the GPO1 pin state from [[Argon]] | *GetMotionCompletePinState reads the GPO1 pin state from [[Argon]] | ||
*GetFaultPinState reads the GPO3 pin state from [[Argon]] | *GetFaultPinState reads the GPO3 pin state from [[Argon]] | ||
====Usage example==== | ====Usage example==== | ||
− | < | + | <pre>IncrementalMove(500); |
− | IncrementalMove(500); | + | |
WaitForMoveDone(); | WaitForMoveDone(); | ||
IncrementalMove(1000); | IncrementalMove(1000); | ||
WaitForMoveDone(); | WaitForMoveDone(); | ||
IncrementalMove(-1500); | IncrementalMove(-1500); | ||
− | WaitForMoveDone();</ | + | WaitForMoveDone();</pre> |
− | + | ||
− | + | ||
− | + |