-
-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cann't use Servo motor MG90S 180degree #343
Comments
cpumap.h i do like this // Define spindle enable and spindle direction output pins. // Define flood and mist coolant enable output pins. #if defined(SPINDLE_PWM_ON_D8)
#elif defined (SPINDLE_PWM_ON_D6)
#elif defined (SPINDLE_PWM_ON_D9)
#else #ifdef SEPARATE_SPINDLE_LASER_PIN
#endif // SEPARATE_SPINDLE_LASER_PIN #ifdef USE_OUTPUT_PWM
#endif // USE_OUTPUT_PWM #endif // CPU_MAP_2560_RAMPS_BOARD |
Hi @akkarawat2000, Servos need a specific PWM frequency to operate. This is not currently supported by grblMega-5X, but it's in the TODO list... @++; |
When you will make this feature finish ? I see last question in year 2022. I hope you can do it soon or it's possible if i write source code in Arduino IDE for control Servo motor by my self and add to source code your GRBL ? Thank you |
Check #323, I already mentioned the needed changes |
Yes , but fra589 still not edit and add this feature for use easy now right ? and I see your comment this This means, following changes are needed in cpu_map.h: you test ready ? and work or not ? Thank you. |
These changes I would try (they are similar to the Arduino Uno changes for Servo use). |
You know that in fact the spindle PWM is used for servo, and not the ports from the RAMPs board? |
Hi , Today I test servo motor MG90S 180degree 5V again This means, following changes are needed in cpu_map.h: and compile with upload I connect servo motor at RampBoard 1.5 at D6 , 5V ,GND (I use power supply external 5V ) and set config Change $30=512; $31=0 like you suggest and I send Gcode but don't have notthing happend , Servo motor not rotate . How should i fixed this problem ? Thank you |
Are you sure you edit the correct files? After following this: https://github.com/fra589/grbl-Mega-5X/wiki/Compiling-grbl-Mega-5X The files are copied to the user/documents folder... |
Yes , I sure use #define GRBL_VERSION_BUILD "20220109" this version https://github.com/fra589/grbl-Mega-5X/tree/edge/grbl you test like me and working now ? What's servor you use ? and you connect D6 Channel ? |
I mean I edited GRBL_VERSION_BUILD "20220109" to e.g. 20231010 to be sure I compiled the correct files. |
I think it was D8 because of line 128 in config.h #define SPINDLE_PWM_ON_D8 |
D8 can connect Servo 5V ? I think D8 support just 12V please confirm me. I use this version lastest version #define GRBL_VERSION "1.2h" |
Then you may edit line 123 in config.h #define SPINDLE_PWM_ON_D8 and enable D6 instead in 124 |
Now I use like this right ? //---------------------------------------------------------------------- |
Yes, I would try with this changes |
you connect with arduino board direct right ? I connect to rampboard . I must change connect to connect arduino board like you ? |
Hi, Now I have problem about Servo motor MG90S 180degree 5V
I cann't use with grbl-Mega-5X I try to connect with Pin D6 on Ramp board Version 1.5 but not working and
I try to connect direct on Arduino Mega2560 on Pin D6 it's not working too.
and I try to change config.h like this
//----------------------------------------------------------------------
// Spindle, laser and other PWM output
//----------------------------------------------------------------------
// Chose the spindle pin output :
// SPINDLE_PWM_ON_D8 => 0-12v 16 bits PWM on RAMPS D8 (default)
// SPINDLE_PWM_ON_D9 => 0-12v 8 bits PWM on RAMPS D9
// SPINDLE_PWM_ON_D6 => 0-5v 8bits PWM on RAMPS Servo 2 signal (Mega 2560 D6)
// Uncomment the line which correspond to your hardware
//#define SPINDLE_PWM_ON_D8
#define SPINDLE_PWM_ON_D6
//#define SPINDLE_PWM_ON_D9
// Spindle PWM signal inversion:
// In case of particular electronics, it may be necessary to invert the values
// of the PWM signal of the spindle. For example, if the minimum spindle
// rpm is 1 and maximum is 1000, M3S250 will output 75% instead of 25% and
// M3S750 will output 25% instead of 75%. Disabled by default
//#define INVERT_SPINDLE_PWM_VALUES
// Use different spindle output pin in laser mode:
// Spindle or laser tools do not have the same hardware specifications.
// When using both spindle and laser on the same machine it will be useful
// to have spindle and laser on diffrents pins which can deliver the
// differents outputs nedded.
//----------------------------------------------------------------------
// ! IMPORTANT: When changing the SEPARATE_SPINDLE_LASER_PIN compil option,
// don't forget to issue the reset factory defaults Grbl command: $RST=*
// if you forget the $RST=* command after change, Grbl may have
// unpredictable behavior!
//----------------------------------------------------------------------
// Uncomment the next line to enable this functionality (default disabled):
//#define SEPARATE_SPINDLE_LASER_PIN
#ifdef SEPARATE_SPINDLE_LASER_PIN
// Laser PWM can be on D6 (default) or on D8 or D9.
#define LASER_PWM_ON_D6
//#define LASER_PWM_ON_D8
//#define LASER_PWM_ON_D9
#endif
// Use output PWM drived by GCode command M67(Analog Output,Synchronized)
// or GCode command M68(Analog Output, Immediate).
//----------------------------------------------------------------------
// ! IMPORTANT: When changing the USE_OUTPUT_PWM compil option,
// don't forget to issue the reset factory defaults Grbl command: $RST=*
// if you forget the $RST=* command after change, Grbl may have
// unpredictable behavior!
//----------------------------------------------------------------------
// Uncomment the next line to enable the use of M67/M68 PWM output (Disabled by default).
#define USE_OUTPUT_PWM
#ifdef USE_OUTPUT_PWM
// Optional PWM can be on D9 (default) or on D8 or D6.
// Warning ! Optional can't use the same timer than the spindle or the laser pin
// For more information about this, see the comment of the relevant section in cpu_map.h
// #define OUTPUT_PWM_ON_D9
//#define OUTPUT_PWM_ON_D8
#define OUTPUT_PWM_ON_D6
#endif
but not working if try to use with command M3 S255 and M4 255
Command response ok but Motor not rotate or working I connect with GND and 5V external too but
I try to test another way by write simple source code control Servo motor and i connect Pin D6,D9,D11 on Arduino Mega 2560 board
with 5V External or 5V internal of Arduino Mega2560 it's working fine but if use Pin D6 on Ramp Board D6 not working now.
I would like to know how to solve this problem ?
I think this issue very important . and if possible please make video how to setup
or how to use grbl-Mega-5X with Servo motor on Youtube .
I think it's easy to people understand too.
Because Beginner like me not understand all from your document .
your document some information not have detail too much , not explain how to use step by step, it's hard for me understand.
2 . on D10 and D9 working fine now .
i don't know if use D10 or D9 use with servo motor 5V or not ?
May be you have trick.
I hope you understand me and help me this problem too.
Thank you very much.
The text was updated successfully, but these errors were encountered: