Skip to content
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

PMW trouble. #14

Open
J-Dunn opened this issue Apr 19, 2019 · 2 comments
Open

PMW trouble. #14

J-Dunn opened this issue Apr 19, 2019 · 2 comments

Comments

@J-Dunn
Copy link

J-Dunn commented Apr 19, 2019

Hi,

I want set up an opto isolated 10V control signal for my chinese VFD for the spindle. Having set up the opto I went to test and found I don't have a PWM pulse train on PB0 CN7/34 ( Arduino A3 ).

Am I correct in thinking I just need to $X then M3 S500 to get a pulse train on that pin?

thanks. I can't see what I'm missing here.

#define PWM_SPINDLE			// standard 0-100% pwm, if not defined RC servo pwm: 1.0-1.5ms on, 20ms period
#define PWM_MAX_VALUE 0xfff	// resulting PWM freq will 100MHz/PWM_MAX_VALUE, 0xffff = ~1.5KHz, 0xff = ~390KHz
#define VARIABLE_SPINDLE // Default enabled.

#ifdef PWM_SPINDLE
#ifdef STANDARD_GRBL
		  TIM_SetCompare1(TIM3,current_pwm);

If I'm understanding these library routines, this does not seem consistent with the AFconfig which sets PB0 AF which corresponds to TIM3_CH3.

GPIO_PinAFConfig(GPIOB, GPIO_PinSource0, GPIO_AF_TIM3);

@langwadt
Copy link
Owner

the STANDARD_GRBL define puts the spindle pwm on PA6

@J-Dunn
Copy link
Author

J-Dunn commented Apr 20, 2019

Thanks for the reply. That was the wrong code snippet actually , not sure what happened. I'm not using STANDARD_GRBL . I'm using your original wiring on PB0 as I detailed. Anyway, I've got it working now and have the PWM driving the 0-10V spindle speed signal via an opto. Seems fine.
I have 3 limits switches and z-probe similarly isolated.

I have a spare opto channel free which I'm trying to find a use for to pre-empt some future need before I box it all up and put it back on the machine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants