Nucleo F411RE How read encoder with 0.005mm step? #7190
Replies: 1 comment
-
Posted at 2017-10-15 by @yerpj Could you share your current code? Posted at 2017-10-15 by user78121
Posted at 2017-10-16 by Wilberforce If you take out the print it would probably keep up- you could add 1 sec timeout and print the value of step there rather than every time it changes. The uart output is your bottleneck here. Posted at 2017-10-16 by @yerpj as well as maybe the allocation of variables Posted at 2017-10-16 by @allObjects I'm not sure that allocating variables globally is of help since locals are searched first when interpreting the code... if of course depends on how many other locals and globals are around. I understand where the though is coming from: allocation and deallocation work can may be skipped... on the other hand for instance garbage collection, any reference in a scope does something when 'entering and leaving' the scope... may be it is less of housekeeping. Posted at 2017-10-17 by @gfwilliams Yes, the allocation won't be a big issue - in fact the current solution is probably best. Since you're only actually doing stuff if
or for superfast:
As has been said, at anything over 100/sec the prints will probably cause problems and personally I probably wouldn't trust even the above much above 4000/sec. For 200kHz you're better off seeing if you can set up the STM32's built in hardware timers to do it for you - I'm pretty sure I've read that they can be set to work with encoders. Posted at 2017-10-19 by user78121 Thank you guys. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-10-15 by user78121
Hi. I am new in Espruino and JS.
I have linear encoder with 0.005mm step.
When I move encoder slow. It is about 1Khz for channel.
All is fine. Program make count.
But I need more faster works. It is about 200Hhz for channel. It will 1000mm/sec.
Program don`t see steps when move with 1000mm/sec.
Can you give advice?
Beta Was this translation helpful? Give feedback.
All reactions