Hobbyist Toolkit

cancel
Showing results for 
Search instead for 
Did you mean: 

Raspberry Pi 4 LINX PWM

I am trying to run a NEMA 17 stepper motor with an A4988 motor driver. I have the LINX target firmware setup and I'm able to step the motor one step at a time using a boolean control and the Digital Write vi. But when I try the PWM vi it says the channel is not compatible with the raspberry pi. I have tried channel 18 and 32 to match the pins. I have tried channel 0 and 1 to maybe match the "PMW0" channel. Nothing works. How can I write a pwm signal to the Pi using LINX?

0 Kudos
Message 1 of 8
(534 Views)

The Linx shared library for the Raspberry Pi does not currently implement the PWM functionality.

Rolf Kalbermatter
Averna BV
0 Kudos
Message 2 of 8
(499 Views)

I have seen other posts where people have been able to do it successfully using linx, how is that possible? If I cannot use linx, is there a way to send a square wave without making one using delays?

0 Kudos
Message 3 of 8
(494 Views)

Probably you saw posts using arduino, not rpi

 

you can create square waves using arrays or pt by pt.

 

 

Jorge Augusto Pessatto Mondadori, PhD
Sistema Fiep
CLAD, CLD
0 Kudos
Message 4 of 8
(491 Views)

I'm not sure how to do it with arrays. I'm trying to make a robot arm that will use multiple steppers, having square waves calculated manually might end up being overwhelming, right? Is there a hardware way around it?

0 Kudos
Message 5 of 8
(488 Views)

I recall RPi 4 does not have a hardware PWM chip type option, so you are going to have to setup a custom LABVIEW code to talk to a 3rd party RPi PWM board.  That is how I did it about a year ago.  I will try to see if I can find my old code and post it here.

0 Kudos
Message 6 of 8
(372 Views)

I have the same question on this topic. i wanna generate a PWM to drive the motor. how can it be?

0 Kudos
Message 7 of 8
(309 Views)

What kind of duty cycle are you looking for. I bet the timed loop is good for loops as fast as 10kHz. If you need to go faster, this kit has PWM capabilities. It's 90% there.

https://forums.ni.com/t5/Community-Documents/LabVIEW-BCM2835-Library-for-Raspberry-Pi/ta-p/3539080

CLED (2016)
0 Kudos
Message 8 of 8
(239 Views)