Bipod setup
- dab77
- Offline
- Elite Member
-
- Posts: 194
- Thank you received: 2
loadrt dab_bipodkins
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
loadrt probe_parport
loadrt hal_parport cfg="0x378 out "
setp parport.0.reset-time 5000
loadrt stepgen step_type=0,0,0
addf parport.0.read base-thread
addf stepgen.make-pulses base-thread
addf parport.0.write base-thread
addf parport.0.reset base-thread
addf stepgen.capture-position servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf stepgen.update-freq servo-thread
net spindle-cmd <= motion.spindle-speed-out
net xdir => parport.0.pin-01-out
net zstep => parport.0.pin-03-out
setp parport.0.pin-03-out-reset 1
net xenable => parport.0.pin-04-out
net zenable => parport.0.pin-05-out
net zdir => parport.0.pin-06-out
net ydir => parport.0.pin-07-out
setp parport.0.pin-07-out-invert 1
net adir => parport.0.pin-08-out
net astep => parport.0.pin-09-out
setp parport.0.pin-09-out-reset 1
net ystep => parport.0.pin-14-out
setp parport.0.pin-14-out-reset 1
net xstep => parport.0.pin-16-out
setp parport.0.pin-16-out-reset 1
net yenable => parport.0.pin-17-out
setp stepgen.0.position-scale [AXIS_0]SCALE
setp stepgen.0.steplen 1
setp stepgen.0.stepspace 0
setp stepgen.0.dirhold 35000
setp stepgen.0.dirsetup 35000
setp stepgen.0.maxaccel [AXIS_0]STEPGEN_MAXACCEL
net xpos-cmd axis.0.motor-pos-cmd => stepgen.0.position-cmd
net xpos-fb stepgen.0.position-fb => axis.0.motor-pos-fb
net xstep <= stepgen.0.step
net xdir <= stepgen.0.dir
net xenable axis.0.amp-enable-out => stepgen.0.enable
setp stepgen.1.position-scale [AXIS_1]SCALE
setp stepgen.1.steplen 1
setp stepgen.1.stepspace 0
setp stepgen.1.dirhold 35000
setp stepgen.1.dirsetup 35000
setp stepgen.1.maxaccel [AXIS_1]STEPGEN_MAXACCEL
net ypos-cmd axis.1.motor-pos-cmd => stepgen.1.position-cmd
net ypos-fb stepgen.1.position-fb => axis.1.motor-pos-fb
net ystep <= stepgen.1.step
net ydir <= stepgen.1.dir
net yenable axis.1.amp-enable-out => stepgen.1.enable
setp stepgen.2.position-scale [AXIS_2]SCALE
setp stepgen.2.steplen 1
setp stepgen.2.stepspace 0
setp stepgen.2.dirhold 35000
setp stepgen.2.dirsetup 35000
setp stepgen.2.maxaccel [AXIS_2]STEPGEN_MAXACCEL
net zpos-cmd axis.2.motor-pos-cmd => stepgen.2.position-cmd
net zpos-fb stepgen.2.position-fb => axis.2.motor-pos-fb
net zstep <= stepgen.2.step
net zdir <= stepgen.2.dir
net zenable axis.2.amp-enable-out => stepgen.2.enable
net estop-out <= iocontrol.0.user-enable-out
net estop-out => iocontrol.0.emc-enable-in
i have the feedback lines for every axis. the file was done by stepconf wizard. i just added the yenable and zenable needed by my driver.
Please Log in or Create an account to join the conversation.
- andypugh
-
- Offline
- Moderator
-
- Posts: 23377
- Thank you received: 4966
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
i have the feedback lines for every axis. the file was done by stepconf wizard. i just added the yenable and zenable needed by my driver.
What are the servo period and base period (in the INI file)? In fact, can you post the INI file?
What actually happens? I am not clear from the dmesg stuff you have posted if you get a following error and EMC2 stops and unloads itself, or whether you get a following error and then you are quitting EMC2.
What does Halscope show you for the pos-cmd, pos-fb and f-error pins?
Please Log in or Create an account to join the conversation.
- dab77
- Offline
- Elite Member
-
- Posts: 194
- Thank you received: 2
Please Log in or Create an account to join the conversation.
- andypugh
-
- Offline
- Moderator
-
- Posts: 23377
- Thank you received: 4966
You can apply an offset to the -cmd and -fb channels (the button at the bottom of the scale slider) which will then let you decrease the scale while keeping the traces on the screen.
However, I think I can see a change in the -cmd value, but not in the -fb value..
Please Log in or Create an account to join the conversation.
- dab77
- Offline
- Elite Member
-
- Posts: 194
- Thank you received: 2
Please Log in or Create an account to join the conversation.
- andypugh
-
- Offline
- Moderator
-
- Posts: 23377
- Thank you received: 4966
This is nothing to do with the kinematics module. (but to test that you should perhaps re-test with the original, unmodified trivkins kinematics module, if you still have it)
Another possibility is that the combination of base-period length, step-per rev and axis-scale is much lower than the max velocity of the axes.
Please Log in or Create an account to join the conversation.
- dab77
- Offline
- Elite Member
-
- Posts: 194
- Thank you received: 2
kind of my newbie fault.

with a very low speed it works!
before i left for each motor a good speed, which was 600mm/s.
i had to set it to 50mm/s to make it work without errors...
now i have a big noise coming from my motors (nema23-3A...chinese...)with low speed, but i'm going to play a bit with microstepping. now working with 1/2.
thanks again!
if you have any other suggestions, you're welcome!
cheers, dab.
Please Log in or Create an account to join the conversation.
- andypugh
-
- Offline
- Moderator
-
- Posts: 23377
- Thank you received: 4966
Please Log in or Create an account to join the conversation.
- dab77
- Offline
- Elite Member
-
- Posts: 194
- Thank you received: 2
that's my .ini:
[EMC]
MACHINE = Prova_Bipod
DEBUG = 0x7FFFFFFF
[DISPLAY]
DISPLAY = axis
EDITOR = gedit
POSITION_OFFSET = RELATIVE
POSITION_FEEDBACK = ACTUAL
MAX_FEED_OVERRIDE = 1.2
INTRO_GRAPHIC = emc2.gif
INTRO_TIME = 2
PROGRAM_PREFIX = /home/dab-cnc/emc2/nc_files/bipod
INCREMENTS = 50mm 10mm 5mm 1mm .5mm .1mm .05mm
[FILTER]
PROGRAM_EXTENSION = .png,.gif,.jpg Greyscale Depth Image
PROGRAM_EXTENSION = .py Python Script
png = image-to-gcode
gif = image-to-gcode
jpg = image-to-gcode
py = python
[TASK]
TASK = milltask
CYCLE_TIME = 0.010
[RS274NGC]
PARAMETER_FILE = emc.var
[EMCMOT]
EMCMOT = motmod
COMM_TIMEOUT = 1.0
COMM_WAIT = 0.010
BASE_PERIOD = 100000
SERVO_PERIOD = 1000000
[HAL]
HALFILE = Prova_Bipod.hal
HALFILE = custom.hal
POSTGUI_HALFILE = custom_postgui.hal
[TRAJ]
AXES = 3
COORDINATES = X Y Z
LINEAR_UNITS = mm
ANGULAR_UNITS = degree
CYCLE_TIME = 0.010
DEFAULT_VELOCITY = 50.00
MAX_LINEAR_VELOCITY = 1800.00
[EMCIO]
EMCIO = io
CYCLE_TIME = 0.100
TOOL_TABLE = tool.tbl
[AXIS_0]
TYPE = LINEAR
HOME = 0.0
MAX_VELOCITY = 1800.0
MAX_ACCELERATION = 3000.0
STEPGEN_MAXACCEL = 3750.0
SCALE = 5.19953204212
FERROR = 1.0
MIN_FERROR = 1.0
MIN_LIMIT = -2000.0
MAX_LIMIT = 2000.0
HOME_OFFSET = 0.0
[AXIS_1]
TYPE = LINEAR
HOME = 0.0
MAX_VELOCITY = 1800.0
MAX_ACCELERATION = 3000.0
STEPGEN_MAXACCEL = 3750.0
SCALE = 5.19953204212
FERROR = 1.0
MIN_FERROR = 1.0
MIN_LIMIT = -2000.0
MAX_LIMIT = 2000.0
HOME_OFFSET = 0.0
[AXIS_2]
TYPE = LINEAR
HOME = 0.0
MAX_VELOCITY = 1800.0
MAX_ACCELERATION = 3000.0
STEPGEN_MAXACCEL = 3750.0
SCALE = 5.19953204212
FERROR = 1.0
MIN_FERROR = 1.0
MIN_LIMIT = -2000.0
MAX_LIMIT = 2000.0
HOME_OFFSET = 0.0
50 mm/s is the max vel i can jog in world mode... ...but, if i run the example text path, the 'not-cutting-movements' are done correctly at max vel what i think is 1800mm/s. am i right?
Please Log in or Create an account to join the conversation.
- andypugh
-
- Offline
- Moderator
-
- Posts: 23377
- Thank you received: 4966
BASE_PERIOD = 100000
SERVO_PERIOD = 1000000
[AXIS_0]
MAX_VELOCITY = 1800.0
MAX_ACCELERATION = 3000.0
STEPGEN_MAXACCEL = 3750.0
SCALE = 5.19953204212
FERROR = 1.0
MIN_FERROR = 1.0
You do have a rather slow base thread.
Looking at the numbers:
A max velocity of 1800mm/sec and a scale of 5.2 means a max pulse rate of 9360Hz
A Base period of 100,000 nS means that the stepgen runs at a max of 10kHz (assuming that Reset is active, which I think it is, otherwise it is 5kHz)
So, it is not exactly what I thought the problem was, but bear in mind that any increase in your microstep level will halve your top speed. Also not that at the moment at high speed the stepgen has a choice of 1800mm/sec, 900mm/sec, 600mm/sec, 450mm/sec etc. These big jumps are likely to lead to motor stalling problems.
Is your latency really so bad that you need a 100000nS base period? Generally anything worse than 50000 means that the computer is not really suitable for RT work (and <20000 is desirable)
Assuming a 200 step motor and half microstepping, you seem to be asking the motors to run at 1500rpm at the top end, this is rather fast for a stepper, especially when you are asking it to jump from 750 to 1500 rpm instantaneously due to the limited step resolution.
As an experiment, though, try increasing the accellerations by a factor of 5 and see what happens.
Please Log in or Create an account to join the conversation.