Flipping Spindle Signal

More
5 years 5 months ago #210703 by andypugh
Replied by andypugh on topic Flipping Spindle Signal
(Inverting PWM pin)

Sadlers wrote: Yeah, I tried that. I doesn’t do what is needed.


It should. How did you do it?

Please Log in to join the conversation.

More
5 years 5 months ago #210719 by Sadlers
Replied by Sadlers on topic Flipping Spindle Signal
I don’t know if my last reply went through so this may be a duplicate...
I used pncconf on the mesa board setup page to set the Spindle Output Inv checkbox. Tried with it checked and unchecked. Tested by using MDI in axis and using M3 and various Sxxx settings. Larger numbers = slower speed.

Please Log in to join the conversation.

More
5 years 5 months ago #210722 by Sadlers
Replied by Sadlers on topic Flipping Spindle Signal
Here is the HAL file with the Inv checkbox selected

Please Log in to join the conversation.

More
5 years 5 months ago #210735 by chris@cnc
Replied by chris@cnc on topic Flipping Spindle Signal
To invert your spindlespeed set
Code:
loadrt scale addf scale.0 servo-thread setp scale.0.gain -1 setp scale.0.offset 6000 net spindle-output => scale.0.in net spindle-speed-DAC scale.0.out => [HMOT](CARD0).7i76.0.0.spinout

Please Log in to join the conversation.

More
5 years 5 months ago #210746 by andypugh
Replied by andypugh on topic Flipping Spindle Signal

Sadlers wrote: Here is the HAL file with the Inv checkbox selected


That seems to set
Code:
setp [HMOT](CARD0).7i76.0.0.spindir-invert true
which would reverse the spindle direction.

What you need is to invert the sense of the PWM pin.

Something like
Code:
setp [HMOT](CARD0).gpio.000.invert_output true

But you need to work out which GPIO pin the PWM is on for this to work.

Please Log in to join the conversation.

More
5 years 5 months ago #210760 by Sadlers
Replied by Sadlers on topic Flipping Spindle Signal
Chris,
i entered this in my custom hal file and linuxcnc will not start. Get the attached errors report. looks like I am trying to overwrite signals that have already been setup by PNCCONF. I tried handbombing the file created by PNCCONF and couldn't make it work. any suggestions?

Please Log in to join the conversation.

More
5 years 5 months ago #210761 by Sadlers
Replied by Sadlers on topic Flipping Spindle Signal
I am controlling my spindle drive with an analog output (which generates pwm to the motor). Looking through the hal meter pins/signals I can’t locate anything that looks like an invert_output for the analog output. Do you know what this would be called?

Please Log in to join the conversation.

More
5 years 5 months ago #210764 by PCW
Replied by PCW on topic Flipping Spindle Signal
This (modification of your hal file) should be close:

Attachment not found

Please Log in to join the conversation.

More
5 years 4 months ago #210840 by Sadlers
Replied by Sadlers on topic Flipping Spindle Signal
Thank you very much for your help.

Please Log in to join the conversation.

Time to create page: 0.053 seconds
Powered by Kunena Forum