[beagleboard] Re: PWM generation using libpruio
Break out your PWM on to a PIC16Fx (using it crystal-controlled with software-based PWM by counting the clock cycles per instruction) and then use UART to control it. An alternative fix, but it does give you nice isolation in the process. Depending on how powerful your servos are, you might have to 2 or 3 stage it with SSR's (solid state relay chips) or direct to MOSFET (Irfz24N is a nice cheap one, and use some beefy fast rectifiers going backward to null out the inductive blowback from the coils on stop). Hobby servos can be controlled direct from a standard TTL level output btw. On Tuesday, November 29, 2016 at 10:30:41 PM UTC-7, Akshay Gahlot wrote: > > I want to use for PWM generation to control servo motor. The problem i m > facing is : > > To enable libpruio i m using this dts file > > https://github.com/jadonk/cape-firmware/blob/master/arch/arm/boot/dts/BB-BONE-PRU-01-00A0.dts > > To enable the pwm pin i m using cape-universaln > > https://github.com/cdsteinkuehler/beaglebone-universal-io/blob/master/cape-universaln-00A0.dts > > These both files are kind of conflicting with each other as if one is > loaded to slots then other is not loading. > > If i do not load the cape-universaln i m not able to export the pwm pins. > > Any help appreciated. > -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/cc6b758e-6ac8-4fa7-a722-135ada7fb6c9%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[beagleboard] Re: PWM generation using libpruio
Hi! Am Mittwoch, 30. November 2016 06:30:41 UTC+1 schrieb Akshay Gahlot: > > I want to use for PWM generation to control servo motor. The problem i m > facing is : > > To enable libpruio i m using this dts file > > https://github.com/jadonk/cape-firmware/blob/master/arch/arm/boot/dts/BB-BONE-PRU-01-00A0.dts > > To enable the pwm pin i m using cape-universaln > > https://github.com/cdsteinkuehler/beaglebone-universal-io/blob/master/cape-universaln-00A0.dts > > These both files are kind of conflicting with each other as if one is > loaded to slots then other is not loading. > AFAIR cape-universal enables all subsystems, including the PRUSS. So you don't need BB-BONE-PRU-01. > > If i do not load the cape-universaln i m not able to export the pwm pins. > You need not export any pins when using libpruio. Just disable cape-universaln and load libpruio overlay instead. This has the same pinmuxing capabilities and will enable the PRUSS (just PRUSS, not all the other subsystems, in order to save power). For testing and in the development phase, you run your application with sudo (for pinmuxing). When finished, separate the configuration part from your source, add a line 'io->Init = io->Conf' after configuration and before deleting the libpruio instance, and compile it, in order to execute it in system init (for fixed pinmuxing). Then your app can run without root privileges. (Or use dts_custom.bas to create your customized device tree.) Regards PS: Recent images don't support libpruio at all. libpruio-0.2.2 is designed for kernel 3.8. It needs adaption for newer kernel versions. In kernel 4.x, PWMSS->ehrPWM generated PWM signals don't work. So it's best to stay with the latest 3.8 for now. -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/52c53d80-cad0-446a-bd4d-576e1d160590%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[beagleboard] Re: PWM generation using libpruio
Hi! Am Mittwoch, 30. November 2016 06:30:41 UTC+1 schrieb Akshay Gahlot: > > I want to use for PWM generation to control servo motor. The problem i m > facing is : > > To enable libpruio i m using this dts file > > https://github.com/jadonk/cape-firmware/blob/master/arch/arm/boot/dts/BB-BONE-PRU-01-00A0.dts > > To enable the pwm pin i m using cape-universaln > > https://github.com/cdsteinkuehler/beaglebone-universal-io/blob/master/cape-universaln-00A0.dts > > These both files are kind of conflicting with each other as if one is > loaded to slots then other is not loading. > AFAIR cape-universal enables all subsystems, including the PRUSS. So you don't need BB-BONE-PRU-01. > > If i do not load the cape-universaln i m not able to export the pwm pins. > You need not export any pins when using libpruio. Just disable cape-universaln and load libpruio overlay instead. This will enable the PRUSS (just PRUSS, not all the other subsystems, in order to save power) and also handle the pinmuxing. For testing and in the development phase, you run your application with sudo (for pinmuxing). When finished, separate the configuration part from your source and compile it, in order to execute in system init (for fixed pinmuxing). then your app can with root privileges. Regards PS: Recent images don't support libpruio at all. libpruio-0.2.2 is designed for kernel 3.8. It needs adaption for newer kernel versions. In kernel 4.x, PWMSS->ehrPWM generated PWM signals don't work. So it's best to stay with the latest 3.8 for now. -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/9d827aea-5abb-42da-910b-219fa6daf53f%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[beagleboard] Re: PWM generation using libpruio
Are you using a recent Beagleboard image? Beaglebone? I haven't used libpruio, but I assume it uses the UIO kernel driver. First, you will need to activate that driver. This utility will help get it done: https://github.com/RobertCNelson/dtb-rebuilder You will need to clone the above to your board and make 2 very easy changes to text files. Then you have to run the script in the above and re-boot. Can perhaps guide you but need to know which kernel and which board you are using. I didn't have to do anything to the Device tree for Remoteproc and PWM. Hopefully the same will be true for UIO. Regarding the PWM, once again, have to assume you are using a recent Debian image. The version 4 kernels require some steps to get the PWM exported. I did this just a few days ago, and got it to work. You need to look for: /sys/class/pwm/pwmchip0 You need to export by something like: echo 0 > export Or it could be other numbers depending on which PWM. I haven't found a concise reference for the above process, and how the export number maps to the particular PWM. Perhaps someone else can point us to a good reference guide for this process. Greg -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/e4f692e6-e939-46fc-8dc8-93fc4c6e828d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.