Skip to content

Laser and spindle on MKS Sbase V1.3 #45

@anarion999

Description

@anarion999

Hey there,
Since two days I am trying to get a firmware ready based on grblHAL for the MKS Sbase v1.3 which is capable of using two different PWM pins for controlling laser and spindle. I think I am missing something or just being too stupid to put the pieces together.
I think I found the relevant parts in the respective *.h files but I was not able so far to get the things working.
From the mks_sbase_map.h the relevant part is to my mind the following:

_// Define driver spindle pins

#if DRIVER_SPINDLE_PWM_ENABLE
#ifdef SPINDLE_PWM_PIN_2_4
#define SPINDLE_PWM_CHANNEL PWM1_CH5 // MOSFET3 (P2.4)
#else
#define SPINDLE_PWM_CHANNEL PWM1_CH6 // BED MOSFET (P2.5)
#endif
#define SPINDLE_PWM_USE_PRIMARY_PIN false
#define SPINDLE_PWM_USE_SECONDARY_PIN true
#else
#define AUXOUTPUT0_PN 2
#define AUXOUTPUT0_PORT port(AUXOUTPUT0_PN)
#define AUXOUTPUT0_PIN 4
#endif_

I also found in the config.h the part for the definition of the number of spindles/PWM devices:

/*! \def N_SPINDLE
\brief Defines number of spindles supported - minimum 1, maximum 32.
*/
#if !defined N_SPINDLE || defined DOXYGEN
#define N_SPINDLE 2
#endif

Here, I suppose that I should increase the number to 2...

And then finally the part of my_machine.h:

#define SPINDLE0_ENABLE SPINDLE_PWM0
#define SPINDLE1_ENABLE SPINDLE_PWM1
//#define SPINDLE2_ENABLE SPINDLE_PWM0_CLONE
//#define SPINDLE3_ENABLE SPINDLE_NONE
// **********************

But now I don't understand how to tell the code that I want to use two different PWM pins for the devices and also were to remap the respective pins accordingly. Also the PWM-Channel thing form the mks_sbase_map.h is unclear for me. And the final question for me is how two switch between the two PWM devices in a respective controlling software?

I am really confused at this point and your help is more than aprreciated.

Thanks you and best regards

Florian

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions