7i92 setup help

More
29 Oct 2016 02:02 #82223 by dingbatca
dingbatca created the topic: 7i92 setup help
I am brand new to LinuxCNC, so please bare with me. I have been CNC'ing for about 15+ years moving from Mach3+SmoothStepper over to LinuxCNC + 7i92. I am stumped. I think I am missing some of the basics.

After a lot of problems and driver issues, I think I have a stale Linux setup of Debian Jessie x86_64 with a 4.4.27-rt kernel. I have LinuxCNC-uspace 2.7.7.53. My 7i92 is up an functioning, I think. I can ping it and linuxcnc is talking to it with the hm2_eth mod. My CNC is a RoverCNC router (Dual X axis setup). I am running a MX4660 controller attached to port 1 and have a cheap break out board attached to the other port.

I loaded the "7i92_MX4660x2D.bit" using mesaflash, I think.

How do I assign my pins and ports?
adam@LinuxCNC:~$ linuxcnc
LINUXCNC - 2.7.7-53-g4c714f9
Machine configuration directory is '/home/adam/linuxcnc/configs/RoverCNC'
Machine configuration file is '7i92.ini'
Starting LinuxCNC...
Found file(REL): ./hm2-pidstepper.hal
Note: Using POSIX realtime
hm2: loading Mesa HostMot2 driver version 0.15
hm2_eth: loading Mesa AnyIO HostMot2 ethernet driver version 0.2
hm2_eth: 10.10.10.10: Hardware address: 00:60:1b:12:01:51
hm2_eth: discovered 7I92
hm2/hm2_7i92.0: Smart Serial Firmware Version 43
hm2/hm2_7i92.0: 34 I/O Pins used:
hm2/hm2_7i92.0:     IO Pin 000 (P2-01): StepGen #0, pin Direction (Output)
hm2/hm2_7i92.0:     IO Pin 001 (P2-14): StepGen #0, pin Step (Output)
hm2/hm2_7i92.0:     IO Pin 002 (P2-02): StepGen #1, pin Direction (Output)
hm2/hm2_7i92.0:     IO Pin 003 (P2-15): StepGen #1, pin Step (Output)
hm2/hm2_7i92.0:     IO Pin 004 (P2-03): StepGen #2, pin Direction (Output)
hm2/hm2_7i92.0:     IO Pin 005 (P2-16): StepGen #2, pin Step (Output)
hm2/hm2_7i92.0:     IO Pin 006 (P2-04): StepGen #3, pin Direction (Output)
hm2/hm2_7i92.0:     IO Pin 007 (P2-17): StepGen #3, pin Step (Output)
hm2/hm2_7i92.0:     IO Pin 008 (P2-05): IOPort
hm2/hm2_7i92.0:     IO Pin 009 (P2-06): IOPort
...
More
30 Oct 2016 01:23 #82247 by andypugh
andypugh replied the topic: 7i92 setup help

dingbatca wrote: I am brand new to LinuxCNC, so please bare with me.


Firstly please accept my apologies for the delay. I have had this in my in-box to reply to, and hadn't noticed that it wasn't approved and that only the moderators could see it.

Hopefully now that the post is actually on the forum there will be rather more activity.

To address your main question, the pinout is largely governed by the firmware. Basically each pin on the 7i92 can either have the function the firmware file gives it, or can be GPIO if that function is disabled.

So, if the firmware defaults to to:
hm2/hm2_7i92.0:     IO Pin 000 (P2-01): StepGen #0, pin Direction (Output)
hm2/hm2_7i92.0:     IO Pin 001 (P2-14): StepGen #0, pin Step (Output)
hm2/hm2_7i92.0:     IO Pin 002 (P2-02): StepGen #1, pin Direction (Output)
hm2/hm2_7i92.0:     IO Pin 003 (P2-15): StepGen #1, pin Step (Output)
hm2/hm2_7i92.0:     IO Pin 004 (P2-03): StepGen #2, pin Direction (Output)
hm2/hm2_7i92.0:     IO Pin 005 (P2-16): StepGen #2, pin Step (Output)
hm2/hm2_7i92.0:     IO Pin 006 (P2-04): StepGen #3, pin Direction (Output)
hm2/hm2_7i92.0:     IO Pin 007 (P2-17): StepGen #3, pin Step (Output)
hm2/hm2_7i92.0:     IO Pin 008 (P2-05): IOPort
hm2/hm2_7i92.0:     IO Pin 009 (P2-06): IOPort

