Advanced Search

Search Results (Searched for: )

  • tommylight
  • tommylight's Avatar
25 Jun 2025 22:21

Solving Reversed Spindle Speed: HAL Inversion for PWM-to-Analog (Pi5, hal_gpio)

Category: Basic Configuration

1 No double posting
2 most VFD's can do 0-5V or 0-10V settable, see manual
3 to invert pins on LinuxCNC it is as simple as :
setp parport.0.pin-01-out-invert 1
Should be similar for RPI, but i do not use RPI so no way of confirming from my side, give it a try.
  • LucDav
  • LucDav
25 Jun 2025 22:10 - 25 Jun 2025 22:13

Solving Reversed Spindle Speed: HAL Inversion for PWM-to-Analog (Pi5, hal_gpio)

Category: Basic Configuration

Hello everyone,

I'm setting up a PWM-controlled spindle for my LinuxCNC machine. My analog DC motor controller requires a 0-10V input, which I'm generating with this specific PWM-to-analog converter: www.amazon.co.uk/Digital-Analog-Module-C...&smid=A2BXCFIGGD7VDT.

The PWM signal is sourced directly from a Raspberry Pi 5's GPIO, routed through our custom-designed isolator board HAT, V1.1, which you can find details about here: github.com/data124001/Isolation/wiki. We're running LinuxCNC version 2.9.1 and using the hal_gpio library.

The core issue is that this specific PWM-to-analog converter appears to invert the control signal: a 100% PWM duty cycle from the Pi (and hal_gpio) results in zero motor speed, while a 0% PWM duty cycle results in full motor speed. This means my spindle speed control is completely reversed from what's expected (higher LinuxCNC speed command = lower motor RPM).

We have confirmed that the PWM signal generated by the Raspberry Pi 5's GPIO (whether directly or via our custom isolator board) is behaving correctly in terms of duty cycle interpretation (e.g., 50% duty cycle is "half on"). However, without this specific PWM-to-analog converter in the loop, we have no meaningful 0-10V speed control for the motor controller, only basic on/off, as the raw PWM is unsuitable.

Therefore, the problem lies squarely with the inversion introduced by the Amazon PWM-to-analog converter itself when converting the standard Pi PWM.

My question is: What are the most effective and robust methods within LinuxCNC's HAL configuration to invert the hal_gpio PWM signal before it reaches this converter? I'm looking for a HAL-based software solution to achieve the correct 0-10V spindle speed control (where a higher LinuxCNC spindle.0.speed-out value corresponds to a higher analog voltage to the motor controller and thus higher motor RPM).

I will be attaching my HAL and INI files to this post to provide full context of my current setup.

Any specific HAL configurations or example code would be incredibly helpful!

Thanks in advance.

 
  • PCW
  • PCW's Avatar
25 Jun 2025 21:26

homing with Phase Z encoder on MESA 7i96s

Category: Advanced Configuration

OK so it looks like the hardware works.

When testing you should have a halshow WATCH tab setup like this:


 


When you set b-index-enable true (yellow) with the "Set" button, it
should go false (red) when you move the encoder past the index position.
  • PCW
  • PCW's Avatar
25 Jun 2025 20:29
Replied by PCW on topic Mesa 7i96s step/dir issues

Mesa 7i96s step/dir issues

Category: Driver Boards

Typically, if step/dir outputs are damaged is means there may be a
grounding or EMI issue, or the step/dir outputs have accidentally
contacted a voltage outside the 0 to 5V range.

If you use shielded cable make sure the shield is terminated to the
7I96S's GND pin (and unterminated at the drive end)
  • RyanB
  • RyanB's Avatar
25 Jun 2025 20:14
Replied by RyanB on topic Mesa 7i96s step/dir issues

Mesa 7i96s step/dir issues

Category: Driver Boards

I appreciate the response, I didn't even know differential existed. I am using shielded Ethernet cables from the mesa to the drivers.

For now I've solved the issue by using another step/dir output and modifying the HAL to those pins.

But it does make me worried that this has happened and may happen again making the board useless for this machine if I loose another one.
  • PCW
  • PCW's Avatar
25 Jun 2025 19:50
Replied by PCW on topic Lo ejes dejaron de moverse

Lo ejes dejaron de moverse

Category: General LinuxCNC Questions

U5 = MC74ACT540DTR2G

U7 = MC74ACT541DTR2G

Digikey has these
 
You could also do a test to verify that the card is generally OK
by moving one axis to stepgen.04 (on TB2) because this STEP/DIR
channel uses a different driver chip (Stepgens 00..03 use U5,U7)

to test this you would have to edit the stepgen numbers in the hal file
or make a new configuration using stepgen.04 for say the x axis
  • Johnnysacalu
  • Johnnysacalu
25 Jun 2025 19:04 - 25 Jun 2025 19:14
Replied by Johnnysacalu on topic Lo ejes dejaron de moverse

Lo ejes dejaron de moverse

Category: General LinuxCNC Questions

