Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find correct sensor settings #1481

Closed
nofear87 opened this issue Jun 28, 2018 · 11 comments
Closed

Find correct sensor settings #1481

nofear87 opened this issue Jun 28, 2018 · 11 comments

Comments

@nofear87
Copy link

Can you please help to find the correct sensor settings?

I have Pololu 37D Motor with enconders. See https://www.pololu.com/product/1442 -> "Using the Encoder" for detailed information.

I have connected A Output to A6 then starting with this example:

var sensor = new five.Sensor("A6");
sensor.on("change", function() {
   console.log(this.value);
 });

But getting just curious data between 0-1000. I think I haven't the correct settings now?
Is it maybe an digital signal!? Did I need hardware interupts?

Thanks!

@dtex
Copy link
Collaborator

dtex commented Jun 28, 2018

Are the values in bunches at the far ends of the 0-1000 range, all at one end, or are the spread evenly? I would expect to see a bunch near 0, then a bunch near 1000, then a bunch near 0, and so on.

@nofear87
Copy link
Author

nofear87 commented Jun 28, 2018 via email

@dtex
Copy link
Collaborator

dtex commented Jun 28, 2018

Then I would suspect a floating ground. Can I see how the encoders are wired to your microcontroller?

I assume the motor is turning as expected.

@nofear87
Copy link
Author

nofear87 commented Jun 28, 2018

@dtex I switched from external power source to arduino mega powering. And now the values are in bunches at the far ends! I used scaleTo(0,1) to get true and false values. But how can I determine direction and steps without an interrupt? Thank you!

@dtex
Copy link
Collaborator

dtex commented Jun 28, 2018

@nofear87 Sorry, nothing has changed since this post. To make it happen you will need a special version of firmata which you can get over at configurablefirmata.com, then you will need to add support for the firmata encoder protocol to firmata.js, and then finally add support to Johnny-Five. It's no small task which I'm sure is why it hasn't happened yet.

@nofear87
Copy link
Author

nofear87 commented Jun 29, 2018

@dtex You are right, sorry! Sometime I'am a little bit impatient :-) Could it be a solution to use a python script on raspberry to read the encoders? Is there a way to pass python data or data in general to a "virtual" pin? Because I need some kind of communication between nodejs and python for motor soft start.

@ryangueraa
Copy link

nice

@stale
Copy link

stale bot commented Jul 9, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale label Jul 9, 2019
@stale stale bot closed this as completed Jul 16, 2019
@joepuzzo
Copy link

I have made this PR for firmata.js firmata/firmata.js#261

@joepuzzo
Copy link

Seems nobody has checked my PR yet.. anyone know who maintains that package ?

@joepuzzo
Copy link

In order to use the encoder stuff ( until the people that own firmata.js merge my code ) you need to run this in any new project that wants to use encoder stuff

 npm i firmata-io@npm:@joepuzzo/firmata-io

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants