mirror of
https://github.com/eddyem/STM8_samples.git
synced 2026-03-20 08:40:58 +03:00
partially worked microdrill
This commit is contained in:
@@ -10,48 +10,29 @@ again and returns back on next pulling up.
|
||||
|
||||
If drill motor was off, pressing footswitch will also turn it on.
|
||||
|
||||
/*
|
||||
* the behaviour of steps counter depends on footswitch state; timer
|
||||
* setup varies due to varistor value.
|
||||
*/
|
||||
|
||||
If you pull down the footswitch when one of the tray buttons pressed, the
|
||||
tray will move up or down.
|
||||
|
||||
2. Tray buttons
|
||||
|
||||
2.1. Left button (BTN1) used to setup the zero point of drill:
|
||||
- drill quickly moves up
|
||||
- stepper speed changes to lowest
|
||||
- while pressing down the footswitch motor moves down
|
||||
- on footswitch release motor stops at current position
|
||||
2.1. Left button (BTN1)
|
||||
- press it and rotate potentiometer to change drill speed
|
||||
- press both buttons to stop the drill
|
||||
- press footswitch when it pressed to move tray
|
||||
|
||||
/*
|
||||
* Button control: by default, EXTI interrupts serve buttons.
|
||||
* To avoid clash, EXTI interrupt handler sets the special flag
|
||||
* value to 50 (in milliseconds) and turns off EXTI IRQ.
|
||||
* In the main() body the endless cycle checks value of system
|
||||
* timer variable changed by system timer once per millisecond.
|
||||
* If the EXTI pause flag non-zero, it decrements it until zero.
|
||||
* After that EXTI turns on again and keys state occured. This
|
||||
* allows also to avoid some noice on MCU inputs.
|
||||
*/
|
||||
2.2. Right button (BTN2)
|
||||
- press it and rotate potentiometer to change stepper speed
|
||||
- press both buttons to stop the drill
|
||||
- press footswitch when it pressed to move tray
|
||||
|
||||
2.2. Right button (BTN2) used to switch between regulation
|
||||
of stepper speed or drill speed by variable resistor on tray's
|
||||
control. The default state is stepper (vertical) speed regulation.
|
||||
2.3. Simultaneous pressing of both buttons will stop drill motor
|
||||
|
||||
Drill works with algorithm of automatical moment correction:
|
||||
if drill stalled, the PWM duty reduced until current through drill's
|
||||
winding stabilize to max value. Conversely, when current through winding
|
||||
falls to very low value, PWM duty increased until normal current
|
||||
value. Varistor allows you to set these limiting values in drill speed
|
||||
mode.
|
||||
|
||||
2.3. Simultaneous pressing of both buttons will:
|
||||
- stop drill motor
|
||||
- move tray up
|
||||
- move drill down
|
||||
The stepper's speed changes depending on current in drill motor. If it is too big,
|
||||
the stepper paused until current will fall. The idle motor motion (upwards) done
|
||||
on biggest speed.
|
||||
|
||||
So, you can easily change drilling bits. After that press again BTN1+BTN2
|
||||
to return tray down & drill motor up. After this operation the uppest
|
||||
drill's position will be zero.
|
||||
To change the drill bit just press one of the tray buttons and push down the
|
||||
footswitch. The tray will go up. To move it down press tray button and footswitch
|
||||
again.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user