He medido los voltios otra vez ahora me da 4,8v antes de encender linuxcnc y lo mismo cuando lo enciendo pero cuando le doy a mover cambia a zero voltios para un lado y y para el otro cambia muy poco

O si crees que es lo mismo u5 y u7 saves quien me la puede arreglar? O donde pedir los componentes 

Gracias 
  • slowpoke
  • slowpoke
25 Jun 2025 18:38

Emulating lathe compound angle via manipulation of X & Z drives

Category: HAL Examples

For jogging there is the 'anglejog' component:
linuxcnc.org/docs/stable/html/man/man9/anglejog.9.html
 
Thank you, and this is what I love about LinuxCNC, it seems that whatever somewhat custom idea you dream up LinuxCNC has the handle to make it happen. It's a tinkerer's  candy store.
 

I need a little assistance with anglejog please.
I added anglejog to the real time thread so I can see the parameters in HAL.
I was hoping to just do a little test jog from HAL before connecting coscounts and sincounts to the servos in HAL.
However both those outputs seem to have really large numbers. Please see attached.
is there anything obvious that I'm doing wrong?
   
 
  • JackRay
  • JackRay
25 Jun 2025 17:38 - 25 Jun 2025 17:42
Replied by JackRay on topic homing with Phase Z encoder on MESA 7i96s

homing with Phase Z encoder on MESA 7i96s

Category: Advanced Configuration

So, when I insert the wire into pin 13, the signal is on “Fasle” and when I remove it, the signal is on “True”. Without connecting Z to GND
  • JackRay
  • JackRay
25 Jun 2025 16:58 - 25 Jun 2025 17:14
Replied by JackRay on topic homing with Phase Z encoder on MESA 7i96s

homing with Phase Z encoder on MESA 7i96s

Category: Advanced Configuration

I'm doing the test again today
  • pgf
  • pgf
25 Jun 2025 15:38

MESA 7i76U inputs changing state without changes to config

Category: Basic Configuration

I'm just tuning in to this discussion, so maybe I missed this, but: On my Mesa 7i96 the Mesa inputs aren't like most digital inputs. They're not self-referenced. They all share a "common" pin, which should be grounded if the inputs are active high, or pulled high if the inputs are active low. Is it possible your 7i76 inputs are the same? Have you done that? If you don't, the your input might not be floating, but its reference is, and could easily lead to erratic/intermittent behavior.

paul
  • PCW
  • PCW's Avatar
25 Jun 2025 15:36 - 25 Jun 2025 21:36

Why does motion planning use linear interpolation instead of b-splines?

Category: General LinuxCNC Questions

I think the main thing here is that there are little real benefits of higher order
interpolation, at least for the speeds, accelerations, and servo period used on
typical LinuxCNC machines.

For example, using a relatively high performance metal cutting machine with say
100 mm/s cutting speed and 0.5G acceleration, the chord error caused by linear
interpolation at the highest centripetal acceleration and at a 1 ms servo thread,
is only about 0.6 microns.

The error just gets smaller a lower speeds and accelerations.
  • tommylight
  • tommylight's Avatar
25 Jun 2025 15:05

Building a 3-axis plasma table with mesa 7i96s, THCad-2 and nema23 steppers

Category: Show Your Stuff

The axes are driven by 3Nm Nema 23 stepper motors and an HTD-5M timing belt with a 15-tooth pulley, without any gear reduction. 

That will do 75mm of motion for a single rotation of the motor, and will have plenty of vibrations, but since you already have that set, do give it a try.
Normally for plasma we aim at 20-25mm per motor revolution, and this does require reduction from 1:3 to 1:5 depending on final drive pulley.
  • vale
  • vale
25 Jun 2025 14:49
Homing Stepperonline A6 was created by vale

Homing Stepperonline A6

Category: EtherCAT

Hello everyone,

I just got a Stepperonline A6 750W ethercat servo motor and drive and am making pretty good progress with it, at the moment just 1 axis to play around.
It is going into OP mode, I can jog it in gmoccapy, but I am having trouble with homing.
I have attached an inductive sensor to the drive, and can use this to home it in the software of stepperonline, but I dont get it to home in gmoccapy.

I am trying to use marcoreps el8_homecomp.comp, but I dont get the drive into opmode 6 for homing.
If I set the cia402.0.home in halshow the drive goes into opmode 6, and is homing, but I can not get it into opmode 6 it with the button in gmoccapy, and I also dont get feedback as soon as it has finished homing.
Not sure if this part in my HAL file is doing anything when I press the button:
# homing
#net x-home-request joint.0.request-custom-homing => cia402.0.home
#net x-homing joint.0.is-custom-homing <= cia402.0.stat-homing
#net x-homed joint.0.custom-homing-finished <= cia402.0.stat-homed

Would be happy if someone can help me.

Thanks!
  • Lcvette
  • Lcvette's Avatar
25 Jun 2025 14:00
Replied by Lcvette on topic probe basic conversational macros missing?

probe basic conversational macros missing?

Category: QtPyVCP

they haven't been completed.
Displaying 12451 - 12465 out of 17746 results.
Time to create page: 0.503 seconds
Powered by Kunena Forum