But you only enable 2 stepgens, then the stepgen #3 pins (4 and 17) will be GPIO rather than stepgen.

Just keep asking questions, I am aware that this is not a complete reply.
More
30 Oct 2016 03:52 #82248 by dingbatca
dingbatca replied the topic: 7i92 setup help
Thanks for the reply. I think I am bailing on the 7i92 board. As I am brand new to LinuxCNC, I am moving over to a computer with a known working parallel port card. All the LinuxCNC documentation seems to be written for this and should give me a much better understand of the basics. After I have a known good, with the parallel port card, then I will jump off the deep end.

Some standing questions I do have:
Jitter/latency - how much does this matter when using the 7i92 board?
What exactly does the 7i92 board buy me versus a native parallel port?
How can I cook my own firmware for the 7i92 so I can get a custom pin mapping?
Can you point me to the documentation describing the HAL for the 7i92? Like what in the heck is this doing?! "setp hm2_[HOSTMOT2](BOARD).0.stepgen.00.dirsetup [AXIS_0]DIRSETUP"
More
30 Oct 2016 10:16 #82251 by andypugh
andypugh replied the topic: 7i92 setup help

dingbatca wrote: Thanks for the reply. I think I am bailing on the 7i92 board. As I am brand new to LinuxCNC, I am moving over to a computer with a known working parallel port card.

That isn't a bad idea for a first-time setup.

All the LinuxCNC documentation seems to be written for this

That isn't quite true, most of the docs don't care what interface you are using, and neither does LinuxCNC to a large extent.

Jitter/latency - how much does this matter when using the 7i92 board?

Less so than with a parallel port. This is mainly because the computer needs to access the hardware much less often with an FPGA card. Typically with a parallel port there is a realtime thread running every 20µS, whereas with an FPGA card it runs every 1000µS. Your system latency needs to be less than these numbers, basically.

What exactly does the 7i92 board buy me versus a native parallel port?

Potentially much faster step rates. With the parallel port you are using software step generation, so can only step every 20µS, so that's 50kHz. The FPGA cards can step at 10MHz.
You don't normally need to step at even 50kHz, but there is a secondary factor: Software stepping can either do 50kHz, 25kHz, 16.6kHz etc. The step rate where the stepper hardware can actually follow the step-rate step-changes is probably around 10kHz at best. The cards really come into their own when you have high-count encoders to manage.
Also, you get a lot more IO pins with the FPGA cards. The 7i92 isn't the best example of this, as it is designed around a DB25 connector but the card I am using in my lathe (5i24) has 72 IO pins.
With the right daughter-card even the 7i92 can have a lot more IO than the parallel port using serially-addressed IO. For example you can connect a 7i76 to the 7i92 and then you have terminal blocks for 5 step/dir channels + 48 other connections for general purpose IO such as limit and home switches etc. (and a fast encoder counter for a spindle encoder, with an analogue control voltage for a VFD)

How can I cook my own firmware for the 7i92 so I can get a custom pin mapping?

You need some special (zero-cost) software and the willingness to edit VHDL. Most people don't bother. There are firmwares to suit all the Mesa daughter cards, and for other applications it is generally easier just to make the wiring suit the pinout. You do this anyway with a parallel port, because which pins are outputs and which are inputs is fixed in the parallel port hardware. (This is not the case with a 7i92 or other Mesa card, the pins on the FPGA cards can all be configured as inputs or outputs. The daughter cards have dedicated pin directions, though, just because of the interface hardware that each pin has)

Can you point me to the documentation describing the HAL for the 7i92? Like what in the heck is this doing?! "setp hm2_[HOSTMOT2](BOARD).0.stepgen.00.dirsetup [AXIS_0]DIRSETUP"

First you need to understand that the format [HOSTMOT2](BOARD) means "look in the [HOSTMOT2] section of the INI file, find the "BOARD" section and put the contents here.
That line of HAL will end up being parsed as something like "setp hm2_7i92.0.stephen.00.dirsetup 2000" and sets the direction setup timing (time between setting the DIR pin on the drive and sending the first step in the new direction) to 2000nS.

