[Machinekit] Re: Conditionally loading a HAL file

2019-07-18 Thread Paulo Sherring
Late solving here, just posting in case it helps someone someday :)

I created a small python code to test if the joystick file exists and 
called it with loadusr -w joystickLoader
In my case, i got these three files:

joystickLoader:
#!/usr/bin/python
import hal
import os

# load the HAL file 'joystickOptions.hal'
res = os.spawnvp(os.P_WAIT, "halcmd", ['halcmd' , '-k', '-Q', '-f', 
'joystickOptions.hal'])
joyFileExists = os.path.isfile('/dev/js0')
if joyFileExists == True:
  print 'Joystick found! Initilizing...'
  # load the HAL file 'joystickOptions.hal'
  res = os.spawnvp(os.P_WAIT, "halcmd", ['halcmd' , '-k', '-Q', '-f', 
'joystickOptions.hal'])
  if not res:
res = os.spawnvp(os.P_WAIT, "halcmd", ['halcmd' ,"-f", 
"joystickSuccess.hal"])
if res:
  print ' TRY LOADER ERROR: try_sucess.hal file Error'
  raise SystemExit, res
else:
  print 'No joystick found'
exit()

joystickOptions.hal:
loadusr hal_input -KRAL 1

joystickSuccess.hal:
loadrt or2 count=2
loadrt mux4 count=2
addf or2.0 servo-thread
addf or2.1 servo-thread
addf mux4.0 servo-thread
# set the jog speed for the joypad again use numbers that make sense for 
your machine
setp mux4.0.in0 0 # this one must be 0 to prevent motion unless a button is 
pressed
setp mux4.0.in1 50
setp mux4.0.in2 300
setp mux4.0.in3 1800
# the following does the magic of setting the jog speeds
net remote-speed-slow or2.0.in0 input.0.btn-thumb2
net remote-speed-medium or2.1.in0 input.0.btn-thumb
net remote-speed-fast or2.0.in1 or2.1.in1 input.0.btn-joystick
net joy-speed-1 mux4.0.sel0 <= or2.0.out
net joy-speed-2 mux4.0.sel1 <= or2.1.out
net joy-speed-final halui.jog-speed <= mux4.0.out
net joy-x-jog halui.jog.0.analog <= input.0.abs-x-position
setp input.0.abs-y-scale -127.5
net joy-y-jog halui.jog.1.analog <= input.0.abs-y-position
addf mux4.1 servo-thread
setp mux4.1.in0 0
setp mux4.1.in1 -1
setp mux4.1.in2 1
setp mux4.1.in3 0
net joy-z-up mux4.1.sel0 <= input.0.btn-base
net joy-z-down mux4.1.sel1 <= input.0.btn-base2
net joy-z-jog halui.jog.2.analog <= mux4.1.out


Best Regards.
Paulo Sherring.

Em segunda-feira, 1 de outubro de 2018 13:05:50 UTC-3, Paulo Sherring 
escreveu:
>
> Hey there! I am new to machinekit / linuxcnc and I have a question I 
> couldn't find an answer. I have a joystick pluged in a BeagleBone Green and 
> I use it to control a CNC router. The fact is that sometimes, I may have to 
> use the machine without the controller - maybe its mal functioning or 
> something of this sort.
> Currently, I am loading a hal file that specifically sets up the relations 
> between the buttons and the jog signals on my INI file, something like:
> HALFILE = joystick.hal
> What I need is to run some kind of check on my ini file to load it or not, 
> something like 
> if [ -f /dev/input/js0]
> then
> HALFILE = joystick.hal
> fi
>
> Obviously, this could also be inside the hal file itself, but, I also 
> don't know how to do it :(
> Thanks in advance!
> Paulo Sherring.
>

-- 
website: http://www.machinekit.io blog: http://blog.machinekit.io github: 
https://github.com/machinekit
--- 
You received this message because you are subscribed to the Google Groups 
"Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to machinekit+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/machinekit.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/machinekit/e8a231e3-5616-41ed-b7bb-06ce426896a8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Machinekit] Re: DE10 Nano suggested development environment?

2019-07-18 Thread Charles Steinkuehler
I _think_ the debugging will get output to the log file if you launch
with something like DEBUG=5.

I don't think you need to pass any parameters to the hm2_soc_ol
driver, it's the hm2 module that takes things like the sserial= option.

IIRC, with full debugging turned on, you'll get a dump with quite a
bit of detail as the hm2 driver launches and starts auto-probing the
hardware to see what's configured.

On 7/18/2019 8:11 AM, justin White wrote:
> Charles, is there any way to see that SSerial is actually running? Typically 
> when you start LinuxCNC from terminal Hm2 will print the sserial version 
> running first. I can’t see this by starting a config with Machinekit. I tried 
> launching a basic source file and manually loadrt from halrun but the 
> differences are such that I couldn’t figure out how to loadrt hm2_soc_ol with 
> any config options.  I’m not sure if the “atlas_sv” file needs a 
> modification. For smart serial, like I said I’m just using the same renamed 
> 3x24.sv I’ve been using.
> 
> By “not work” i mean when starting MK plugged into the 8i20 from my mill I 
> get no hm2_5i25.0.8i20.. pins as I would  with the 8i20 plugged into the 
> 7i76e/x86 pc installed on the mill. I didn’t have any issues with the cable, 
> connection I made for that and this is pretty much exactly the same.
> 
> I’ve checked all my connections but I certainly wouldn’t rule out that I 
> missed something. It’d be great if I could find some evidence that either 
> sserial is actually running or that the hardware isn’t communicating anything 
> at all, like some sort of serial terminal where I could at least check for 
> some sort of handshake process.
> 


