Advanced Search

Search Results (Searched for: )

  • feng
  • feng
12 Aug 2024 06:49

How to add parallel input card in my EtherCAT configuration

Category: Basic Configuration

How to add parallel input card in my EtherCAT configuration to control the frequency converter and handwheel with 0~10V input




#*********************
#  手轮设置
#*********************

loadrt hal_parport cfg="1 in"
addf parport.0.read servo-thread

# Jog Pendant
loadrt encoder num_chan=1
loadrt mux4 count=1
addf encoder.capture-position servo-thread
addf encoder.update-counters servo-thread
addf mux4.0 servo-thread

# If your MPG outputs a quadrature signal per click set x4 to 1
# If your MPG puts out 1 pulse per click set x4 to 0
setp encoder.0.x4-mode 0

# For velocity mode, set to 1
# In velocity mode the axis stops when the dial is stopped
# even if that means the commanded motion is not completed,
# For position mode (the default), set to 0
# In position mode the axis will move exactly jog-scale
# units for each count, regardless of how long that might take,
setp axis.x.jog-vel-mode 0
setp axis.y.jog-vel-mode 0
setp axis.z.jog-vel-mode 0

# This sets the scale that will be used based on the input to the mux4
setp mux4.0.in0 0.1
setp mux4.0.in1 0.01
setp mux4.0.in2 0.001

# The inputs to the mux4 component
net scale1 mux4.0.sel0 <= parport.0.pin-08-in-not
net scale2 mux4.0.sel1 <= parport.0.pin-07-in-not

# The output from the mux4 is sent to each axis jog scale
net mpg-scale <= mux4.0.out
net mpg-scale => axis.x.jog-scale
net mpg-scale => axis.y.jog-scale
net mpg-scale => axis.z.jog-scale

# The MPG inputs
net mpg-a encoder.0.phase-A <= parport.0.pin-13-in
net mpg-b encoder.0.phase-B <= parport.0.pin-10-in

# The Axis select inputs
net mpg-x axis.x.jog-enable <= parport.0.pin-15-in-not
net mpg-y axis.y.jog-enable <= parport.0.pin-11-in
net mpg-z axis.z.jog-enable <= parport.0.pin-04-in

# The encoder output counts to the axis. Only the selected axis will move.
net encoder-counts  <= encoder.0.counts
net encoder-counts => axis.x.jog-counts
net encoder-counts => axis.y.jog-counts
net encoder-counts => axis.z.jog-counts


#*********************
#  变频器PWM控制
#*********************
loadrt pwmgen output_type=1
net spindle-cmd-rpm => pwmgen.0.value
net spindle-on <= spindle.0.on => pwmgen.0.enable
net spindle-pwm <= pwmgen.0.pwm

setp pwmgen.0.pwm-freq 100.0
setp pwmgen.0.scale 24000.0
setp pwmgen.0.offset 0.0
setp pwmgen.0.dither-pwm true

net spindle-cmd-rpm     <= spindle.0.speed-out
net spindle-cmd-rpm-abs <= spindle.0.speed-out-abs
net spindle-cmd-rps     <= spindle.0.speed-out-rps
net spindle-cmd-rps-abs <= spindle.0.speed-out-rps-abs
net spindle-at-speed    => spindle.0.at-speed
net spindle-cw <= spindle.0.forward

net spindle-pwm     => parport.0.pin-01-out
net spindle-cw      => parport.0.pin-16-out


The above is the HAL file I configured, but it seems that it cannot output PWM signals correctly
 
  • Cant do this anymore bye all
  • Cant do this anymore bye all's Avatar
12 Aug 2024 05:47
Replied by Cant do this anymore bye all on topic LinuxCNC-RIO - RealtimeIO for LinuxCNC based on FPGA (ICE40 / ECP5)

LinuxCNC-RIO - RealtimeIO for LinuxCNC based on FPGA (ICE40 / ECP5)

Category: Computers and Hardware

I'm going to have to disagree with you on the need for pull up or pull down resistors on inputs, especially with switches (unless the switch is switching to either zero or 5v)and rotary encoder that have an open collector output. Without a pullup or pull down resistor the input is going to float, until that input has a definite logic level on it. With high impedance inputs it requires very very little current to switch the input, if the voltage is at the right level. Generally on a chip such as the venerable 74xx245 when the enable inputs are in the disable state the output is considered to be in a "high impedance state" and is unable to "drive" the outputs.
Honestly any input that is connected via a cable needs a pullup or pulldown resistor for the case of a breakage in the signal wire, especially with an MPG, if teh signal wire breaks you want that input at the board end to held at a known level. The last thing you want is for your input to pick up stray noise and start oscillating. The chip wont "know" if it is a legitimate signal or noise and will pass that on to the other side.
That's why sometimes I feel am opto isolator is a bit better in this respect as the current required to drive the LED in normal situations is a little higher than induced noise in the line.

Never in my life have I designed a digital circuit that takes external off board signals with pullup or pulldown resistors, or inputs that get the input from a SPST switch from an on board switch without a pullup or pull down.
  • arijitdutta
  • arijitdutta
12 Aug 2024 03:32 - 12 Aug 2024 03:33

Question regarding limit and home switch config

Category: General LinuxCNC Questions

Hi all,

I have two NPN NO proximity sensors hooked up on my lathe on input 1,2 in my 7i96s. In the Pncconf wizard, when I am trying to put the 'limit and home shared' on the respective axis and home them together, both axis are moving towards the sensors, then as soon as the one axis reaches the home switch, both the axis starts the homing sequence without the other getting at the home position and then it shows "limit joint 0/1 error". But when I am changing the inputs from 'limit and home shared' to 'home', the homing sequence works properly and it behaves just like a shared limit-home switch.

Since the proper input should be the shared limit-home, is there something that I am doing wrong or am I missing something?
  • M4MazakUser
  • M4MazakUser
12 Aug 2024 00:55
Replied by M4MazakUser on topic Adding a 'C' axis

Adding a 'C' axis

Category: Advanced Configuration

I have a working config running two 8i20 cards driving modified fanuc motors. And haven't been able to get my head around how to control a stepper, there's two steppers included in the firmware and I can't understand how to use them. 
  • M4MazakUser
  • M4MazakUser
12 Aug 2024 00:50 - 13 Aug 2024 11:18
Adding a 'C' axis was created by M4MazakUser

Adding a 'C' axis

Category: Advanced Configuration

I'm having problems trying to add a stepper to my config, 
I would have used pnc config originally to generate my files BUT it didn't work with my 5i22 card - which was all that was available during covid. So my config is a mash of everything I could find on this forum.  Its been working well! 
The two files below are my ini and hal files.
  • spumco
  • spumco
11 Aug 2024 23:53
Replied by spumco on topic Cylindrical mapping

Cylindrical mapping

Category: Show Your Stuff

A "virtual Y" like most Y-axis lathes I've seen - cool.  Thanks for the explanation on the kinematics.

Your panel is spectacular, as is the GUI/HMI.
  • Mecanix
  • Mecanix
11 Aug 2024 22:22 - 11 Aug 2024 22:26

LinuxCNC-RIO - RealtimeIO for LinuxCNC based on FPGA (ICE40 / ECP5)

Category: Computers and Hardware

Sure, as I've suspected there's countless ways to do it better in Rio. Brilliant kit!!

That mpg.hal integration would sure be nice. Not saying this for convenience for myself, but more about the fact that those analog MPGs are extremely common, inexpensive and functioning reliably well. Wired-Rulez!!

I'll have a look at that epic conditional net's (bracket or !bracket) [FEAT]. Haha awesome, just noticed the potential power of that thing; from useless zero-conditional HAL design -to- RIO conditional programming-like HAL. Who would have tought. O M G!! 
  • meister
  • meister
11 Aug 2024 22:11

LinuxCNC-RIO - RealtimeIO for LinuxCNC based on FPGA (ICE40 / ECP5)

Category: Computers and Hardware

I'll have a look at your HAL, thanks, maybe I can integrate it, but you can also write your hal-file here:

Output/Mecanix/LinuxCNC/postgui_call_list.hal

rio does not overwrite anything in this file when generating


yes, it should be something like that, only with the wled plugin,
but that's not what I wanted to show

it's about the new killer feature :)

you can now write logical links including round brackets in the 'net' field
  • PCW
  • PCW's Avatar
11 Aug 2024 21:55
Replied by PCW on topic step/dir spindle control

step/dir spindle control

Category: PathPilot

You would normally use a stepgen in mode 2 for a frequency source
not a PWMgen. If you only have 1 PWMgen, and its not needed for other
duties that should work. It will generate the requested frequency.

The reason I say this is that the PWM frequency is a global for all
PWMgens so all PWMgens  in a system would need to be ok with
a 12.5 KHz frequency if one was used for a 12.5 KHz chargepump.

If the chargepump circuit works down to 3.5 KHz, that's because
of its design.

