Introduction
Recently, I got my hands on a Univelop CNC 4\5 Axis controller board and wanted to write Linux user mode code to interface with the board. The board has the ability to control up to 5 steppers and 6 switches (4 axis limiters \ 1 Stop \ 1 Aux). The code also uses virtual positioning to allow the implementer to move the stepper to virtual positions, say -50 to +50. The class allows for per axis stepper pulse delays since the implementer may have different speed steppers for each axis. It may be necessary to increase the delay for slower steppers. A too fast delay leads to the stepper buzzing and not rotating. The switch state functions return true if the switch is closed, and false if open. The Univelop5Axis
class functions are well commented, and the Univelop user manual is attached to the top of this page. The manual shows all the pin out information needed to understand the inner workings of the code.
The attached project was done with CodeBlocks, but will also compile from command line using GCC.
Using the Code
Below is a list of the core functions of the class. The following can be in your main function:
#define BASEPORT 0x378
Univelop5Axis r( BASEPORT );
printf( "AuxState: %d\n" , r.IsSetAux() );
printf( "StopState: %d\n" ,r.IsSetStop() );
printf( "XlimState: %d\n" ,r.IsSetXLimit() );
printf( "YlimState: %d\n" ,r.IsSetYLimit() );
printf( "ZlimState: %d\n" ,r.IsSetZLimit() );
printf( "AlimState: %d\n" ,r.IsSetALimit() );
printf( "Testing stepper X movement\n");
r.StepX( 500 , Univelop5Axis::CW);
r.StepX( 500 , Univelop5Axis::CCW);
printf( "Testing stepper Y movement\n");
r.StepY( 500 , Univelop5Axis::CW);
r.StepY( 500 , Univelop5Axis::CCW);
printf( "Testing stepper Z movement\n");
r.StepZ( 500 , Univelop5Axis::CW);
r.StepZ( 500 , Univelop5Axis::CCW);
printf( "Testing stepper A movement\n");
r.StepA( 500 , Univelop5Axis::CW);
r.StepA( 500 , Univelop5Axis::CCW);
printf( "Testing stepper C movement\n");
r.StepC( 500 , Univelop5Axis::CW);
r.StepC( 500 , Univelop5Axis::CCW);
r.MoveXTo( 200 ); r.MoveXTo( -200 ); r.MoveXTo( 0 );
r.MoveYTo( 200 );
r.MoveYTo( -200 );
r.MoveYTo( 0 );
r.MoveZTo( 200 );
r.MoveZTo( -200 );
r.MoveZTo( 0 );
r.MoveATo( 200 );
r.MoveATo( -200 );
r.MoveATo( 0 );
r.MoveCTo( 200 );
r.MoveCTo( -200 );
r.MoveCTo( 0 );
Univelop Board Images
This is the main board which plugs into the parallel port:
This is the main board with Axis controllers attached:
History
- June 12th 2009 - Initial release.