This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
projects:cnc:4th_axis [2025/04/14 23:54] – [Arduino software using the FastAccelStepper library] admin | projects:cnc:4th_axis [2025/04/15 00:07] (current) – [A manual controller for a spindle motor] admin | ||
---|---|---|---|
Line 4: | Line 4: | ||
Movement control is done using a potentiometer and button. With the potentiometer the speed and direction can be set, while the button allows to rotate at a specific angle, after which the motor stops. | Movement control is done using a potentiometer and button. With the potentiometer the speed and direction can be set, while the button allows to rotate at a specific angle, after which the motor stops. | ||
- | After powering up, it is required to either rotate the potentiometer to the center position (speed: 0) or press the button to rotate exactly | + | After powering up, it is required to either rotate the potentiometer to the center position (speed: 0) or press the button to rotate exactly |
Project summary: | Project summary: | ||
- | * Code runs on an arduino | + | * Code runs on an arduino |
* Connected to an [[https:// | * Connected to an [[https:// | ||
* With a 4k7 potentiometer on A0, direction and speed can be set. | * With a 4k7 potentiometer on A0, direction and speed can be set. | ||
- | * When using a button on D8 (to GND), the axis rotates certain degrees (currently hard-coded as 90 degrees) in the direction it was rotating previously and stops afterwards, regardless of the potentiometer setting. | + | * When using a button on D8 (to GND), the axis rotates certain degrees (which can be configured with a BCD switch) in the direction it was rotating previously and stops afterwards, regardless of the potentiometer setting. |
* To start motor movement, either press the switch, or move the potentiometer to the center position, after which the motor will rotate continuously when moving the potentiometer any further. | * To start motor movement, either press the switch, or move the potentiometer to the center position, after which the motor will rotate continuously when moving the potentiometer any further. | ||
- | * If the indicator led is blinking fast, it will indicate that the potentiometer need to be positioned at the center first. This is to prevent any unwanted | + | * If the indicator led is blinking fast, it will indicate that the potentiometer need to be positioned at the center first. This is to prevent any motor rotation |
+ | * As a latest addition, a 2-digit BCD-switch is connected to inputs A1-A5, | ||
The documentation of the stepper controller can be found here: [[https:// | The documentation of the stepper controller can be found here: [[https:// | ||
Line 24: | Line 25: | ||
| CN4,5 | /Off | Power off stepper drivers | | CN4,5 | /Off | Power off stepper drivers | ||
| CN4,6 | / | | CN4,6 | / | ||
- | | CN4,7 + CN4,8 | +5v | This pin is not connected | + | | CN4,7 + CN4,8 | +5v | This pin was originally |
| CN4,9 + CN4, | | CN4,9 + CN4, | ||
| CN7.5 | / | | CN7.5 | / | ||
Line 76: | Line 77: | ||
const uint8_t rot_pin = 8; // connect a button (switch to ground) to rotate (90) degrees | const uint8_t rot_pin = 8; // connect a button (switch to ground) to rotate (90) degrees | ||
- | // 2-digit bcd-wheel to set angle. Common is connected to ground | + | // 2-digit bcd-wheel to set rotation |
const uint8_t bcd10 = PIN_A1; | const uint8_t bcd10 = PIN_A1; | ||
const uint8_t bcd20 = PIN_A2; | const uint8_t bcd20 = PIN_A2; |