Looks like an interesting project. File system access is likely to be far too slow for what you are trying to do. The strength of machinekit (and it's predecessor LinuxCNC) is the HAL layer of device drivers and control blocks. That is a much faster way to access the hardware.
Choosing the beaglebone might be putting the cart before the horse. As I understand it your controlled variable is force. What are you using as an actuator? Stepper motors are position control devices and unsuitable. Brush-type permanent magnet DC motors probably have the simplest mapping from electrical parameter (armature current) to force (torque). Next, what are you using as a driver? PWMed H-bridges control the average voltage across the motor, which has inductance and resistance. You would need to sense current and close a current loop to control current. Some motor drivers do the current loop in analog hardware, or you could do the current loop digitally. (Would need high bandwidth.) What kind of control signals does your driver expect? PWM for a bridge? Analog (+/-10V, 0-5V, etc) for reference to an analog current loop? What kind of feedback signals are you going to have? Analog current feedback? Analog or resolver or absolute encoder or incremental encoder for pendulum angles? The nature of the required control and feedback signals will drive your choice of control platform. Regards, John Kasunich On Wed, Sep 14, 2016, at 12:20 PM, 'Luke Steele' via Machinekit wrote: > Hello, > > I should probably explain that I'm a linux and BBB novice, and am currently > experiencing a crazily steep learning curve. So please bear with me while I > ask what are probably incredibly rudimentary questions... > > I'm interested in doing some realtime control (servos, reading encoders > etc) on my BBB rev C under Xenomai, and after some reading around it seemed > like the simplest way to get started was using the pre-built machinekit > images found > here: > http://elinux.org/Beagleboard:BeagleBoneBlack_Debian#BBW.2FBBB_.28All_Revs.29_Machinekit > > So, having installed this image I can now ssh into the BBB from a Xubuntu > install running under VMware on my PC. > > I thought a good place to start would be blinking an LED. To that end I've > compiled the C++ program here > <http://inspire.logicsupply.com/2014/07/beaglebone-c-programming-example.html>, > > which works (only) if I use sudo, i.e. sudo ./myprog. I've also tried > turning them on and off at the command line as outlined on Derek Molloy's > site > <http://derekmolloy.ie/beaglebone-controlling-the-on-board-leds-using-c/>, > but this doesn't work: > > cd /sys/class/leds > cd beaglebone:green:usr0 > echo none > trigger > > -bash: trigger: Permission denied > > sudo echo none > trigger doesn't work either... > > What am I doing wrong? > > Also more generally, is this approach of accessing LEDs and GPIOs through > the file system the right way to go if I'm interested in doing things > quickly? Intuitively it feels like it'd be slow - is there another way? > > Incidentally this <https://hackaday.io/project/12827-double-pendulum-cart> > is what I'm aiming to do eventually. > > Thanks for any help, it's appreciated! > > Luke > > > -- > 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 [email protected]. > Visit this group at https://groups.google.com/group/machinekit. > For more options, visit https://groups.google.com/d/optout. -- John Kasunich [email protected] -- 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 [email protected]. Visit this group at https://groups.google.com/group/machinekit. For more options, visit https://groups.google.com/d/optout.
