omuzychko / StepperHub

3-axis UART Stepper Hub for 20$ (STM32 Nucleo 64 & Arduino CNC Shield)
73 stars 26 forks source link

Not working on STM32F407VGTx #1

Open Samed-Hamma opened 7 years ago

Samed-Hamma commented 7 years ago

Hi Omuzychko ! Thank you for your contribution ! So i've been trying to make my motors work on an STM32F4 Discovery Board with 2 Bipolar Steppers and DRV8825 drivers, didn't work for me ! Motors are just stopped. First of all I put a #define TEST I tried modifying DEFAULT_MAX_SPS and ACCSPS_TO_MINSPS_RATIO but didn't work for me. I Couldn't run it in serial because there's no definition for the function void ExecuteRequest(stepper_request * r); I have no tools to check if my TIM pins are actually outputing something ! (Sorry for that).

omuzychko commented 7 years ago

Hi Sam,

Any other board could fail unless you make sure that TIM pheriperals are exactly the same type I've used on NUCLEO board (compare datasheets of both controllers regarding timer pheriperals specifications, siz es of counter and prescaller registers). Do you have a holding torque on the motors when they stopped? If not - driver EN pin is not activated.

If you don't have an osciliscope to check the TIM pin output - there are two DIY hacks I've used before I was able to afford the scope:

On Oct 6, 2017 11:31 PM, "Sam" notifications@github.com wrote:

Hi Omuzychko ! Thank you for your contribution ! So i've been trying to make my motors work on an STM32F4 Discovery Board with 2 Bipolar Steppers and DRV8825 drivers, didn't work for me ! Motors are just stopped. First of all I put a #define TEST I tried modifying DEFAULT_MAX_SPS and ACCSPS_TO_MINSPS_RATIO but didn't work for me. I Couldn't run it in serial because there's no definition for the function void ExecuteRequest(stepper_request * r); I have no tools to check if my TIM pins are actually outputing something ! (Sorry for that).

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/omuzychko/StepperHub/issues/1, or mute the thread https://github.com/notifications/unsubscribe-auth/AK4lBNf3DoVg1PTtP-jKR4OWgYz3MvVaks5spvCpgaJpZM4PxN4Q .

Samed-Hamma commented 7 years ago

Hi Alex, I haven't checked yet using your brilliant methods, I put 2 steppers, one is not connected to En pin, the other is connected, both apply holding torque, I started another project on CubeMx with the right configuration for my card, and copied your code, I don't think it's a speed problem because I 'm using 1/32 microstepping (M0, M1 and M2 are HIGH on my DRV8825)

Samed-Hamma commented 7 years ago

Hi Alex, finally i got it to work, the issue was with Stepper_SaveConfig() and Stepper_LoadConfig() (even with changing values to the data section of the F407 which is rather FLASH_SECTOR_6 on adress 0x08040000). I also got my best frequency with a half step resolution. I couldn't send or receive commands yet via serial because serial.h didn't work for me either to tune the controls, but i'm happy now and i'll work on it more tomorrow. Thanks for your job ! That's beautiful (and pretty complex).

omuzychko commented 7 years ago

Glad you made it. Additionally to serial RX/TX pins hardware config you also have to make sure your DMA controller configured properly as well.