dresco / STM32H7xx

grblHAL driver for STM32H7xx processors
Other
15 stars 13 forks source link

Octopus max 5160ez no motors #29

Open T4KUUY4 opened 5 months ago

T4KUUY4 commented 5 months ago

Hi and sorry for creating another issue. I just cant get my head around why the motors are not working. Ive got 5160 ez on my octopus max. In the First 4 Slots.

Ive compiled on the webbuilder with ganged Y motors and EZ5160s with 0.075 sense resisor. Ive reset my grblhal settings but i still get no motor movement. I tried inverting the enable pins but no change.

stepper drivers do get warm so they are getting power.

Also, even though i havent fully confirmed yet, enabling mpg test 2 in the Firmware, makes it Crash a lot. Mostly "controller is halted" or error:20.

Any ideas?

Thanks in advance Tom

T4KUUY4 commented 5 months ago

My MPG wasnt connected yet as the steppers didnt even move. That might be why the firmware crashes with MPG enabled. but im not 100% sure

T4KUUY4 commented 5 months ago

M122 returns "could not communicate with stepper driver" One more Thing, i disabled the MPG, compiled again and the firmware doesnt crash anymore. Drivers still not recognized

T4KUUY4 commented 5 months ago

Update. They are detected when running Klipper. so the drivers, are fine

T4KUUY4 commented 5 months ago

I feel a little... stupid ngl. one stepstick got considerably hotter than the rest. so i removed that one, and the other 3 showed up ...

T4KUUY4 commented 5 months ago

MPG works aswell when its connected.

dresco commented 5 months ago

Glad you got it working in the end.

I don't know if there is anything different with the driver configuration vs Klipper/Marlin? I do know that the stepper max current (from $14x parameters) gets set before enabling the drivers, as that was something I checked previously.

I've got an SKR3 here with both 2209 and 5160 EZ drivers, and haven't experienced any issues with them. That said, it's only been used for development, running Nema17 motors with no load on them.

T4KUUY4 commented 5 months ago

Glad you got it working in the end.

I don't know if there is anything different with the driver configuration vs Klipper/Marlin? I do know that the stepper max current (from $14x parameters) gets set before enabling the drivers, as that was something I checked previously.

I've got an SKR3 here with both 2209 and 5160 EZ drivers, and haven't experienced any issues with them. That said, it's only been used for development, running Nema17 motors with no load on them.

Yea. sorry for all the notifications :D Turns out 2 were actually dead and not only one. grbl wont initialize the other ones if a dead one is connected.

T4KUUY4 commented 5 months ago

Sorry for re-opening but i think i did find an issue with how the drivers are controlled upon boot. It seems like its initializing grbl too fast as i have to uncheck and then re-check the ganged Y axis stepper driver in the settings for all the motors to move. otherwise i get a "cant communicate" error.

it seems to be exactly like this: https://github.com/grblHAL/core/issues/381#issuecomment-1859032515

dresco commented 5 months ago

Hi @terjeio - the above issue has come up for a few people now, needing a delay before the Trinamic drivers are initialised or else getting a communication error. I've not been able to replicate, but perhaps dependent on rise time for the modules power supply?

Anyway, do you have an opinion on adding a (configurable?) startup delay directly to the Trinamic drivers? I could add a delay to the H7 code before calling trinamic_init(), but I'd expect it might crop up in other drivers also?

dresco commented 5 months ago

@T4KUUY4

Just to check something - I've been assuming this issue only occurs on power-up, is that the case? i.e. if the board is already powered, and is restarted with the reset button then it's okay?

T4KUUY4 commented 5 months ago

@dresco correct. Only on power up

terjeio commented 5 months ago

Start with increasing the delay here - to 500 (ms) initially?. @T4KUUY4 are you compiling locally or using the Web Builder? If using the Web Builder I can modify the code so that you can rebuild and test.

T4KUUY4 commented 5 months ago

Start with increasing the delay here - to 500 (ms) initially?. @T4KUUY4 are you compiling locally or using the Web Builder? If using the Web Builder I can modify the code so that you can rebuild and test.

Hi, Im using the webbuilder right now. Thanks a bunch

terjeio commented 5 months ago

ok, try now - I have increased the delay to 1000.

T4KUUY4 commented 4 months ago

@terjeio @dresco That seems to do the trick. But the PROBE input isnt working on the Octo max ez. I compiled via webbuilder and locally and it just says "NOPROBE" in NEWOPT. Any ideas?

dresco commented 4 months ago

@terjeio @dresco That seems to do the trick. But the PROBE input isnt working on the Octo max ez. I compiled via webbuilder and locally and it just says "NOPROBE" in NEWOPT. Any ideas?

No, but was also mentioned in another issue here. Will check what's going on, might take me a day or two though..

T4KUUY4 commented 4 months ago

@dresco Thanks. Let me know if you need any troubleshooting help. To rule the port out (even though it was highly unlikely as it didnt even show up in $pins), i tried using PC15 instead. No change, so my guess is that the probe=enabled gets lost somewhere

dresco commented 4 months ago

@T4KUUY4

Ah, I hadn't moved the probe definitions over to the new AUX claiming code.. I think this should do it, are you able to test with the following changes to your map file?

diff --git a/Inc/btt_octopus_max_map.h b/Inc/btt_octopus_max_map.h
index 6da995b..5bdc1c4 100644
--- a/Inc/btt_octopus_max_map.h
+++ b/Inc/btt_octopus_max_map.h
@@ -157,16 +157,20 @@
 #define AUXINPUT0_PORT              GPIOF
 #define AUXINPUT0_PIN               12      // PWR-DET

+#define AUXINPUT1_PORT              GPIOB
+#define AUXINPUT1_PIN               15      // Z probe
+
 #if SAFETY_DOOR_ENABLE
 #define SAFETY_DOOR_PORT            AUXINPUT0_PORT
 #define SAFETY_DOOR_PIN             AUXINPUT0_PIN
 #endif

-#define CONTROL_INMODE              GPIO_SINGLE
+#if PROBE_ENABLE
+#define PROBE_PORT                  AUXINPUT1_PORT
+#define PROBE_PIN                   AUXINPUT1_PIN
+#endif

-// Define probe switch input pin.
-#define PROBE_PORT                  GPIOB
-#define PROBE_PIN                   15      // Z probe
+#define CONTROL_INMODE              GPIO_SINGLE

 #if TRINAMIC_UART_ENABLE
T4KUUY4 commented 4 months ago

@dresco Sure, give me a few minutes and ill report back. Im at the CNC atm anywasy

T4KUUY4 commented 4 months ago

@dresco seems like it doesnt like that at all. `:0:0: note: this is the location of the previous definition In file included from Src\driver_spindles.c:30:0: ./grbl/pin_bits_masks.h:27:2: error: #error "Probe input is not supported in this configuration!"

error "Probe input is not supported in this configuration!"`

T4KUUY4 commented 4 months ago

im pulling a new git down now. just to verify

dresco commented 4 months ago

Hmm, that implies PROBE_ENABLE is defined, but PROBE_PIN is not. Does that section of your map file look like this?

image

T4KUUY4 commented 4 months ago

i might have misinterpreted your code sample above. i thought that id need to remove the previous probe_pin and port (because of the - in front.) Compiling with the new code now.

dresco commented 4 months ago

i might have misinterpreted your code sample above. i thought that id need to remove the previous probe_pin and port (because of the - in front.) Compiling with the new code now.

Yeah sorry, that diff wasn't perhaps the easiest to parse visually :) Should just need to add the new AUXINPUT1_PORT/PIN lines, and change the PROBE_PORT/PIN lines..

T4KUUY4 commented 4 months ago

yep. compiles now. let me run down again to flash.

T4KUUY4 commented 4 months ago

@dresco that did the trick. Works like a charm now

dresco commented 4 months ago

@T4KUUY4 Cool, thanks for the confirmation. Will get the changes pushed up to GitHub later..

T4KUUY4 commented 4 months ago

@dresco Awesome Thanks. On another note.. Have you ever had an issue with motors not moving if you enable the "do not turn off motor in idle" thing? I dont know the exact $ setting atm but i can look later.

Basically, if you set the motors to not disable in idle (so they cant move), you cant jog/move anymore. Z Homing after a reset seems to work, but nothing will move after that. I dont know if thats a bug on my end or a general thing.

Also, is the probe input pulled up? i seem to notice that it sometimes flickers as if it was floating for a second. Nothing gets interrupted though so it might be a visual bug.

dresco commented 4 months ago

Have you ever had an issue with motors not moving if you enable the "do not turn off motor in idle" thing? I dont know the exact $ setting atm but i can look later.

Not that I'm aware of, my CNC router has always been using $1=255 to keep the steppers enabled. I don't have Trinamic drivers on any real machines, but I can dig out my SKR3 with the EZ5160 modules and double check on the bench..

Also, is the probe input pulled up? i seem to notice that it sometimes flickers as if it was floating for a second. Nothing gets interrupted though so it might be a visual bug.

Seems to be, the Octopus MAX schematic shows a 10K pullup to 3.3V

T4KUUY4 commented 4 months ago

Not that I'm aware of, my CNC router has always been using $1=255 to keep the steppers enabled. I don't have Trinamic drivers on any real machines, but I can dig out my SKR3 with the EZ5160 modules and double check on the bench..

That would be awesome. let me know if you need anything tested. Thanks

Seems to be, the Octopus MAX schematic shows a 10K pullup to 3.3V

Good to know. Must be a visual bug then.

dresco commented 4 months ago

Afraid I'm not able to replicate here.

My test setup is the standard SKR3 build from platformio.ini (5160, 3 axis, bootloader), with 3x steppers on X/Y/Z outputs.

Reset all parameters, then $1=255, $5=7, $14=70, & $22=3. Can move all motors before and after Z homing as expected. (I faked Z homing just shorting the input to ground during the process).

T4KUUY4 commented 4 months ago

Thanks for testing it. Then its either a buggy configured firmware on my end. Or because im using a ganged Y axis. Im building a second CNC atm with only 1 y axis motor so ill give it a shot there aswell. Same controller and stuff.

terjeio commented 4 months ago

What is your $4 setting (Invert stepper enable pins)? FYI $1 (Step idle delay) can be set <> 255 to disable steppers when idle, except for axes configured with $37.

dresco commented 4 months ago

What is your $4 setting (Invert stepper enable pins)?

$4=7

FYI $1 (Step idle delay) can be set <> 255 to disable steppers when idle, except for axes configured with $37.

Interesting, thanks. Hadn't noticed that $37 setting before..

T4KUUY4 commented 3 months ago

@dresco @terjeio So ive did some more testing today on a different CNC project and i found that having stealthchop turned on by default in the motor_plugin tmc5160 section, made a drastic difference in terms of performance.

I have some stepperonline 23he45-4204s motors here that i never managed to get over a certain speed (1300mm/min in my case). Even with nothing attached. (32 microsteps, 2A of current). It for some reason worked with some load on the X motor, but upon taking it out, it didnt again. which was very weird. I initially thought of having a dead motor so i just swapped in a replacment. issue was still present.

Thats when i noticed that stealthchop, is hardcoded on. Why is that a thing? Can that be toggled in IoSender for example? Or a dropdown selection in the webbuilder?