Latest status @ http://www.picaxeforum.co.uk/showpost.php?p=167297&postcount=8
Latest video of ... @ http://www.picaxeforum.co.uk/showpost.php?p=167325&postcount=9
Video of Manual Wired controller interfaced into the solution http://www.youtube.com/watch?v=DIaQ-o8hPXE
I am in the process of modifying a 5 Axis Toy Robot for education use. This requires a language to control the five axis.
My design goal is to provide a simple but really understandable method of using a five axis robot that can simulate real life and be used from the output of a CADCAM modeller.
I am sharing the concept and examples of the inputs and outputs to gather some feedback.
A little history. CNC controllers like the Siemens Sinumeric, FANUC, Heidenhain, Mazak generally use one international standard - ISO 6983.
This standard uses G-codes as the common method to control computer numerical control (CNC) machines, G-Codes has many implementations. Used mainly in automation, G-Codes are part of computer-aided engineering. This general sense of the term, referring to the language overall (using the mass sense of "code"), is imprecise, because it comes metonymically from the literal sense of the term, referring to one letter address among many in the language (G address, for preparatory commands) and to the specific codes (count sense) that can be formed with it (for example, G00, G01, G28).
For this implementation I have limited the implementation to the following codes:
G00 - Set rapid movement of axis(s)
G91 - Incremental movement of axis(s)
G04 - Dwell
G95 - Set feedrate of axis(s)
G29 - Check for home position (I made this one up!)
G10 - Repeat total operation a number of times
G90 - Not yet implemented
and some M codes
M30 - Repeat all code decrementing G10 value until 0
M00 - Stop program
This evening I have written the specification mainly from memory and Wiki as I was the Program Manager for an 11 axis CNC machine in the 1980s. I was also a Product Manager for some CNC software, and other stuff related to some this (a long time ago).
For your review and feedback, my current state of play.
The source code - this example checks the position of the robot and then moves the A axis.
# G29 check all axis are at home
G29ABCDE
# G00 Set all axis to rapid
G00
# G91 Incremental move axis 1024 units of travel
G91A1024
# G04 Dwell
G04T4
# G91 Incremental move axis -2048 units
G91A-2048
# G04 Dwell
G04T4
# G91 Incremental move axis back to start!
G91A1024
# G95 Set axis movement speed (actually a PWM value)
G95A500
G95B600
G95C700
G95D800
G95E900
# N4 Repeat Number of times
# G10N5
# M30 Loop to top decrementing counter G10
# M30
# M00 Stop
# M00
The post process then converts this into the code that will be passed to the Picaxe for handling via Serial In, the Picaxe responds via the Serial Out.
This is a man readable version of the Picaxe code. The first and last line simple instructs the Picaxe where the start and end of the code stream is.
Each G code is converted to the Picaxe control string, as series of 'L'oad commands and action. These are specified in pairs,as shown below:
The L command, lowers an Axis logic flag within the Picaxe controlling the axis ad the second parameter which follows the L is the specific axis, as follows:
1 = A axis
2 = B axis
3 = C axis
4 = D axis
5 = E axis (actually the jaws).
The C (G29) command, check an axis is physically positioned over a reference point (this means an axis sensor set a channel in a 74xx165).
The X (Xexecute) command is the expected return value from the 74xx165.
The R (G00) command set the axis transversal speed.
The A (G91) command moves the A axis an increment of 1024 gearbox pulse. All positive movement are specified above 32768 and all negative less than 32768.
The T (G02) command is the dwell.
See this example. Output from the post processor this evening.
V,1;
L,1;C,1;L,2;C,2;L,3;C,3;L,4;C,4;L,5;C,5;X,31;
L,1;R,9999;L,2;R,9999;L,3;R,9999;L,4;R,9999;L,5;R,9999;X,31;
L,1;A,33792;X,1;
L,4;L,5;L,1;L,2;L,3;X,31;T,4;
L,1;A,30720;X,1;
L,4;L,5;L,1;L,2;L,3;X,31;T,4;
L,1;A,33792;X,1;
L,1;A,500;X,1;
L,2;B,600;X,2;
L,3;C,700;X,4;
L,4;D,800;X,8;
L,5;E,900;X,16;
V,0;
What is the overall architecture? Via a terminal session program on the PC, I to pass each pair to the axis controlling Picaxe, this Picaxe then lowering a control flag, then the controller Picaxe passes the data, the axis controller then executes the command and when it completes the command it raises the control flag and then the controller Picaxe inspects a 74xx165 which passes the result back to the PC which in then enables the move onto the next set of instructions.
Now, before you all say this will not work because we have to use the serial in commands with sync.... I have the man unreadable code that will be actually passed to the controlling Picaxe from the PC terminal. See below, this code differs as the code contains markers to ensure receipt by the controlling Picaxe.
V,1;ABCL,1;ABCC,1;ABCL,2;ABCC,2;ABCL,3;ABCC,3;ABCL,4;ABCC,4;ABCL,5;ABCC,5;ABCX,31;ABCL,1;ABCR,9999;ABCL,2;ABCR,9999;ABCL,3;ABCR,9999;ABCL,4;ABCR,9999;ABCL,5;ABCR,9999;ABCX,31;ABCL,1;ABCA,33792;ABCX,1;ABCL,4;ABCL,5;ABCL,1;ABCL,2;ABCL,3;ABCX,31;ABCT,4;ABCL,1;ABCA,30720;ABCX,1;ABCL,4;ABCL,5;ABCL,1;ABCL,2;ABCL,3;ABCX,31;ABCT,4;ABCL,1;ABCA,33792;ABCX,1;ABCL,1;ABCA,500;ABCX,1;ABCL,2;ABCB,600;ABCX,2;ABCL,3;ABCC,700;ABCX,4;ABCL,4;ABCD,800;ABCX,8;ABCL,5;ABCE,900;ABCX,16;V,0;
This is the same instruction set except it is harder to read! I expect this instruction set is to become very large for a real program of five axis movement.
So, from this note. What have I missed in this overall approach? I have one axis moving.... the method works. Is there anyone interested in re-use/developing the concept further? Any value is this?
Anobium
Latest video of ... @ http://www.picaxeforum.co.uk/showpost.php?p=167325&postcount=9
Video of Manual Wired controller interfaced into the solution http://www.youtube.com/watch?v=DIaQ-o8hPXE
I am in the process of modifying a 5 Axis Toy Robot for education use. This requires a language to control the five axis.
My design goal is to provide a simple but really understandable method of using a five axis robot that can simulate real life and be used from the output of a CADCAM modeller.
I am sharing the concept and examples of the inputs and outputs to gather some feedback.
A little history. CNC controllers like the Siemens Sinumeric, FANUC, Heidenhain, Mazak generally use one international standard - ISO 6983.
This standard uses G-codes as the common method to control computer numerical control (CNC) machines, G-Codes has many implementations. Used mainly in automation, G-Codes are part of computer-aided engineering. This general sense of the term, referring to the language overall (using the mass sense of "code"), is imprecise, because it comes metonymically from the literal sense of the term, referring to one letter address among many in the language (G address, for preparatory commands) and to the specific codes (count sense) that can be formed with it (for example, G00, G01, G28).
For this implementation I have limited the implementation to the following codes:
G00 - Set rapid movement of axis(s)
G91 - Incremental movement of axis(s)
G04 - Dwell
G95 - Set feedrate of axis(s)
G29 - Check for home position (I made this one up!)
G10 - Repeat total operation a number of times
G90 - Not yet implemented
and some M codes
M30 - Repeat all code decrementing G10 value until 0
M00 - Stop program
This evening I have written the specification mainly from memory and Wiki as I was the Program Manager for an 11 axis CNC machine in the 1980s. I was also a Product Manager for some CNC software, and other stuff related to some this (a long time ago).
For your review and feedback, my current state of play.
The source code - this example checks the position of the robot and then moves the A axis.
# G29 check all axis are at home
G29ABCDE
# G00 Set all axis to rapid
G00
# G91 Incremental move axis 1024 units of travel
G91A1024
# G04 Dwell
G04T4
# G91 Incremental move axis -2048 units
G91A-2048
# G04 Dwell
G04T4
# G91 Incremental move axis back to start!
G91A1024
# G95 Set axis movement speed (actually a PWM value)
G95A500
G95B600
G95C700
G95D800
G95E900
# N4 Repeat Number of times
# G10N5
# M30 Loop to top decrementing counter G10
# M30
# M00 Stop
# M00
The post process then converts this into the code that will be passed to the Picaxe for handling via Serial In, the Picaxe responds via the Serial Out.
This is a man readable version of the Picaxe code. The first and last line simple instructs the Picaxe where the start and end of the code stream is.
Each G code is converted to the Picaxe control string, as series of 'L'oad commands and action. These are specified in pairs,as shown below:
The L command, lowers an Axis logic flag within the Picaxe controlling the axis ad the second parameter which follows the L is the specific axis, as follows:
1 = A axis
2 = B axis
3 = C axis
4 = D axis
5 = E axis (actually the jaws).
The C (G29) command, check an axis is physically positioned over a reference point (this means an axis sensor set a channel in a 74xx165).
The X (Xexecute) command is the expected return value from the 74xx165.
The R (G00) command set the axis transversal speed.
The A (G91) command moves the A axis an increment of 1024 gearbox pulse. All positive movement are specified above 32768 and all negative less than 32768.
The T (G02) command is the dwell.
See this example. Output from the post processor this evening.
V,1;
L,1;C,1;L,2;C,2;L,3;C,3;L,4;C,4;L,5;C,5;X,31;
L,1;R,9999;L,2;R,9999;L,3;R,9999;L,4;R,9999;L,5;R,9999;X,31;
L,1;A,33792;X,1;
L,4;L,5;L,1;L,2;L,3;X,31;T,4;
L,1;A,30720;X,1;
L,4;L,5;L,1;L,2;L,3;X,31;T,4;
L,1;A,33792;X,1;
L,1;A,500;X,1;
L,2;B,600;X,2;
L,3;C,700;X,4;
L,4;D,800;X,8;
L,5;E,900;X,16;
V,0;
What is the overall architecture? Via a terminal session program on the PC, I to pass each pair to the axis controlling Picaxe, this Picaxe then lowering a control flag, then the controller Picaxe passes the data, the axis controller then executes the command and when it completes the command it raises the control flag and then the controller Picaxe inspects a 74xx165 which passes the result back to the PC which in then enables the move onto the next set of instructions.
Now, before you all say this will not work because we have to use the serial in commands with sync.... I have the man unreadable code that will be actually passed to the controlling Picaxe from the PC terminal. See below, this code differs as the code contains markers to ensure receipt by the controlling Picaxe.
V,1;ABCL,1;ABCC,1;ABCL,2;ABCC,2;ABCL,3;ABCC,3;ABCL,4;ABCC,4;ABCL,5;ABCC,5;ABCX,31;ABCL,1;ABCR,9999;ABCL,2;ABCR,9999;ABCL,3;ABCR,9999;ABCL,4;ABCR,9999;ABCL,5;ABCR,9999;ABCX,31;ABCL,1;ABCA,33792;ABCX,1;ABCL,4;ABCL,5;ABCL,1;ABCL,2;ABCL,3;ABCX,31;ABCT,4;ABCL,1;ABCA,30720;ABCX,1;ABCL,4;ABCL,5;ABCL,1;ABCL,2;ABCL,3;ABCX,31;ABCT,4;ABCL,1;ABCA,33792;ABCX,1;ABCL,1;ABCA,500;ABCX,1;ABCL,2;ABCB,600;ABCX,2;ABCL,3;ABCC,700;ABCX,4;ABCL,4;ABCD,800;ABCX,8;ABCL,5;ABCE,900;ABCX,16;V,0;
This is the same instruction set except it is harder to read! I expect this instruction set is to become very large for a real program of five axis movement.
So, from this note. What have I missed in this overall approach? I have one axis moving.... the method works. Is there anyone interested in re-use/developing the concept further? Any value is this?
Anobium
Last edited: