Can't get PWM gen to work
- Todd Zuercher
- Offline
- Platinum Member
Less
More
- Posts: 5007
- Thank you received: 1441
20 Feb 2020 16:39 #158027
by Todd Zuercher
Replied by Todd Zuercher on topic Can't get PWM gen to work
The only place that the order of lines in the hal file really matters is the order that things are added to the threads with the addf lines (that and that the component is loaded with a loadrt before the addf.)
Please Log in or Create an account to join the conversation.
20 Feb 2020 17:20 #158033
by oddwick
i did not see that in the man page, that would have been a great clue
like how every other idiot with an IQ of 3 sets their spindle speed -- click a little button and assume that when you hear your relay engage that your spindle is on. that idiot with the IQ of 3 is me and i am being generous because it was only 2.1 until i figured out what i was doing wrong. not quite a point bonus, but i will live with my 0.9....
pwm was working fine. my brain, not so much. simple math... what's 25% of 1? 0.25. duh. when your rpm is 1 then all math revolves around that. once i figured out that i wasn't increasing my spindle speed, everything fell into place. i wasnt using mdi because i wasn't homing my machine, and since i have never really used the spindle speed buttons except as on/off, i just assumed spindle would start at full speed. spindle on = spindle run like hell. (yeah, im every safety coordinator's worst nightmare, i live by the phrase "dont try this at home" which coincidently is where my shop is located... hmmm, beginning to see a pattern here). thankfully there are wiser and more safety conscious individuals out there that protect me from high speed spinning blades. darwin on the other hand is a bit miffed.
as for the negative numbers, my spindle is locked in CW only mode, and is turned on by a relay. my monitor is a touch screen mounted on the right side of the enclosure and im right handed, and both CW and CCW turn on my spindle, so therefore the closest button (BTW what i call "efficiency and conservation of motion" my wife calls sheer laziness) works right? so this whole time i have been running my spindle backwards at 1 rpm. story of my life. now the infinitesimally small negative numbers make perfect sense.
so thank you for pointing out my idiocy so diplomatically!
Replied by oddwick on topic Can't get PWM gen to work
You have set PWM mode 0. The pwmgen manual (man pwmgen) says that if you set negative PWM
values you will get a 0 PWM output, so that part is behaving as expected
i did not see that in the man page, that would have been a great clue
the question now is how are you setting the spindle speed?
like how every other idiot with an IQ of 3 sets their spindle speed -- click a little button and assume that when you hear your relay engage that your spindle is on. that idiot with the IQ of 3 is me and i am being generous because it was only 2.1 until i figured out what i was doing wrong. not quite a point bonus, but i will live with my 0.9....
pwm was working fine. my brain, not so much. simple math... what's 25% of 1? 0.25. duh. when your rpm is 1 then all math revolves around that. once i figured out that i wasn't increasing my spindle speed, everything fell into place. i wasnt using mdi because i wasn't homing my machine, and since i have never really used the spindle speed buttons except as on/off, i just assumed spindle would start at full speed. spindle on = spindle run like hell. (yeah, im every safety coordinator's worst nightmare, i live by the phrase "dont try this at home" which coincidently is where my shop is located... hmmm, beginning to see a pattern here). thankfully there are wiser and more safety conscious individuals out there that protect me from high speed spinning blades. darwin on the other hand is a bit miffed.
as for the negative numbers, my spindle is locked in CW only mode, and is turned on by a relay. my monitor is a touch screen mounted on the right side of the enclosure and im right handed, and both CW and CCW turn on my spindle, so therefore the closest button (BTW what i call "efficiency and conservation of motion" my wife calls sheer laziness) works right? so this whole time i have been running my spindle backwards at 1 rpm. story of my life. now the infinitesimally small negative numbers make perfect sense.
so thank you for pointing out my idiocy so diplomatically!
Please Log in or Create an account to join the conversation.
20 Feb 2020 17:26 #158034
by oddwick
i figured as much. no component, no function, and if one depended on another, lcnc would throw a fit and not start, right?
my hal looks a little weird because i am a big fan of code grouping and i hate having to bounce around untangling a spiderweb of connections. if it relates to XX, then everything dealing with XX is right there. easier to debug at least for me
Replied by oddwick on topic Can't get PWM gen to work
The only place that the order of lines in the hal file really matters is the order that things are added to the threads with the addf lines (that and that the component is loaded with a loadrt before the addf.)
i figured as much. no component, no function, and if one depended on another, lcnc would throw a fit and not start, right?
my hal looks a little weird because i am a big fan of code grouping and i hate having to bounce around untangling a spiderweb of connections. if it relates to XX, then everything dealing with XX is right there. easier to debug at least for me
Please Log in or Create an account to join the conversation.
Time to create page: 0.065 seconds