- Posts: 26
- Thank you received: 0
EMC2 running on Raspberry Pi?
May be a bit complicated, but it´is fast too and more peaceful to GPIO Control
I think MOSI (pin 10), MISO (9), SCLK (12) and more n GPIOs to SS (enable/disable) slave drivers.
Can you help me with the first steps: To change the control mechanism the LinuxCNC just compile - with-platform = X where X is the new HAL file? I am in doubt about the LinuxCNC API and the keys of configuration.
Ps: Great job with 3D printer
Please Log in to join the conversation.
ADBensi wrote: Hello Kinsa,
May be a bit complicated, but it´is fast too and more peaceful to GPIO Control
I think MOSI (pin 10), MISO (9), SCLK (12) and more n GPIOs to SS (enable/disable) slave drivers.
Can you help me with the first steps: To change the control mechanism the LinuxCNC just compile - with-platform = X where X is the new HAL file? I am in doubt about the LinuxCNC API and the keys of configuration.
Ps: Great job with 3D printer
Thanks!
I would prefer to minimize the usage of GPIO's so that the board could be easily used for other ARM boards.
For compiling LinuxCNC, the --with-platform switch only adds the built-in HAL drivers for that board. I've used the instructions here to build the latest LCNC.
It is easy to compile out-of-tree drivers using the comp command. Here's the example SPI driver for RPi: code.google.com/p/picnc/source/browse/#g...FHAL%2Ftest%20driver
I've moved over to plain C for the HAL driver as I have more control over the HAL pin naming.
Cheers!
Please Log in to join the conversation.
Cubieboard has a lib in C that can toggle a pin something about 1.5MHz. The idea is to understand what the LinuxCNC sends to pass to GPIO, and migrate to Cubieboard as similar option BEAGLEBONE or direct control of the SPI drivers with specific chip. I prefer the first condition because I already have Cubieboard and parallel drivers and it is not expensive and the whole assembly is flexible to changes.
Best Regards
Please Log in to join the conversation.
I created new hal in /usr/src/emc2-dev/configs but I not know how to load new hal in linuxcnc to try it. I saw many posts but I did not know how do. Please, it is possible to change only /usr/src/emc2-dev/configs/new or I miss anything? I'm starting with the idea that the platform is already compiled with the raspberry.
Best Regards,
Please Log in to join the conversation.
The correct dir is /usr/local/share/doc/linuxcnc/examples/sample-configs/. May be /usr/src/emc2-dev/configs/ is backup or others. Please Log in to join the conversation.
It varies even entering the parameters:
setp rpi_stepgen.0.steplen 2000
setp rpi_stepgen.0.stepspace 2000
setp rpi_stepgen.0.dirhold 800
setp rpi_stepgen.0.dirsetup 800
If you have investigated, please could tell if has experienced reduce the timer from 10MHz to 1MHZ to see if it improved resolution? Or may be timers erased, or frequency hight for sample:
min_step_period = rpi_stepgen->step_len + rpi_stepgen->step_space;
max_freq = 1.0 / (min_step_period * 0.000000001);
2000 + 2000 = 4000
1/(4000 * 0.000000001)
250 KHz
I would like to reduce speed to ensure accuracy. Suggests something?
Best Regards!
Please Log in to join the conversation.
Please Log in to join the conversation.
I am using rpi_stepgen.so with type 0
loadrt rpi_stepgen step_type=0,0,0 step_pins=30,28,22,10,11,9
addf rpi_stepgen.make-pulses servo-thread
addf rpi_stepgen.capture-position servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf rpi_stepgen.update-freq servo-thread
and
setp rpi_stepgen.0.steplen 2000
setp rpi_stepgen.0.stepspace 2000
setp rpi_stepgen.0.dirhold 800
setp rpi_stepgen.0.dirsetup 800
setp rpi_stepgen.1.steplen 2000
setp rpi_stepgen.1.stepspace 2000
setp rpi_stepgen.1.dirhold 800
setp rpi_stepgen.1.dirsetup 800
setp rpi_stepgen.2.steplen 2000
setp rpi_stepgen.2.stepspace 2000
setp rpi_stepgen.2.dirhold 800
setp rpi_stepgen.2.dirsetup 800
and
MAX_FEED_OVERRIDE = 0.2
BASE_PERIOD = 175000
SERVO_PERIOD = 1000000
and
[AXIS_0 1 2]
[AXIS_0 1 2]
[AXIS_0 1 2]
TYPE = LINEAR
HOME = 0.000
MAX_VELOCITY = 44.64
MAX_ACCELERATION = 20.0
STEPGEN_MAXACCEL = 21.0
BACKLASH = 0.000
SCALE = 4000
OUTPUT_SCALE = 1.000
MIN_LIMIT = -1000.0
MAX_LIMIT = 1000.0
FERROR = 1.7
MIN_FERROR = 1
HOME_OFFSET = 0.0
HOME_SEARCH_VEL = 0.0
HOME_LATCH_VEL = 0.0
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = NO
I forgot something?
Thanks a lot!
Please Log in to join the conversation.
ADBensi wrote: Hello!
I am using rpi_stepgen.so with type 0
Sorry but I'm not familiar with this HAL driver.
Please Log in to join the conversation.
