7I73 MPG Jogging Acting a Bit Weird

  • Skippy1
  • Skippy1's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
13 Apr 2013 17:56 #32673 by Skippy1
7I73 MPG Jogging Acting a Bit Weird was created by Skippy1
Evening all,

Last month I changed my little router from a parallel port to a Mesa 5I25/7I76 setup. Thanks to the PnCConf, everything was straightforward and went very well.

Today, I started setting up a 7I73 pendant card with a manual pulse generator (MPG) and two rotary switches to select the axis to jog, and the jog increments. These were all connected to the P2 connector on the board. Again, using the PnCConf was fairly straightforward, but after some initial success, a few weird things started happening.

The MPG was connected as ENC0 to IN8 and IN9, with 5v and Gnd, and set up as a 'Multi Hand Wheel'. The first switch was then connected to IN0, IN1, IN2, and 3.3v from pin 29, and these inputs set up using 'Axis Selection'/'Joints A, B, and C' respectively. In AXIS, this also worked correctly, jogging the selected axis at whatever was set as the default rate in the MPG config area. (At this stage I was quite smug, and showed the wife, who just rolled her eyes and went back upstairs.)

The second switch was then connected to IN3, IN4, IN5, and the same 3.3v supply from pin 29, and and these inputs set up using 'Overrides'/'Jog Incr' A, B, and C' respectively. This was where it started to unravel. In AXIS, the selected axis jogged at the default rates, but when increased rates were selected with the switch, rate B (0.1mm) moved at the default 0.01mm, and rate C (1.0mm) didn't work. I then notices two axis jogging at the same time. (Less than smug look on my face now.) Double-checking, the the wiring and switches were correct. I cut the second switch off, and manually joined the wired, one at a time, to the 3.3v supply, and got the same screwy results.

I used the Hal Config tool to check and watch the states of the pins when twiddling with the switches and wiring, and it just got weirder. When IN1 was used to select the Y axis, the state of IN3 (Jog rate A) and IN5 (Jog rate C) changes state too. Even stranger, the state of IN7, (which I am not even using for anything), also changed state. And when the IN4 was used to select Jog rate B, the state of the Y axis changed. At no time did any error messages come up, or I have any problems with anything else, just the problem with the MPG side of the system.

I will sleep on it and have another fiddle tomorrow. For no particular reason, I may try connecting the Jog rate switch to the IN13, IN14, and IN15 inputs, and use a separate 5v supply from pin 32. (The Mesa manual notes that inputs 8 through 15 are 5v tolerant.)

Anyway I would be thankful if anyone could suggest what else I can try to trouble-shoot and diagnose this little problem.

Cheers,

Steve

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

More
13 Apr 2013 22:50 #32683 by PCW
Replied by PCW on topic 7I73 MPG Jogging Acting a Bit Weird
The reason you are having trouble is that inputs 0 through 7 are used as analog inputs as well as digital so have no pullup or pulldown resistors so will have unpredictable values when unconnected.

I would suggest using inputs 10 through 15. These have 4.7 k pullups so will be high when unconnected. This means that you now connect your switch common to GND not 3.3V (and use the .not hal input pins)

If you have more switches (and no keypad) they can connect to KEY8 through KEY16. (inputs 16..23) These also have pullups

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

  • Skippy1
  • Skippy1's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
14 Apr 2013 07:49 #32718 by Skippy1
Replied by Skippy1 on topic 7I73 MPG Jogging Acting a Bit Weird
Thanks very much for that. As you suggested, the switches are now connected to inputs 10 through 15 with GND the common. After inverting the inputs, they work a treat. After a bit of reading about pullups and TTL, this electonic stuff is starting to make sense.

Pardon my ignorence, (actually, being too lazy to read the manuals because it makes my head hurt), but is it possible to also use the MPG to vary the feed rate. Something alone the line of an input 'telling HAL that if it sees the signal from the ENC0, that it should vary the feed rate?

Cheers,

Steve

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

More
15 Apr 2013 19:06 #32743 by andypugh
Replied by andypugh on topic 7I73 MPG Jogging Acting a Bit Weird

Pardon my ignorence, (actually, being too lazy to read the manuals because it makes my head hurt), but is it possible to also use the MPG to vary the feed rate. Something alone the line of an input 'telling HAL that if it sees the signal from the ENC0, that it should vary the feed rate?


Just about anything is possible by doing clever things in the HAL layer.

I think the trick is to wire the encoder counts to the halui.max-velocity.counts pin as well as the jog-counts pins.

To prevent the velocity being changed when you jog you also need to do something with the halui.max-velocity.count-enable pin. I think that netting it to halui.program.is-running will give the desired effect.

There are lots of useful pins in halui: www.linuxcnc.org/docs/html/man/man1/halui.1.html

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

  • Skippy1
  • Skippy1's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
16 Apr 2013 08:02 #32782 by Skippy1
Replied by Skippy1 on topic 7I73 MPG Jogging Acting a Bit Weird
Thanks for that Andy,

I'm starting to get the impression that LinuxCNC has got a lot of grunt and flexibility. After reading the basic HAL tutorial , looking at a couple of worked examples, and a thread on the PnCConf forum about spindle speed override, it is starting to slowly fall in place, and I'm looking forward to having a play with this on the weekend.

Cheers,

Steve

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

More
16 Apr 2013 10:32 #32788 by cmorley
Replied by cmorley on topic 7I73 MPG Jogging Acting a Bit Weird

Thanks very much for that. As you suggested, the switches are now connected to inputs 10 through 15 with GND the common. After inverting the inputs, they work a treat. After a bit of reading about pullups and TTL, this electonic stuff is starting to make sense.

Pardon my ignorence, (actually, being too lazy to read the manuals because it makes my head hurt), but is it possible to also use the MPG to vary the feed rate. Something alone the line of an input 'telling HAL that if it sees the signal from the ENC0, that it should vary the feed rate?

Cheers,

Steve


If you are still using PNCconf you can select MPG control for feed, spindle and or max velocity.
If you wish to use one MPG for all of these then you need to use a selection switch.

Chris M

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

  • Skippy1
  • Skippy1's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
25 Apr 2013 18:00 #33185 by Skippy1
Replied by Skippy1 on topic 7I73 MPG Jogging Acting a Bit Weird
Thanks Chris,

At first I didn't quite understand what you meant, but in the end it was just as you said, easy-peasy.

I used PnCConf to set it up with MPG feed override only, and saved the ini and hal files. I did the same thing for selectable axis MPG jogging only. I then used Notepad ++ to compare the two files, and I started reading the HAL manual and other stuff to try and see how it all fits together. (I got a bit sidetracked with all the interesting things other people were doing.) I thought I could hand edit the existing (selectable axis MPG jogging) hal file to make it work with the MPG feed override too.

However, I did what I thought was a dodgy act instead. In PnCConf, I just ticked the MPG feed override box, added a physical switch like you said, and selected it as 'feed override enable'. It worked a treat. I was both surprised and pleased, and then I understood what you meant. I must have a look at the hal file tomorrow to see what happened, and try and nut out how it works.

Thanks again,

Steve

Next stunt is to try and set up the push buttons on the pendant to do something

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

Moderators: cmorley
Time to create page: 0.106 seconds
Powered by Kunena Forum