running BBB + Machinekit newbie questions

More
12 Oct 2013 04:55 #39788 by alanb
Hi,
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.

Alan

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

More
12 Oct 2013 07:55 #39791 by andypugh

However when I try to run linuxcnc on the BBB I get an error message no display name and no $DISPLAY environment variable.


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.

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

More
21 Oct 2013 21:35 #40129 by ggpwnkthx
It's been a couple weeks since you had this issue, but I'm curious if you solved it. I found this doc that seems fairly straight forward: www.seas.upenn.edu/cets/answers/x11-forwarding.html
~$ ssh -Y 192.168.2.7
I'll try it out on my Mac later this afternoon and report back.

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
Start Xming
Open PuTTY
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. :)
i.imgur.com/dgsB7Cn.png

For clarity sake, you do not have to do anything special to the BBB or MachineKit to forward X11 via SSH.

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

More
22 Oct 2013 02:44 #40144 by alanb
Due to a cartload of errors and stupidity on my part (plus bricking one BBB ) . I can now connect to my BBB + BeBoPr+ using ssh from a linux machine. I will also try your windows suggestion. Two things, firstly I guess I wasn't reading the documentation carefully enough and secondly you do need to ensure that cape-bebopr-brdg is added to capemgr.disable_partno in uEnv.txt

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

More
22 Oct 2013 05:15 - 22 Oct 2013 05:19 #40152 by ggpwnkthx
Glad to read you're up and running; and sorry for your loss. If it makes you feel any better, at only $45 I'm a bit more wreckless with the BBB, too, than I am with any of my other boards.

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.
Last edit: 22 Oct 2013 05:19 by ggpwnkthx.

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

More
22 Oct 2013 06:05 - 22 Oct 2013 15:57 #40154 by andypugh

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
halrun
Then start a realtime thread
loadrt threads
Then load a step generator, in velocity mode, and link it to the thread.
loadrt stepgen ctrl_type=v
addf stepgen.0 servo-thread
Load the BBB gpio driver, I have never used this, so guesswork follows
loadrt hal_bb_gpio output_pins=103,105,107,120,121,127,128,129,130,136,139,140,141,142,143,144,145,146
I don't know what functions that driver exports, but that is OK, this command will tell us:
show funct
addf <whatever function we just found> servo-thread
I don't know what the pins are called either
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
Then start the real-time threads and set the stepgen running:
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.
Last edit: 22 Oct 2013 15:57 by andypugh.

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

More
22 Oct 2013 07:08 #40156 by ggpwnkthx
Thanks for your help, Andy. You've given me a head start, but your second command throws an error for me.
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

Any ideas?

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

More
22 Oct 2013 16:02 #40161 by andypugh

Checking dmesg doesn't seem to reveal anything of consequence - that I can tell. pastie.org/8420026
Any ideas?


I think that the "dmesg" advice is outmoded. With Xenomai the debug data doesn't go there any more.
Section 3.1 here:
static.mah.priv.at/public/html/common/Un...d.html#_installation

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

More
22 Oct 2013 23:50 #40184 by ggpwnkthx
Thanks again, Andy.

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?

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

More
23 Oct 2013 00:15 #40188 by andypugh

It seems I need to set up a channel first, before running stepgen. pastie.org/8421759


Ah, yes, my mistake. You can't specify a control type without specifying a step_type.
loadrt stepgen step_type=0 ctrl_type=v
ought to work.

Can I assume "axis" is synonymous with "channel"?

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)

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?

Sounds about right. The difference is illustrated here:
www.linuxcnc.org/docs/html/hal/rtcomps.h...:Two-and-Three-Phase
Type 7 only ever energises 1 winding, type 8 always energises 2. 8 will be hotter, but have more torque.

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

Time to create page: 0.188 seconds
Powered by Kunena Forum