running BBB + Machinekit newbie questions
I have a BBB plugged into a BeBoPr+. I downloaded Machinekit and followed instructions. I have the BBB connected via a cat5 cable to my router NOT connected to a pc via a usb lead.
Using my development pc (Ubuntu 13.04) on which I run linuxcnc sim (I run the real thing on another pc in my workshop/shed which is 12.04 with a mesa 5i25 ) I can SSH onto the BBB and login using the linuxcnc username and password the BBB address is 192.168.1.21
However when I try to run linuxcnc on the BBB I get an error message no display name and no $DISPLAY environment variable. It ran startx & before linuxcnc but it made no difference. I recompiled linuxcnc on the BBB but it made no difference, So what is the problem here I obviously have an xdisplay problem but do not know how to solve it? I connected my monitor to the BBB using a micro-hdmi - vga connector but the monitor reprted no signal. How can I tell if I mistakenly used the version that does not support hdmi or how can I swithch hdmi on if that is the problem?
As I intend to run the BBB connected to my cnc equipment without a pc connection but with a keyboard / mouse / wireless connection via a usb port + monitor. I cannot progress until this is sorted. So any help would be appreciated.
I guess you are using SSH -X rather than remote-desktop? I am not sure what the other guys use.
I have a lot of ssh -X problems between my Mac and LinuxCNC box. I have found that I only have so long to open an X-app, or it won't work (same error as you see) then I have to log out of the ssh session and back in again, then it works.
I would also very much like to find the root cause and a fix.
~$ ssh -Y 192.168.2.7
As far as Windows goes, here's how I have my BBB set up and working.
Starting with a clean install of MachineKit using the following directions: bb-lcnc.blogspot.com/p/machinekit_16.html
Install Xming: sourceforge.net/projects/xming/files/latest/download
Expand the 'SSH' tab from the 'Category' list
Choose 'X11' from 'SSH' list
Check 'Enable X11 Forwarding'
Make sure you have the device's IP address typed in and then Open the connection
Once you have logged in, it should be as easy as typing in "linuxcnc"
Xming and PuTTY will handle everything else for you.
Quick tip, you do not need to have the HDMI cape enabled. So that frees up a good 24 GPIO pins.
For clarity sake, you do not have to do anything special to the BBB or MachineKit to forward X11 via SSH.
As far as the capes go, I can't offer much advice. I'm running capeless. I'm trying to get LCNC working with only a handful of L298 drivers. I've had a lot of luck turning the motors with a python script I wrote, but I have yet to dive into LCNC's HAL.
It's probably easier with HAL than the Python script (though I see the point in starting with a familiar tool).
Start a HAL session with
loadrt stepgen ctrl_type=v addf stepgen.0 servo-thread
loadrt hal_bb_gpio output_pins=103,105,107,120,121,127,128,129,130,136,139,140,141,142,143,144,145,146
show funct addf <whatever function we just found> servo-thread
show pin net step-pin hal_bb_gpio.000 (or similar) stepgen.0.step net dir-pin hal_bb_gpio.000 (or similar) stepgen.0.dir
start setp stepgen.0.velocity 10
This isn't the high-performance way to do this. This is using GPIO running in the default 1kHz thread to generate step pulses at a max of 500Hz. The better way is to use the BBB PRU driver, but i know even less about that.
linuxcnc@arm:~$ halrun rtapi:0 stopped msgd:0 stopped halcmd: loadrt stepgen ctrl_type=v <stdin>:1: /home/linuxcnc/linuxcnc/libexec/rtapi_app_xenomai exited without becoming ready <stdin>:1: insmod failed, returned -1 See the log and output of 'dmesg' for more information. halcmd:
Checking dmesg doesn't seem to reveal anything of consequence - that I can tell. pastie.org/8420026
I think that the "dmesg" advice is outmoded. With Xenomai the debug data doesn't go there any more.
Section 3.1 here:
It seems I need to set up a channel first, before running stepgen. pastie.org/8421759
Can I assume "axis" is synonymous with "channel"?
I'm getting a bit ahead of myself, but reading the stepgen man was enlightening. It seems (for my set up) I should use step_type 7 and 8 (considering the L298N is an H bridge and my steppers are bipolar). Is there a difference between type7 and type8? Or am I misunderstanding how that works?
Ah, yes, my mistake. You can't specify a control type without specifying a step_type.
loadrt stepgen step_type=0 ctrl_type=v
Not entirely. In this case it is referring to an "instance" of a step generator. Not directly related to an Axis (this basic HAL config won't have any axes as such)
Can I assume "axis" is synonymous with "channel"?
Sounds about right. The difference is illustrated here:
It seems (for my set up) I should use step_type 7 and 8 (considering the L298N is an H bridge and my steppers are bipolar). Is there a difference between type7 and type8? Or am I misunderstanding how that works?
Type 7 only ever energises 1 winding, type 8 always energises 2. 8 will be hotter, but have more torque.