Skip to content

Commit cb17d79

Browse files
author
Alec Miller
committed
MPAE-4022: Edits to readme
1 parent 2201316 commit cb17d79

File tree

1 file changed

+17
-37
lines changed

1 file changed

+17
-37
lines changed

readme.md

Lines changed: 17 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
<!-- Please do not change this html logo with link -->
21
<a href="https://www.microchip.com" rel="nofollow"><img src="images/microchip.png" alt="MCHP" width="300"/></a>
32

4-
# PIC18F7Q84 Two Axis CNC Machine
3+
# PIC18F57Q84 Two Axis CNC Machine
54

65
This project demonstrates an implementation of a 2-axis computer numerical
7-
control (CNC) machine which makes use of the Direct Memory Address (DMA),
8-
Numerically Controlled Oscillator (NCO) and other Core Independent Peripherals
6+
control (CNC) machine which makes use of the Numerically Controlled Oscillator (NCO), Direct Memory Address (DMA) and other Core Independent Peripherals
97
(CIPs) to handle acceleration and movement with minimal input from the
108
microcontroller core.
11-
with minimal
129

1310

1411
## Theory of Operation
@@ -18,7 +15,7 @@ This is a general overview of the application. A more complete explanation can
1815

1916
Numerically Controlled Oscillators are a peripheral which work by creating
2017
an output frequency which is a precise fraction of the input frequency.
21-
This frequency is a function of two values, the input frequency, and the
18+
This output frequency is a function of two values, the input frequency, and the
2219
value of the increment register of the NCO.
2320
This project makes use of three NCOs, a master NCO which determines overall speed,
2421
and a slave NCO for each axis which determines the proportion of speed in each
@@ -28,7 +25,7 @@ This is a general overview of the application. A more complete explanation can
2825

2926
For instance, if the goal is to move 200 mm in the X axis, and 100 mm in the Y
3027
axis, the X NCO can be set to produce twice the frequency of output as the
31-
Y NCO. This means that that X will move twice as fast, and therefore cover twice
28+
Y NCO. This means that X will move twice as fast, and therefore cover twice
3229
the distance.
3330

3431
Additionally, because both frequencies are a function of the master
@@ -37,10 +34,7 @@ doubled, while maintaining the same proportion (e.g. X will still be going twice
3734
as fast as Y, and will therefore still cover twice the distance).
3835

3936
Direct Memory Address (DMA) is a module which can copy data from one memory
40-
location to another when triggered. Acceleration of the machine can be achieved
41-
by using the DMA to gradually increase or decrease the value in the increment
42-
register of the NCO, resulting in the frequency of the master NCO, and therefore
43-
the speed of movement in the two axes, increasing or decreasing proportionally.
37+
location to another without any CPU intervention. DMA operation can be configured to start and/or abort based on several built-in trigger options. Acceleration of the machine can be achieved by using the DMA to gradually increase or decrease the value in the increment register of the NCO, resulting in the frequency of the master NCO, and therefore the speed of movement in the two axes, increasing or decreasing proportionally.
4438

4539
The distance travelled in each direction can be known by counting the number of
4640
pulses from the master NCO. In short, this is because if the master
@@ -50,21 +44,12 @@ moved the steppers in both axes the correct distance.
5044

5145
## Related Documentation
5246