If you set the scale to 100, you should set the value to 50 for a 50%
duty cycle (Square wave). A value of 5 with a scale of 100 is 5% duty
cycle (4 usec on 76 usec off at 12.5 KHz)
  • dreynolds
  • dreynolds
11 Aug 2024 21:28
Replied by dreynolds on topic step/dir spindle control

step/dir spindle control

Category: PathPilot

I got it working - I'm not sure why and I think I'm even more confused - but it works! I found an older post on CNCZone. You recommended setting for a C11 REV8 board. I can confirm they also work for a C6 REV6.2 spindle control board. www.cnczone.com/forums/novakon/343810-pa...814.html#post2091814

I had to bypass the spindle comp in PathPilot and add the missing items from the above post that were missing in my original hal file.

Is the below appropriate for my charge pump that requires 12.5khz signal? It works but I can drop the frequency all the way down to 3500 and it still works. Below that it does not.

setp hm2_[HOSTMOT2](BOARD).0.pwmgen.00.output-type 1
setp hm2_[HOSTMOT2](BOARD).0.pwmgen.pwm_frequency 12500
setp hm2_[HOSTMOT2](BOARD).0.pwmgen.00.scale 100
setp hm2_[HOSTMOT2](BOARD).0.pwmgen.00.value 5

What frequency is it actually putting out? Is there a frequency, scale and value more appropriate for a 12.5khz signal?
  • Mecanix
  • Mecanix
11 Aug 2024 21:27 - 11 Aug 2024 21:28

LinuxCNC-RIO - RealtimeIO for LinuxCNC based on FPGA (ICE40 / ECP5)

Category: Computers and Hardware

You'll have to find out for yourself what's so special about it,
I only say HAL of hell :P


 
  • Mecanix
  • Mecanix
11 Aug 2024 21:21

LinuxCNC-RIO - RealtimeIO for LinuxCNC based on FPGA (ICE40 / ECP5)

Category: Computers and Hardware

Only source code I've had to change was for the board family to be recognized as a its high-speed C7/i6 type.

/riocore/riocore/boards/MecanixDev/board.json
[-] "family": "GW1N-9C",
[+] ​​​​​​​"family": "GW1N-9C7",

/riocore/riocore/generator/toolchains/gowin/toolchain.py
Line 103:
[+]  if family == "GW1N-9C7":
[+]  prj_data.append(f' <Device name="{family_gowin}" pn="{ftype}">gw1nr9c-017</Device>')


That was the reason my PIN03, PIN13, PIN 15 (high speed bank) was not working. The Gowin was always compiling for a C6/I5 fpga type :(
But allpins works now!!
  • blazedforever
  • blazedforever
11 Aug 2024 21:21
Configuring a dual stage axis was created by blazedforever

Configuring a dual stage axis

Category: Advanced Configuration

So I'm trying to extend my work envelope on my mills X-axis. I'd like to know if there is a way to have a second driven linear stage ontop of the main axis stage that would activate and continue x axis travel when the first axis has reached its limit.

In the positive direction, at max limit on stage-0 :  stage-1 activates until its max limit is hit.

In the negative direction from stage-1 max limit :  stage-1 activates stage-0 when it's min limit is hit, stage-0 then can travel to its min limit.

Is there a way to configure LinuxCNC to work with a setup like this?
  • Mecanix
  • Mecanix
11 Aug 2024 21:14

LinuxCNC-RIO - RealtimeIO for LinuxCNC based on FPGA (ICE40 / ECP5)

Category: Computers and Hardware


1. Created a folder ./gtc_custom/mpg/ (i.e. under /Output/LinuxCNC/)
2. Placed mpg.hal inside it (see attched source). 
3. Riogui -> Linucnc -> INI-Defaults -> HAL -> HALFILE (custom) == "./gtc_custom/mpg/mpg.hal"

For the moment this works wonder. Although I bet there are better ways to do it in Rio but I'm way too noob at it still. 
  • meister
  • meister
11 Aug 2024 21:09

LinuxCNC-RIO - RealtimeIO for LinuxCNC based on FPGA (ICE40 / ECP5)

Category: Computers and Hardware

did i already mention that i have a script to visualise the HAL ?

python3 riocore/files/hal2graphviz.py Output/OctoBot/LinuxCNC/rio.ini  && display /tmp/hal-graph.svg

 
Displaying 23311 - 23325 out of 25037 results.
Time to create page: 0.441 seconds
Powered by Kunena Forum