-- 
Charles Steinkuehler
char...@steinkuehler.net

-- 
website: http://www.machinekit.io blog: http://blog.machinekit.io github: 
https://github.com/machinekit
--- 
You received this message because you are subscribed to the Google Groups 
"Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to machinekit+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/machinekit.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/machinekit/98f02822-da76-6107-e4c5-1e3a65ba06a5%40steinkuehler.net.
For more options, visit https://groups.google.com/d/optout.


Re: [Machinekit] Re: DE10 Nano suggested development environment?

2019-07-18 Thread justin White
Charles, is there any way to see that SSerial is actually running? Typically 
when you start LinuxCNC from terminal Hm2 will print the sserial version 
running first. I can’t see this by starting a config with Machinekit. I tried 
launching a basic source file and manually loadrt from halrun but the 
differences are such that I couldn’t figure out how to loadrt hm2_soc_ol with 
any config options.  I’m not sure if the “atlas_sv” file needs a 
modification. For smart serial, like I said I’m just using the same renamed 
3x24.sv I’ve been using.

By “not work” i mean when starting MK plugged into the 8i20 from my mill I get 
no hm2_5i25.0.8i20.. pins as I would  with the 8i20 plugged into the 
7i76e/x86 pc installed on the mill. I didn’t have any issues with the cable, 
connection I made for that and this is pretty much exactly the same.

I’ve checked all my connections but I certainly wouldn’t rule out that I missed 
something. It’d be great if I could find some evidence that either sserial is 
actually running or that the hardware isn’t communicating anything at all, like 
some sort of serial terminal where I could at least check for some sort of 
handshake process.

-- 
website: http://www.machinekit.io blog: http://blog.machinekit.io github: 
https://github.com/machinekit
--- 
You received this message because you are subscribed to the Google Groups 
"Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to machinekit+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/machinekit.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/machinekit/0824bc35-2f19-4649-b564-a7b4bea71b7f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Machinekit] Re: DE10 Nano suggested development environment?

2019-07-18 Thread Charles Steinkuehler
>From what I know your pin file looks OK, but I'm not an expert on SSerial.

Can you need to expand a bit on "still couldn't get it to work".  The
hm2 driver will automatically look for and create HAL pins for any
SSerial devices it finds, but the far end needs to be powered up and
responding to SSerial communication when the driver loads for this to
happen (eg: the field I/O on the 7i76).

So if the FPGA hardware is OK, you should see some communication on
the SSerial lines when the hm2 driver loads.

On 7/17/2019 10:38 PM, justin White wrote:
> 
> Same as attached on july 13 except I changed SS numinst to 1.
> 
> On Wednesday, July 17, 2019 at 11:24:07 PM UTC-4, Charles Steinkuehler 
> wrote:
>>
>> Got a link to your pin file for review? 
>>
>> On 7/17/2019 6:59 PM, justin White wrote: 
>>> I used 2 instances of SSerial in the pinfile which was incorrect. I'm 
>> told 
>>> 1 instance covers 8 SSerial channels. I built a new .rbf with 1 instance 
>>> and still couldn't get it to work. PCW confirms that the encoder/stepgen 
>>> thing should work just fine so I'm pretty much out of ideas. 
>>>
>>> On a side note, how might I go about changing the framebuffer resolution 
>> to 
>>> the HDMI? Only certain monitors will display anything from the DE10 
>> which 
>>> makes it kind of a PIA to test this as I have to drag another monitor 
>> down 
>>> to my mill since my mill's monitor wont display the Nano. The way it's 
>>> achieving a resolution doesn't seem standard as no standard method of 
>>> changing it from 1024x768 seems to work. 
>>>
>>> On Sunday, July 14, 2019 at 5:25:31 PM UTC-4, justin White wrote: 

 There was something wrong with my build environment, deleted it and I 
>> was 
 able to get a good .rbf. 

 I wasn't able to get this working with my 8i20 though. I added 
 "sserial_port_0=00" to the config line as in my other sserial 
>> configs. 

 I'll probably hold off on anymore testing until I get a board fabbed 
>> with 
 dedicated serial hardware, but the firmware could probably use some 
>> looking 
 into. 

 On Sunday, July 14, 2019 at 6:08:13 AM UTC-4, justin White wrote: 
>
> Any insight on the issue with the rbf? 


>>>
>>
>>
>> -- 
>> Charles Steinkuehler 
>> cha...@steinkuehler.net  
>>
> 


-- 
Charles Steinkuehler
char...@steinkuehler.net

-- 
website: http://www.machinekit.io blog: http://blog.machinekit.io github: 
https://github.com/machinekit
--- 
You received this message because you are subscribed to the Google Groups 
"Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to machinekit+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/machinekit.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/machinekit/dadd434b-8b92-930a-d4fd-6b678b9aa5ea%40steinkuehler.net.
For more options, visit https://groups.google.com/d/optout.


Re: [Machinekit] VFD for 180v DC motor

2019-07-18 Thread Aurelien
Marius i don't see your message before sending my last message.

Thanks a lot for schematics.

-- 
website: http://www.machinekit.io blog: http://blog.machinekit.io github: 
https://github.com/machinekit
--- 
You received this message because you are subscribed to the Google Groups 
"Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to machinekit+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/machinekit.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/machinekit/604d4716-b67f-47ec-908b-3b9e18bea94b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.