× Forum Header

using pwm signal via stepconf output

More
14 May 2013 13:39 #34045 by ericg
Hi,

I'm trying to control the on/off and speed of my router by using the spindle on pin (output pin 8) and the spindle pwm pin (pin9), these signals are sent to a Super-PID controller that I installed, and which manually works fine.

The on/off control works OK but I cannot get any speed variation and I do not see a pulse train (using a CRO) from pin 9.

I checked .hal and it shows...
setp parport.0.pin-08-out-invert 1
net spindle-on => parport.0.pin-08-out
setp parport.0.pin-09-out-invert 1
net spindle-pwm => parport.0.pin-09-out

should I be setting something else up in .hal? i.e. should I be using pwmgen for example? (not that I understand what pwmgen is or does or how it differs from the stepconf setup)

any help appreciated

Eric :unsure:

Please Log in or Create an account to join the conversation.

More
14 May 2013 18:54 #34066 by andypugh

net spindle-pwm => parport.0.pin-09-out
should I be setting something else up in .hal? i.e. should I be using pwmgen for example?


Yes, the pwmgen is likely to be the missing link.
www.linuxcnc.org/docs/html/man/man9/pwmgen.9.html
Is anything connected to the "other side" of the spindle-pwm signal?

I am guessing that a router doesn't need fwd/reverse control, so you probably only need:

loadrt pwmgen output_type=0
...
addf pwmgen.make-pulses base-thread
addf pwmgen.ubdate servo-thread
...
net spindle-pwm pwmgen.0.pwm
net spindle-cmd pwmgen.0.value motion.spindle-speed-out
net spindle-on pwmgen.0.enable

(You actually have some choice about the enable output, you might want to link it to the other amp-enables rather than spindle-on)

Please Log in or Create an account to join the conversation.

More
14 May 2013 19:05 #34070 by BigJohnT
I just checked a Stepconf generated config with PWM spindle checked and it seemed to have all the correct stuff in the hal file.

John

Please Log in or Create an account to join the conversation.

More
15 May 2013 06:07 #34100 by ericg
Thanks for the reply's gents,

I had another look in the hal file and did find that everything (almost) was there albiet scattered amongst other commands but on looking at it over and over, it is starting to make sense the way it is written.

and since my post I have had to reboot the PC and now I am getting the pulse train out but at least I now have a bit of understanding of hal. It still does not alter the router speed but that is probably some other issue.

Tell me, do you gents bother with stepconf wizard or just manipulate hal directly, as a newbie I have been using stepconf wizard, but I'm getting annoyed that it rewrites everything I do and reading more of LinuxCNC it seems I should be moving on from Stepconf (I used BigJohnT's simple pendant in hal and now I have to put that back in, no big deal but I would rather not.

more learning and fiddling to do :) Eric

Please Log in or Create an account to join the conversation.

More
15 May 2013 15:18 #34119 by ArcEye
Stepconf will only take you a certain way and then you really need to start editing by hand.

Don't forget that you can make a new stepconf config with the features you are trying to add and the compare it to your old files and add in the new bits to try them.

It is a good way to learn, with the security of retaining your starting point.

( a # at the start of a line comments out the whole line, so use this rather than deleting anything until you are sure it works)

regards

Please Log in or Create an account to join the conversation.

More
18 May 2013 05:25 #34293 by willburrrr2003
Can you please tell us exactly how you wired all connections into and out of your superPID board. It's possible your software configs are correct and your wiring has an error. for example, if your PWM sig is on the PWM terminal, did you remember to connect terminal VS to terminal POT? Do you have a tach hooked up correctly so that the controller reads rpm for it's closed loop functionality? If the controller doesn't see the tach, it may keep pushing the PID loop higher and higher to it's max setting trying to achieve a low rmp that it's doesn't know it has already past?

Regards,

Will

Please Log in or Create an account to join the conversation.

Time to create page: 0.090 seconds
Powered by Kunena Forum