53-
<!-- Any information about an application note or tech brief can be linked here. Use unbreakable links!
54-
In addition a link to the device family landing page and relevant peripheral pages as well:
55-
- [AN3381 - Brushless DC Fan Speed Control Using Temperature Input and Tachometer Feedback](https://microchip.com/00003381/)
56-
- [PIC18F-Q10 Family Product Page](https://www.microchip.com/design-centers/8-bit/pic-mcus/device-selection/pic18f-q10-product-family) -->
57-
47+
<!-- - [AN1234 - Whatever the Title Is](https://www.microchip.com/design-centers/8-bit/pic-mcus/device-selection/pic18f-q84-product-family) THIS LINK MIGHT NOT BE VALID. REMOVE BEFORE FLIGHT. -->
5848
- [PIC18F-Q84 Family Product Page](https://www.microchip.com/design-centers/8-bit/pic-mcus/device-selection/pic18f-q84-product-family) THIS LINK MIGHT NOT BE VALID. REMOVE BEFORE FLIGHT.
5949

50+
6051
## Software Used
6152

62-
<!-- All software used in this example must be listed here. Use unbreakable links!
63-
- MPLAB® X IDE 5.30 or newer [(microchip.com/mplab/mplab-x-ide)](http://www.microchip.com/mplab/mplab-x-ide)
64-
- MPLAB® XC8 2.10 or a newer compiler [(microchip.com/mplab/compilers)](http://www.microchip.com/mplab/compilers)
65-
- MPLAB® Code Configurator (MCC) 3.95.0 or newer [(microchip.com/mplab/mplab-code-configurator)](https://www.microchip.com/mplab/mplab-code-configurator)
66-
- MPLAB® Code Configurator (MCC) Device Libraries PIC10 / PIC12 / PIC16 / PIC18 MCUs [(microchip.com/mplab/mplab-code-configurator)](https://www.microchip.com/mplab/mplab-code-configurator)
67-
- Microchip PIC18F-Q Series Device Support (1.4.109) or newer [(packs.download.microchip.com/)](https://packs.download.microchip.com/) -->
6853

6954
- MPLAB® X IDE 5.40 or newer [(microchip.com/mplab/mplab-x-ide)](http://www.microchip.com/mplab/mplab-x-ide)
7055
- MPLAB® XC8 2.20 or newer [(microchip.com/mplab/compilers)](http://www.microchip.com/mplab/compilers)
@@ -74,13 +59,6 @@ moved the steppers in both axes the correct distance.
7459

7560
## Hardware Used
7661

77-
<!-- All hardware used in this example must be listed here. Use unbreakable links!
78-
- PIC18F47Q10 Curiosity Nano [(DM182029)](https://www.microchip.com/Developmenttools/ProductDetails/DM182029)
79-
- Curiosity Nano Base for Click boards™ [(AC164162)](https://www.microchip.com/Developmenttools/ProductDetails/AC164162)
80-
- POT Click board™ [(MIKROE-3402)](https://www.mikroe.com/pot-click) -->
81-
82-
![Platform](images/platform.png)
83-
8462

8563
- PIC18F57Q43 Curiosity Nano [(DM182029)](https://www.microchip.com/Developmenttools/ProductDetails/DM164150)
8664
- Curiosity Nano Base for Click boards™ [(AC164162)](https://www.microchip.com/Developmenttools/ProductDetails/AC164162)
@@ -98,37 +76,40 @@ the end effector selected should be raised when the pin controlling it is low,
9876
and lowered when the pin is high. This can be modified as needed to work with
9977
a selected end effector.
10078

79+
![Platform](images/platform.png)
80+
10181
## Setup
10282

10383
Most configuration is done through the config.h file. The configurations are:
10484

10585
- `TICKS_PER_METER`: the number of steps of the stepper motor required to move the
10686
end effector one meter
107-
- `X_MAX`/`YMAX`: the maximum range, in steps, of the X and Y axes
87+
- `X_MAX`/`Y_MAX`: the maximum range, in steps, of the X and Y axes
10888
- `X_BACKWARDS`/`Y_BACKWARDS`: whether to reverse the direction of the stepper
10989
motor on this axis
11090
- `BUFFER_NUMBER_PACKETS`: the size of the command buffer. This can be left at the
11191
default 5
11292

113-
Pinout is defined with two constants, `NAME_PIN_PORT` and `NAME_PIN_POS`. To
114-
have pin Y_ENABLE on RA6, the code would be
93+
Pinout of the various pins (e.g. limit switches, the Click™ boards, the
94+
actuator, etc) is defined in config.h with two constants per pin,
95+
`NAME_PIN_PORT` and `NAME_PIN_POS`.
96+
For example, to have pin Y_ENABLE on RA6, the code would be
11597

11698
```
11799
#define Y_ENABLE_PIN_PORT RA
118100
#define Y_ENABLE_PIN_POS 6
119101
```
120102

121-
As configured, the Y axis Stepper Click board™ should go in slot 1, and the x
122-
axis should be in slot 3.
103+
As configured, the Y axis Stepper Click board™ should go in slot 1, and the X
104+
axis should be in slot 3 of the curiosity nano base board.
123105

124-
By default the limit switch pin for the y axis is RA1, and the x axis is RC7.
106+
By default the limit switch pin for the Y axis is RA1, and the X axis is RC7.
125107
The actuator is on pin RF2.
126108

127109
If an alternate method of controlling the actuator is desired, the relevant
128110
functions to modify are `Platform_RaiseActuator()` and `Platform_LowerActuator()` in
129111
platform.c which by default simply set ACTUATOR_PIN high/low.
130112

131-
<!-- Explain how to connect hardware and set up software. Depending on complexity, step-by-step instructions and/or tables and/or images can be used -->
132113

133114
## Operation
134115

@@ -145,7 +126,6 @@ Movement in the Z axis and the X/Y plane simultaneously is not supported.
145126

146127
## Summary
147128

148-
<!-- Summarize what the example has shown -->
149129

150130
The example G-Code included with the PC application creates the star shown below.
151131

0 commit comments

Comments
 (0)