Skip to content
Snippets Groups Projects
Commit cf1be55c authored by Jake Read's avatar Jake Read
Browse files

minors

parent 8043a4e1
Branches
Tags
No related merge requests found
......@@ -8,6 +8,14 @@ Does networked control of stepper motors w/ up to 2.8A current. Plans for closed
See [circuit chatter](/circuit) and [programming chatter](/embedded).
## Commands
Position:
key: 129, units: int32_t, steps
Speed:
key: 130, units: uint32_t, steps/s
# IC Spec'ing
### Step Driver
......
......@@ -137,7 +137,7 @@ State=1
Number=0
[Desktop]
Screen="3840 1080"
Screen="6000 2160"
Window="Win_1"
Window="Win_2"
Window="Win_3"
File added
No preview for this file type
......@@ -249,7 +249,7 @@ int main(void)
stepper = stepper_new(&step_pin, &dir_pin, 360.0, 64);
stepper_reset(&stepper);
stepper_targetspeed_steps(&stepper, 500); // so slow
stepper_targetspeed_steps(&stepper, 2000);
uint8_t lpcnt = 0;
uint8_t stpcnt = 0;
......
......@@ -33,15 +33,15 @@ void tmc26_init(tmc26_t *tmc){
tmc26_disable(tmc); // turnt off
// address, slope control hi and lo to minimum, short to ground protection on, short to gnd timer 3.2us,
// enable step/dir, sense resistor full scale current voltage is 0.305mv, readback stallguard2 data, reserved
uint32_t drvconf = 0b11100000000000010000;
// enable step/dir, sense resistor full scale current voltage is 0.16mv, readback stallguard2 data, reserved
uint32_t drvconf = 0b11100000000000110000;
tmc26_write(tmc, drvconf);
// address, sgfilt off, threshold value, current scaling (5-bit value appended)
uint32_t sgthresh_mask = 0b00000111111100000000;
int32_t sgthres_val = 60;
uint32_t cscale_mask = 0b00000000000000011111;
uint32_t cscale_val = 9;
uint32_t cscale_val = 20;
uint32_t sgcsconf = 0b11010000000000000000 | ((sgthres_val << 8) & sgthresh_mask) | (cscale_val & cscale_mask);
tmc26_write(tmc, sgcsconf);
......@@ -50,11 +50,17 @@ void tmc26_init(tmc26_t *tmc){
tmc26_write(tmc, smarten);
// times, delays, cycle mode
uint32_t chopconf = 0b10010010100000010111;
uint32_t chopconf = 0b10011000001000010011;
tmc26_write(tmc, chopconf);
// 9th bit is intpol, 8th is dedge, last 4 are microstepping
uint32_t drvctrl = 0b00000000000100000010;
// 0101 8
// 0100 16
// 0011 32
// 0010 64
// 0001 128
// 0000 256
uint32_t drvctrl = 0b00000000001100000100;
tmc26_write(tmc, drvctrl);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment