Go to advanced search

by davenull
Sun Nov 08, 2015 1:19 pm
Forum: C/C++
Topic: About encoder output "jump"
Replies: 76
Views: 10791

Re: About encoder output "jump"

no pwm pins, no dir pins, and no encoder pins left on the Arduino any more, everything already in use.
( 2 motors = 2 pwm pins plus 4 encoder pins plus 4 regular digital pins)

and then for odometry the data transfer is to slow.

(edited)
by davenull
Sun Nov 08, 2015 1:13 pm
Forum: C/C++
Topic: About encoder output "jump"
Replies: 76
Views: 10791

Re: About encoder output "jump"

yes, that's what I meant to say: the Arduino just gets "high level commands" from the Raspi for all over 6 motors: on/off, fwd/reverse by pwm, rotate relative degrees, rotate to encoder target and then stop, optionally then coast, optionally then hold position, the rest of the functionality is alrea...
by davenull
Sun Nov 08, 2015 12:59 pm
Forum: C/C++
Topic: About encoder output "jump"
Replies: 76
Views: 10791

Re: About encoder output "jump"

ps, the problem for external hardware controllers is: I ALWAYS need to have the values all at once for further processing on the related computing platform, e.g., for odometric position calculation (drive wheel motors) or for quick PID loops for exact and quick robot arm positioning. 6 motors on the...
by davenull
Sun Nov 08, 2015 12:19 pm
Forum: C/C++
Topic: About encoder output "jump"
Replies: 76
Views: 10791

Re: About encoder output "jump"

I tried already, but the Arduino code is designed for timer interrupts (at 50µs, 100µs, or 250µs intervals) and this polls all pins at constant intervals using sort of bit and-ing/shifting algorithm. I tried to mimic that on my Raspi by a constant time loop in an extra pthread task, but too many cou...
by davenull
Sun Nov 08, 2015 11:31 am
Forum: C/C++
Topic: About encoder output "jump"
Replies: 76
Views: 10791

Re: About encoder output "jump"

to be honest, I don't see through this code, it's a little (actually quite) confusing to me. I need just the encoder reading and calculation in the background or by 1 dedicated pthread task, and then an extra task or loop in main() which displays the values on the screen like for (;;) { if (counter ...
by davenull
Sun Nov 08, 2015 11:25 am
Forum: C/C++
Topic: About encoder output "jump"
Replies: 76
Views: 10791

Re: About encoder output "jump"

thank you very much, I'll try then this one next! // encoder.c // Test code for incremental rotary encoder on Raspberry Pi //tested on B R2 Linux raspberrypi 3.10.25+ #622 PREEMPT Fri Jan 3 18:41:00 GMT 2014 armv6l GNU/Linux // http://www.sparkfun.com/products/10982 // No licence, no warranty, free ...
by davenull
Sun Nov 08, 2015 11:21 am
Forum: C/C++
Topic: About encoder output "jump"
Replies: 76
Views: 10791

Re: About encoder output "jump"

thanks for your input. Of course I see that that a Raspi has severe performance problems to handle this, but 360/rev for 2-3 motors is indispensible to use the Raspi at all. ( I am controlling another 6 encoder motors already remotely by an attached DUE via UART, aditionally, but there are all over ...
by davenull
Sun Nov 08, 2015 10:28 am
Forum: C/C++
Topic: About encoder output "jump"
Replies: 76
Views: 10791

Re: About encoder output "jump"

I have optical encoders, there are no significant bouncings at all (you perhaps missed that detail), and on Arduino I can read up to (tested) 7*720 = 5000 encoder counts per second , by double resolution (7 revolutions at 720 counts/revolution, per 1 sec), for all over 8 encoder motors simultaneousl...
by davenull
Sun Nov 08, 2015 10:17 am
Forum: C/C++
Topic: About encoder output "jump"
Replies: 76
Views: 10791

Re: About encoder output "jump"

thanks for your input! so what would you suggest for 360° (1/2) instead of 180° (1/4) resolution which would work perfectly then (360 counts for 1 rev for calculating is accurate enough and makes calculations easier for odometry as 1 encoder count == 1 dregree, not 2 degrees, and not 0.5 degrees in ...
by davenull
Sun Nov 08, 2015 10:01 am
Forum: C/C++
Topic: how to AND a variable by bit coded values (e.g. B00001100) ?
Replies: 19
Views: 4252

Re: how to AND a variable by bit coded values (e.g. B0000110

Davenull, I have received several complaints about your behavior, do I have to close this thread too? please behave better! you seem to act as that what you claim to hate! I'm just reacting to OT spamming and trolling posts, and I have already reported the spam and troll posts to be removed. Anyway...
by davenull
Sun Nov 08, 2015 9:52 am
Forum: C/C++
Topic: About encoder output "jump"
Replies: 76
Views: 10791

Re: About encoder output "jump"

(edited:) yes, I am, and yes, it's an optical encoder. I removed the debounce and now it's counting about 180° per revolution, not 360° , but even for quicker rotations, mostly accurate, but NOT for higher speed at >=3 rev. /sec. . If so for faster rotations, then again counter ticks are missing. ac...
by davenull
Sun Nov 08, 2015 9:23 am
Forum: C/C++
Topic: About encoder output "jump"
Replies: 76
Views: 10791

Re: About encoder output "jump"

thank you Gordon, I tried that immediatly, but it's also counting not quick enough. By your coding, for a whole revolution at 1° resolution instead of 360° now just 220° can be detected, even at a very slow rotation speed (1 revol./sec) , which is even less than by my pthread and bitshifting approac...
by davenull
Sun Nov 08, 2015 9:11 am
Forum: C/C++
Topic: memset problem
Replies: 8
Views: 1981

Re: memset problem

yes, thank you, the volatile thing once was established during a longer development period from my first attempts of Arduino codings (which also are gpp C/C++ based nevertheless, and on that platform everything compiled fine). Perhaps, apearently, it's outdated and obsolete now. FTM I just exchanged...
by davenull
Sun Nov 08, 2015 8:55 am
Forum: C/C++
Topic: pthread questions
Replies: 30
Views: 8139

Re: pthread questions

excellent, now I can start working with this information!

many thanks, Andy, and again, also to Paeryn!
by davenull
Sun Nov 08, 2015 8:50 am
Forum: C/C++
Topic: how to AND a variable by bit coded values (e.g. B00001100) ?
Replies: 19
Views: 4252

Re: how to AND a variable by bit coded values (e.g. B0000110

in short words, yes, I have tons of code written for Arduino Sketch targeting both AVR (Uno, Mega) and ARM cpus (Due, partially Zero) and the Arduino language plus it's 3rd party libs are partially designed peculiarly quite strange. Finally Arduino language IS not C but USES C, by gpp C/C++ and a lo...
by davenull
Sun Nov 08, 2015 8:34 am
Forum: C/C++
Topic: pthread questions
Replies: 30
Views: 8139

Re: pthread questions

thank you, Paeryn, that was very helpful, especially about -pthread and -lpthread. The other references are more complicated than I expected them to be but at least give me a guidance to keywords I have to look at more closely, maybe I will then see more clear. Finally for me as a former programmer ...
by davenull
Sun Nov 08, 2015 8:22 am
Forum: OpenVG
Topic: additional font types for openvg C/C++ ?
Replies: 14
Views: 3790

Re: additional font types for openvg C/C++ ?

could you pleasee be a more specific and detailed about your references?
by davenull
Sat Nov 07, 2015 6:31 pm
Forum: General discussion
Topic: Why some microSD cards can run raspbian while others can't?
Replies: 26
Views: 3334

Re: Why some microSD cards can run raspbian while others can

how big?

IIRC, at least 8GB are recommended for Raspbian, better 16GB (CMIIW)
by davenull
Sat Nov 07, 2015 6:16 pm
Forum: C/C++
Topic: pthread questions
Replies: 30
Views: 8139

Re: pthread questions

thanks, but first I need quick answers to my 3 simple question, this could not be so hard, is it?
by davenull
Sat Nov 07, 2015 5:09 pm
Forum: C/C++
Topic: About encoder output "jump"
Replies: 76
Views: 10791

Re: About encoder output "jump"

now this code seperating the pin reading task from the values screen-writing task is still too slow. When 360° should have been read, it's just < 300. using usleep(20) instead of 50 doesn't make it better. // encoder test // #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <math.h...
by davenull
Sat Nov 07, 2015 5:06 pm
Forum: C/C++
Topic: how to AND a variable by bit coded values (e.g. B00001100) ?
Replies: 19
Views: 4252

Re: how to AND a variable by bit coded values (e.g. B0000110

please do it, the earlier, the better! you do not know how much I hate nitpickers, pedants, and sticklers ! (or perhaps you even do, but I don't care...) I keep stuck to what I said the binary thing is fine and I want to keep the code compatible to my Arduino code which works absolutely perfect and ...
by davenull
Sat Nov 07, 2015 4:25 pm
Forum: C/C++
Topic: pthread questions
Replies: 30
Views: 8139

Re: pthread questions

no ideas by anyone? I just needed the answers to the 3 questions (2-4), very quick, very short, and very simple, would this not be possible ? 2) is it useful to link by -D_REENTRANT additionally for Raspberry Pi? 3) how is it possible to immediately stop or kill 1 task by main() or by another task ?...
by davenull
Sat Nov 07, 2015 4:23 pm
Forum: C/C++
Topic: C/C++ crosscompiler on a Windows PC ?
Replies: 33
Views: 7778

Re: C/C++ crosscompiler on a Windows PC ?

for Arduino the cross compiler is as simple like a walk in the park, and even for the EV3 running TI daVinci Linux the BCC cross compiler is peanuts to work with, both running on Windows, both for compiling, linking, building, uploading, remotely start running, just by a 70ct USB cable... it's just ...
by davenull
Sat Nov 07, 2015 4:20 pm
Forum: C/C++
Topic: how to AND a variable by bit coded values (e.g. B00001100) ?
Replies: 19
Views: 4252

Re: how to AND a variable by bit coded values (e.g. B0000110

jamesh, to me just code compatibility to my own code was my demand, I didn't expect to be taught in a lecturing attitude - and didn't ask for that - about theoretical compatibilities or portabilities which do not affect me. I just wanted to make my Arduino code work by B00001100 or sth quite similar...
by davenull
Sat Nov 07, 2015 4:15 pm
Forum: C/C++
Topic: memset problem
Replies: 8
Views: 1981

Re: memset problem

hell, what a mess with C++
one should be able to configure this issue by compiler settings to ignore this nitpicking mess but instead making it work like for ANSI C and just compile, either with or without warning :( .

Go to advanced search