HAL is described in the manual, which is all here:
linuxcnc.org/docs/2.7/html/
Expand the "HAL" section.
linuxcnc.org/docs/2.7/html/hal/basic-hal.html
Is probably the one you want to answer the question.
The Mesa cards are introduced here:
linuxcnc.org/docs/2.7/html/drivers/hostmot2.html but that section is short of detail on some of the current options. The reference
information is here in the man page linuxcnc.org/docs/2.7/html/man/man9/hostmot2.9.html (which you can get at the command-line with "man hostmot2"
More
30 Oct 2016 21:23 #82260 by dingbatca
dingbatca replied the topic: 7i92 setup help
Thank you for all the great information. It will take me a few days to digest.

One question that jumps right out:

With the parallel port you are using software step generation, so can only step every 20µS, so that's 50kHz.

So how fast can I get my CNC to move, while using a parallel port card? I know there is a ton of information needed to answer that:
MX4660 controller which maxes out at 200KHz. The MX4660 is really just 4X SDM660 , which run at 200KHz, step time = 2500, hold time = 2500.
Running 3.5A NEAM 23 with 1.8/step, 48V.
1616 ball screw (16mm per revolution). That's 1.5875 rev/in.
1/8 micro stepper, or 1600 steps/revolution, or 2540 steps per inch.
Jitter, WORST case, 10,000µS.

I am shooting for a cutting speed of 300IPM. I know all the mechanical stuff can do it. I am pretty sure the driver and steppers can do that. What about the computer?

Yes, I am going for 300IPM. I am cutting out large molds out of 2lb foam.
More
30 Oct 2016 21:57 #82262 by PCW
PCW replied the topic: 7i92 setup help
300 IPM with a 16mm leadscrew and 1/8 u-stepping is about 12.5KHz,
well within the capabilities of LinuxCNC with software stepping with a parallel port
if the host CPU has decent latency. I would suggest using RTAI and the standard
Wheezy distribution as it typically has better latency figures than Preempt-RT
on most hardware
More
31 Oct 2016 03:15 #82268 by dingbatca
dingbatca replied the topic: 7i92 setup help
PCW: Dont think I have much choice. The HM2_ETH driver only works in Preempt-RT. Please correct me if I am wrong.

Next dumb question. English/Metric units causing me problems. When I move my CNC 1in in LinuxCNC it actually/physically moves 3.94in (10cm). I have "LINEAR_UNITS = inch". Ideas?

P.S. Thank you everyone for the wonderful and in depth help.
More
31 Oct 2016 03:28 #82269 by tommylight
tommylight replied the topic: 7i92 setup help
What scale do you have in hal? That is for sure the wrong scaling, although your calculations are correct, but only if you have the motors directly coupled to the screws.
So check the actual screw (probably OK) and the micro stepping as it is close to 4 times the needed distance, so you might have the drives at 1/2 micro stepping.
More
31 Oct 2016 10:51 #82273 by andypugh
andypugh replied the topic: 7i92 setup help

dingbatca wrote: PCW: Dont think I have much choice. The HM2_ETH driver only works in Preempt-RT. Please correct me if I am wrong.


You are correct. You might want to run with the RTAI kernel for your parallel port setup, then switch to the PREMPT-RT kernel if and when you switch to the Mesa card.

Next dumb question. English/Metric units causing me problems. When I move my CNC 1in in LinuxCNC it actually/physically moves 3.94in (10cm). I have "LINEAR_UNITS = inch". Ideas?


That eventually comes down to the numbers in the INI for SCALE for each axis. That number should be the number of step pulses per engineering unit. You can work that out manually to see what it should be.
More
31 Oct 2016 19:22 #82280 by dingbatca
dingbatca replied the topic: 7i92 setup help
Oh I get total N00B points today. I have the MX4660 mounted vertically. SW1 is at the bottom, not top. DOH! Ya, it was 1/4 micro stepper. Fixed and it is now moving correctly and I can hold 533IPM! Woot!

Cooked up a 3.18.20 RTAI kernel, but I only have access to the linuxcnc-uspace in Jessie. So I will stick with Prempt-RT. The odds of me doing any cutting in this configuration are slim. Once I have everything wired in and configured correctly, then I will attempt to cut over to the 7i92 card.

I have two parallel ports coming from my MosChip 9815. Is there any firmware for the 7i92 that sets the pins/ports to match a generic parallel ports; is this even possible? I currently have the 7i92_MX4660x2D.bit firmware loaded.
Attachments:
Time to create page: 0.095 seconds
Powered by Kunena Forum