Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 18:47:13 alex joni: i have an encoder on my z axis and its hooked up to my breakout board with a and b channel,is there a place on the wiki that deals with adding an encoder
- 18:47:29 wanting to get ferror
- 18:48:02 jlmjvm: search the configs for the component encoder
- 18:48:17 you need to loadrt encoder num_chan=1 (if my memory serves me right)
- 18:48:32 then add the 2 functions of encoder to base_thread and to servo_thread
- 18:48:40 you need to get the scale right
- 18:48:59 and the output from encoder needs to get connected to the axis feedback position
- 18:51:37 configs?do you mean where the hal and ini file is?dont have encoder component in my configs,
- 18:52:15 may not be looking in the right place
- 18:54:31 jlmjvm: look at the etch-servo hal for a starting point for setting up the encoder module
- 18:54:43 will do
- 18:57:50 looks like what i need to get started,thanks
- 19:24:25 heres my hal file,crashes when emc starts
- 19:24:30 http://pastebin.ca/694392
- 19:25:33 im only using 1 encoder right now,and the a and b pins are right
- 19:25:43 uh what's the error?
- 19:26:03 HAL:20:error message here
- 19:26:06 (20 is the line number)
- 19:26:30 want me to paste error msg
- 19:26:36 encoder.2 is wrong
- 19:26:42 you need encoder.0
- 19:26:55 and loadrt encoder num_chan=1 is enough for now
- 19:27:24 if you want encoder.2.* then you need num_chan=3 (0,1 and 2)
- 19:27:59 my z axis is number 2
- 19:28:09 encoder on z axis
- 19:31:43 jlmjvm: 'Z axis' doesn't mean you automatically put .2. everywhere
- 19:32:07 jlmjvm: in this case, this is the first and only thing you are hooking up to 'encoder', so you use encoder.0
- 19:32:34 just tried it with 0
- 19:33:01 still no go
- 19:33:13 yeah but the error is almost certainly different now :-P
- 19:33:27 prolly so
- 19:33:42 want me to post it
- 19:34:26 well that's the only way anybody here is going to be able to help you
- 19:47:37 http://pastebin.ca/694421,thats the changes i made
- 19:47:59 how do you send an error,cant copy
- 19:53:59 jlmjvm: start emc from a terminal
- 19:54:06 then you can select and copy the error
- 19:54:36 jlmjvm: but the error is probably :
- 19:54:42 newsig Zpos-fb float
- 19:54:46 ahhh
- 19:54:47 that one should already be defined
- 19:55:04 jlmjvm: the linksp should be enough
- 19:55:36 adam2: http://groups.yahoo.com/group/CAD_CAM_EDM_DRO/
- 20:04:51 http://pastebin.ca/694451
- 20:05:01 finally got the error msg
- 20:05:31 jlmjvm: don't see the actual error
- 20:06:22 k,on the way,that was the dmesg
- 20:09:04 http://pastebin.ca/694459
- 20:09:15 that should be the error
- 20:09:46 jlmjvm: I already told you that you need to remove the newsig
- 20:10:18 gives another error when i did
- 20:10:39 jlmjvm: what's the error?
- 20:10:42 already has a writer?
- 20:11:17 lemme remove the newsig and resend error
- 20:11:26 jlmjvm: no need
- 20:11:31 remove the newsig
- 20:11:38 then open core_stepper.hal in the same dir
- 20:11:46 and look for the following line 'linksp Zpos-fb <= stepgen.2.position-fb
- 20:11:53 and comment that line out
- 20:13:36 k,will give it a try
- 20:15:06 your going to have to scale the encoder module correctly to work correctly with you input scale
- 20:16:01 I think I could have squeezed another 'correctly' into that sentence
- 20:16:40 that worked
- 20:17:20 emc came on and if i turn the motor the numbers change
- 20:17:28 Sweet
- 20:17:31 motor poer is off
- 20:17:36 power
- 20:17:54 where do i set the cpr amount at?
- 20:18:18 1024cpr quadrature
- 20:18:27 20480 counts per inch
- 20:21:33 scale I think
- 20:22:09 it's up to you actually
- 20:22:10 setp encoder.0.position-scale
- 20:22:21 you can stick a line like that in the .hal file
- 20:22:22 setp encoder.0.position-scale 20480
- 20:22:40 you can use any name you want in the ini file, and reference that in the .hal file
- 20:22:44 I ment scale pin on the encoder.
- 20:22:48 yes
- 20:23:01 so setp encoder...scale 20480 is one way
- 20:23:03 SWPadnos: he is doing steppers with encoders.
- 20:23:08 rigth
- 20:23:10 right
- 20:23:19 right
- 20:23:30 so he has the scale in the ini for the stepper which will be different than his encoder scale.
- 20:23:42 * skunkworks is thinking out loud
- 20:23:45 you can add any variables you want to the ini, and reference tem in the HAL file, so it really depends on how you want to set it up
- 20:23:55 really - cool
- 20:24:03 so you can add a section called [MY_STEPPER_ENCODER_FEEDBACK]
- 20:24:04 really? - cool
- 20:24:29 and a variable in it called THE_NUMBER_OF_COUNTS_PER_INCH_ON_THE_X_AXIS
- 20:24:45 so add that setp line to my hal file?
- 20:25:01 and you can set that by using "setp encoder.0.scale [MY_STEPPER_ENCODER_FEEDBACK]THE_NUMBER_OF_COUNTS_PER_INCH_ON_THE_X_AXIS" in the hal file
- 20:25:08 setp encoder.0.position-scale 20480
- 20:25:21 that'll work too, of course
- 20:30:16 hmm - wasn't there an issue with the stepgen with using encoders as feedback - like it doesn't reset it position to the 'encoders' position after an estop or something like that?
- 20:30:22 changed the hal file,still have joint error,was i supposed to put something in the ini file also?
- 20:30:48 what is the error? following error?
- 20:30:55 yep
- 20:31:19 encoder is doing its job already
- 20:32:18 with it off - does the readout count correctly? like 20 turns equal an inch on the readout?
- 20:32:35 are they going in the same direction?
- 20:32:39 i can check
- 20:33:40 SWPadnos: did you read what I wrote above about stepgen?
- 20:33:58 yes. that could be a problem, I don't know
- 20:38:34 counting correctly
- 20:41:26 jlmjvm: so the second you turn the machine on - you get a following error - or is it when you start to move?
- 20:42:05 when i start to move
- 20:42:18 so when you start to jog - it will error?
- 20:42:24 yes
- 20:42:27 I would negate the scale on the encoder
- 20:42:51 jlmjvm, you may need to fiddle with the stepgen accel and vel limits
- 20:43:11 setp encoder.0.position-scale -20480 - or does it count the right direction?
- 20:43:11 or use halscope to display what is happening with commanded & feedback positions during the short time you try to move -- that will give you a better idea what is going on
- 20:43:40 jepler: what? systematic aproach? bah
- 20:43:41 yes
- 20:43:41
- 20:44:40 jlmjvm: yes what?
- 20:44:57 yes its reading the right way
- 20:45:25 ah - ok. Jepler really has the correct way to see what is going on. use halscope.
- 20:45:32 and my rapids are slow right now,60 ipm
- 20:45:47 try moving much much slower than that
- 20:45:49 what if you jog slow - like 1ipm or such
- 20:45:56 same thing
- 20:46:04 tried that
- 20:46:13 use MDI to do something like G1X1F10
- 20:46:46 was doing this same thing yesterday on mach and it could read at 100 ipm
- 20:46:48 jlmjvm: what is your following errir set to in the ini?
- 20:46:57 lemmee see
- 20:47:56 ferror=.050 minferror=.010
- 20:48:19 I would think that would be more than enough.
- 20:48:28 ferror that is.
- 20:48:37 jlmjvm, you have a setup error, and you'll need to use the diagnostic tools to figure out what that error is
- 20:49:04 halscope is probably the best tool at the moment, because at the moment, nobody knows exactly what's going on
- 20:49:18 and without knowing what's happening, it's hard to fix it
- 20:49:58 wasnt i supposed to add something to the ini file to point to the encoder scale?
- 20:50:07 jlmjvm, not necessary
- 20:50:20 but you should make sure the scale is correct before going on
- 20:50:38 it seems by your account - it is working correctly - 20 turns of the leadscrew is 1 inch.
- 20:50:47 in the display
- 20:50:59 ie, manually turn the motor shaft/screw to move the table 1 inch, and verify that the display shows 1 inch of movement
- 20:51:21 its doing that
- 20:51:29 does it go the right way?
- 20:51:32 yes
- 20:51:47 ok, and if you don't use the encoder feedback, but use the stepgen feedback, can you jog?
- 20:51:57 and when you do that, does it jog in the correct direction?
- 20:52:19 yes,was moving it yesterday
- 20:52:20 you can experiment a little by setting ferror very large - like 1 inch
- 20:53:08 are you sure software counting can keep up with your encoder rate?
- 20:53:10 will try,but was i supposed to add something to the ini file?
- 20:53:13 just to be sure, you are exiting from EMC and restarting every time you change anything in the hal or ini files, right?
- 20:53:25 yes
- 20:53:33 ok - just had to check
- 20:53:38 no prob
- 20:53:43 jlmjvm: no, you did not need to modify the .ini file if you put the encoder scale explicitly in the .hal file
- 20:53:53 you have the option of using an ini file setting for the scale (or anything else), but it's not required to use one
- 20:53:53 k
- 20:54:10 just wanted to make sure
- 20:54:23 lemmee open up the ferror setting
- 20:55:54 open up both of them.
- 21:01:38 its working
- 21:01:56 some big dummy had the pins backwards
- 21:02:16 heh
- 21:02:32 i swear when the power was off the motors it was reading right
- 21:02:47 it has to be right, and also it has to match the motor
- 21:03:00 it's more important for it to match the motor
- 21:03:11 (as far as following errors go)
- 21:03:14 swapped the a and b pin # and its working
- 21:03:30 ok. you could also have negated the scale as skunkworks suggested
- 21:03:37 jlmjvm: negating the encoder scale I think would have done the same thing..
- 21:03:38
- 21:04:01 * skunkworks thinks now jlmjvm should now play with adaptive feed controll....
- 21:04:28 lets rock n roll,lol
- 21:04:34 * SWPadnos thinkd skunkworks needs to take his meds
- 21:04:41 err - thinks
- 21:04:43 i really appreciate the help from everyone
- 21:05:06 any time. just remember to put it on the wiki if you discover anything major about steppers+encoders
- 21:05:15 jlmjvm: you really need to post this on cnczone. This is always brought up.
- 21:05:16 im the only guy on the block with encoders on his steppers
- 21:05:25 really
- 21:05:42
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement