Need help configuring for external hardware
07 Jun 2016 10:05 #75615
by bastian
Need help configuring for external hardware was created by bastian
Hello everybody!
I hope you can help me. I already spent days on my problem... We have a UNIMAT CNC 3-Axis Mill which was controlled by a computer. The CNC is part of an educational production demonstrator, which itself is controlled by a PLC. Having a rather space consuming pc and another person around (to start a milling process) is not very desirable. We brought a mini-computer from the same manufactor. It is basically a BeagleBone Black with a custom parallel port cape. It runs under Xenomai. The setting runs quite nice, you can start AXIS via USB connection. But we realized, that we still need a person with a seperate computer or laptop to start the milling. Our target is to use the PLC to trigger the milling procedure. There will be a seperate electrical interface which provides voltage level shifting and isolation between BeagleBoard and PLC.
For the start, I looked up the One Button Run/Resume article in the wiki. I decided to use the pin 46 of port 8 on the BeagleBoard for this function. I inserted bb_gpio.p8.in-46 and added the pin number 846 to
# load low-level drivers
loadrt hal_bb_gpio output_pins=826,827,923,926,930 input_pins=807,810,814,817,818,819,846,912,914,915,916,917,918,924,941
in one of the .hal files. I also added HALUI = halui to the [HAL] section in the .ini file. In another file (.bbio), which seems to be processed at statup, I changed the line
P8_46 default
to
P8_46 in
To use the pin as input, I disabled the automatically loaded HDMI-cape configuration in uEnv.txt and configured the pin as input with
echo 71 > /sys/class/gpio/export
echo in > /sys/class/gpio/gpio71/direction
This runs on each system start-up.
When I apply 3.3 Volts to pin P8.46, I can read a locial 1 using cat /sys/class/gpio/gpio71/value. So far, so good. But when I start AXIS and open the Hal Meter, select bb_gpio.p8.in-46, it always returns FALSE although the terminal running next to it, returns a logical 1.
Am I doing something wrong? It might be caused by a statement in the .bbio file, which loads another HDMI overlay. I commented the line out, but then I get the error 'File exits' on AXIS startup when it tries to load cape-universala. On the other hand, reading the pin value with the terminal just works fine.
Do you have any suggestens for me?
Thank you very much
Bastian
I hope you can help me. I already spent days on my problem... We have a UNIMAT CNC 3-Axis Mill which was controlled by a computer. The CNC is part of an educational production demonstrator, which itself is controlled by a PLC. Having a rather space consuming pc and another person around (to start a milling process) is not very desirable. We brought a mini-computer from the same manufactor. It is basically a BeagleBone Black with a custom parallel port cape. It runs under Xenomai. The setting runs quite nice, you can start AXIS via USB connection. But we realized, that we still need a person with a seperate computer or laptop to start the milling. Our target is to use the PLC to trigger the milling procedure. There will be a seperate electrical interface which provides voltage level shifting and isolation between BeagleBoard and PLC.
For the start, I looked up the One Button Run/Resume article in the wiki. I decided to use the pin 46 of port 8 on the BeagleBoard for this function. I inserted bb_gpio.p8.in-46 and added the pin number 846 to
# load low-level drivers
loadrt hal_bb_gpio output_pins=826,827,923,926,930 input_pins=807,810,814,817,818,819,846,912,914,915,916,917,918,924,941
in one of the .hal files. I also added HALUI = halui to the [HAL] section in the .ini file. In another file (.bbio), which seems to be processed at statup, I changed the line
P8_46 default
to
P8_46 in
To use the pin as input, I disabled the automatically loaded HDMI-cape configuration in uEnv.txt and configured the pin as input with
echo 71 > /sys/class/gpio/export
echo in > /sys/class/gpio/gpio71/direction
This runs on each system start-up.
When I apply 3.3 Volts to pin P8.46, I can read a locial 1 using cat /sys/class/gpio/gpio71/value. So far, so good. But when I start AXIS and open the Hal Meter, select bb_gpio.p8.in-46, it always returns FALSE although the terminal running next to it, returns a logical 1.
Am I doing something wrong? It might be caused by a statement in the .bbio file, which loads another HDMI overlay. I commented the line out, but then I get the error 'File exits' on AXIS startup when it tries to load cape-universala. On the other hand, reading the pin value with the terminal just works fine.
Do you have any suggestens for me?
Thank you very much
Bastian
Please Log in or Create an account to join the conversation.
07 Jun 2016 10:16 #75616
by andypugh
Replied by andypugh on topic Need help configuring for external hardware
If you are using the Beaglebone and Xenomai then your software is almost certainly
Machinekit
and not LinuxCNC.
However my first guess would be that the hal_bbio function hasn't been added to a realtime thread. Does it have an "addf" statement in the HAL file?
If it isn't that then you probably need to talk to the Machinekit guys.
However my first guess would be that the hal_bbio function hasn't been added to a realtime thread. Does it have an "addf" statement in the HAL file?
If it isn't that then you probably need to talk to the Machinekit guys.
Please Log in or Create an account to join the conversation.
07 Jun 2016 11:25 #75627
by bastian
Replied by bastian on topic Need help configuring for external hardware
Thank you for your reply.
I think you are defently right. LinuxCNC is the OS the computer and we used so far. I'm not that Linux specialist... I'm sorry for posting here.
There are actually many threads declared, but two of them seem to handle GPIO:
addf bb_gpio.read servo-thread
addf bb_gpio.write servo-thread
Could these be the functions you suggested?
However, I will also ask the guys from machinekit.
If you are using the Beaglebone and Xenomai then your software is almost certainly Machinekit and not LinuxCNC.
I think you are defently right. LinuxCNC is the OS the computer and we used so far. I'm not that Linux specialist... I'm sorry for posting here.
Does it have an "addf" statement in the HAL file?
There are actually many threads declared, but two of them seem to handle GPIO:
addf bb_gpio.read servo-thread
addf bb_gpio.write servo-thread
Could these be the functions you suggested?
However, I will also ask the guys from machinekit.
Please Log in or Create an account to join the conversation.
07 Jun 2016 11:35 #75629
by andypugh
Yes, if those are there then I am out of ideas.
Replied by andypugh on topic Need help configuring for external hardware
addf bb_gpio.read servo-thread
addf bb_gpio.write servo-thread
Could these be the functions you suggested?
Yes, if those are there then I am out of ideas.
Please Log in or Create an account to join the conversation.
07 Jun 2016 11:55 #75632
by bastian
Replied by bastian on topic Need help configuring for external hardware
Okay, they are there. Thank you anyway.
Please Log in or Create an account to join the conversation.
Time to create page: 0.081 seconds