diff --git a/MMPP_control/main.c b/MMPP_control/main.c index 221c960..4e54b15 100644 --- a/MMPP_control/main.c +++ b/MMPP_control/main.c @@ -69,28 +69,28 @@ int movemotor(int mcu, int motnum, int steps, const char *name){ WARNX(_("Can't get current %s position"), name); return 0; } - if(curpos < 0){ // need to init - // check if we are on zero endswitch - int esw = mot_getesw(mcu, motnum); - if(esw == 0){ // move a little - sprintf(buf, "%dM%dM100", mcu, motnum); - tty_sendcmd(buf); - tty_wait(); - } - sprintf(buf, "%dM%dM-40000", mcu, motnum); - if(tty_sendcmd(buf)){ - WARNX(_("Can't initialize %s"), name); - return 0; - } - tty_wait(); // wait for initialisation ends - handshake(); - curpos = mot_getpos(mcu, motnum); - if(curpos){ - WARNX(_("Can't return to zero")); - return 0; - } - } if(G->absmove){ + if(curpos < 0){ // need to init + // check if we are on zero endswitch + int esw = mot_getesw(mcu, motnum); + if(esw == 0){ // move a little + sprintf(buf, "%dM%dM100", mcu, motnum); + tty_sendcmd(buf); + tty_wait(); + } + sprintf(buf, "%dM%dM-40000", mcu, motnum); + if(tty_sendcmd(buf)){ + WARNX(_("Can't initialize %s"), name); + return 0; + } + tty_wait(); // wait for initialisation ends + handshake(); + curpos = mot_getpos(mcu, motnum); + if(curpos){ + WARNX(_("Can't return to zero")); + return 0; + } + } if(steps < 0){ if(motnum == 1){ steps += (mcu == 1) ? 36000 : 28800; // convert rotator angle to positive diff --git a/electronics/steppers.kicad_pcb b/electronics/steppers.kicad_pcb index 236ac76..01baa71 100644 --- a/electronics/steppers.kicad_pcb +++ b/electronics/steppers.kicad_pcb @@ -37,7 +37,7 @@ ) (setup - (last_trace_width 0.5) + (last_trace_width 0.25) (user_trace_width 0.25) (user_trace_width 0.5) (user_trace_width 1) @@ -69,9 +69,9 @@ (grid_origin 38 30) (visible_elements FFFFFF7F) (pcbplotparams - (layerselection 0x00030_80000001) + (layerselection 0x000f0_80000001) (usegerberextensions false) - (excludeedgelayer true) + (excludeedgelayer false) (linewidth 0.100000) (plotframeref false) (viasonmask false) @@ -214,14 +214,14 @@ (add_net /M2_B*) ) - (module Mounting_Holes.pretty:MountingHole_3.2mm_M3 (layer F.Cu) (tedit 5A6853F3) (tstamp 5A6E10FA) + (module Mounting_Holes.pretty:MountingHole_3.2mm_M3 (layer F.Cu) (tedit 5A6EB106) (tstamp 5A6E10FA) (at 78.063 78.3725) (descr "Mounting Hole 3.2mm, no annular, M3") (tags "mounting hole 3.2mm no annular m3") (fp_text reference REF** (at 0 -4.2) (layer F.SilkS) hide (effects (font (size 1 1) (thickness 0.15))) ) - (fp_text value MountingHole_3.2mm_M3 (at 0 4.2) (layer F.Fab) + (fp_text value MountingHole_3.2mm_M3 (at 0 4.2) (layer F.Fab) hide (effects (font (size 1 1) (thickness 0.15))) ) (fp_circle (center 0 0) (end 3.2 0) (layer Cmts.User) (width 0.15)) @@ -229,14 +229,14 @@ (pad 1 np_thru_hole circle (at 0 0) (size 3.2 3.2) (drill 3.2) (layers *.Cu *.Mask)) ) - (module Mounting_Holes.pretty:MountingHole_3.2mm_M3 (layer F.Cu) (tedit 5A6853EC) (tstamp 5A6E10F3) + (module Mounting_Holes.pretty:MountingHole_3.2mm_M3 (layer F.Cu) (tedit 5A6EB118) (tstamp 5A6E10F3) (at 78.063 33.8725) (descr "Mounting Hole 3.2mm, no annular, M3") (tags "mounting hole 3.2mm no annular m3") (fp_text reference REF** (at 0 -4.2) (layer F.SilkS) hide (effects (font (size 1 1) (thickness 0.15))) ) - (fp_text value MountingHole_3.2mm_M3 (at 0 4.2) (layer F.Fab) + (fp_text value MountingHole_3.2mm_M3 (at 0 4.2) (layer F.Fab) hide (effects (font (size 1 1) (thickness 0.15))) ) (fp_circle (center 0 0) (end 3.2 0) (layer Cmts.User) (width 0.15)) @@ -244,14 +244,14 @@ (pad 1 np_thru_hole circle (at 0 0) (size 3.2 3.2) (drill 3.2) (layers *.Cu *.Mask)) ) - (module Mounting_Holes.pretty:MountingHole_3.2mm_M3 (layer F.Cu) (tedit 5A685400) (tstamp 5A6E106E) + (module Mounting_Holes.pretty:MountingHole_3.2mm_M3 (layer F.Cu) (tedit 5A6EB110) (tstamp 5A6E106E) (at 42 78.5) (descr "Mounting Hole 3.2mm, no annular, M3") (tags "mounting hole 3.2mm no annular m3") (fp_text reference REF** (at 0 -4.2) (layer F.SilkS) hide (effects (font (size 1 1) (thickness 0.15))) ) - (fp_text value MountingHole_3.2mm_M3 (at 0 4.2) (layer F.Fab) + (fp_text value MountingHole_3.2mm_M3 (at 0 4.2) (layer F.Fab) hide (effects (font (size 1 1) (thickness 0.15))) ) (fp_circle (center 0 0) (end 3.2 0) (layer Cmts.User) (width 0.15)) @@ -2591,14 +2591,14 @@ ) ) - (module Mounting_Holes.pretty:MountingHole_3.2mm_M3 (layer F.Cu) (tedit 5A6853E2) (tstamp 5A6E105D) + (module Mounting_Holes.pretty:MountingHole_3.2mm_M3 (layer F.Cu) (tedit 5A6EB11E) (tstamp 5A6E105D) (at 42 34) (descr "Mounting Hole 3.2mm, no annular, M3") (tags "mounting hole 3.2mm no annular m3") (fp_text reference REF** (at 0 -4.2) (layer F.SilkS) hide (effects (font (size 1 1) (thickness 0.15))) ) - (fp_text value MountingHole_3.2mm_M3 (at 0 4.2) (layer F.Fab) + (fp_text value MountingHole_3.2mm_M3 (at 0 4.2) (layer F.Fab) hide (effects (font (size 1 1) (thickness 0.15))) ) (fp_circle (center 0 0) (end 3.2 0) (layer Cmts.User) (width 0.15)) diff --git a/electronics/steppers.sch b/electronics/steppers.sch index 89490a4..00e64f0 100644 --- a/electronics/steppers.sch +++ b/electronics/steppers.sch @@ -1008,7 +1008,7 @@ PUPD Text Notes 2600 2400 2 60 ~ 0 PUPD Text Notes 3000 7450 0 79 ~ 0 -Pins 7,8,9 and 7,8,10 of steppers' connectors\nare for Hall switches and switch buttons.\nWithout signal voltage is 3.3V through 47k pullup,\nwith Hall signal it is near 0V, \nwhen there's no Hall you can connect the input\nby button with 47k pulldown and voltage will be\nnear 1.7V. +Pins 1,5,7 and 9 of steppers' connectors\nare for Hall switches and switch buttons.\nWithout signal voltage is 3.3V through 47k pullup,\nwith Hall signal it is near 0V, \nwhen there's no Hall you can connect the input\nby button with 47k pulldown and voltage will be\nnear 1.7V. $Comp L R R23 U 1 1 5A21099C