Hi all in the process of building a CNC powered by a Arduino Mega 2560 and Ramps 1.4. Almost everything is working great but having some issues with the PWM voltage output on Pin 6 to control the VFD. I’ve spent days working through all the issues reluctant to post for help but this one has stumped me.
The issue is the voltage directly from Pin 6 when issuing M3 S24000 (My Max RPM) only produces 4.89V.
This then goes through a PWM module, as I wanted something tidier than a home made lowpass and also wanted to boost the level from 5v to 10v (http://www.chinalctech.com/index.php?m=modproduct&a=view&pid=1122) and the max voltage I can output is 4.34V with the pot wound all the way up and with a 12v VCC input to the module.
I was wondering if it was a frequency issue so i’ve tried 255 and 1024 in place of the Max PWM value.
I’m very much on a steep learning curve but any help would be very much appreciated .
Thanks in advance!
I’ve amended the code as at the bottom of the post in cpu_map.h.
// Advanced Configuration Below You should not need to touch these variables
// Set Timer up to use TIMER4C which is attached to Digital Pin 6 – Ramps Servo 2
#define SPINDLEPWMMAX_VALUE 1024.0 // Since it’s a 8bit timer
#ifndef SPINDLEPWMMIN_VALUE
#define SPINDLEPWMMIN_VALUE 1 // Must be greater than zero.
#endif
#define SPINDLEPWMOFF_VALUE 0
#define SPINDLEPWMRANGE (SPINDLEPWMMAXVALUE-SPINDLEPWMMINVALUE)
#define SPINDLETCCRAREGISTER TCCR4A
#define SPINDLETCCRBREGISTER TCCR4B
#define SPINDLEOCRREGISTER OCR4A
#define SPINDLECOMBBIT COM4A1
#define SPINDLETCCRAINIT_MASK (1<
#define SPINDLEOCRATOPVALUE 0x0400 // PWM counter reset value. Should be the same as PWMMAX_VALUE in hex.
// Define spindle output pins.
#define SPINDLEPWMDDR DDRH
#define SPINDLEPWMPORT PORTH
#define SPINDLEPWMBIT 3 // MEGA2560 Digital Pin 6
#endif
#1 – sanalejo171 于 2019-09-13
Hello, I’ve been 2 days, testing 1 by 1 ALL the ramp pines, I can turn on and off the SPINDLER (DRILL) but none has pwm control, because they only mark 0 or 5v …….. IT ALSO WORKS ME PROBE or analog 15 or none, and probe one by one ……. someone found the solution? Or will I have to go back to Arduino one?