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

Feather HUZZAH (ESP8266), generic H-bridge motor drivers, and PWM range #1275

Closed
hxlnt opened this issue Jan 14, 2017 · 6 comments
Closed

Feather HUZZAH (ESP8266), generic H-bridge motor drivers, and PWM range #1275

hxlnt opened this issue Jan 14, 2017 · 6 comments

Comments

@hxlnt
Copy link

hxlnt commented Jan 14, 2017

I recently led a series of NodeBots workshops using J5 + StandardFirmataWifi with the Adafruit Feather HUZZAH boards and inexpensive dual H-bridge motor drivers (L9110, various manufacturers). I'd like to use the learnings from preparing and hosting this workshop to help improve J5's Feather support.

In particular, I initially ran into issues with adjusting the speed and direction of DC motors due to the ESP8266's default PWM range of 0 to 1023 instead of 0 to 255. Passing a speed variable to the motors resulted in erratic results, and motor.rev() functions did not work regardless of what speed was passed in. In our workshop, the issue was corrected by manually changing the PWM range on the Firmata side (analogWriteRange(255)), but I would be interested to see if this would be worth addressing in J5.

I am happy to help write the code, but this seems like something that might have broader implications than just the Feather board + L9110 motor drivers (e.g., possible implementation of PWM range parameter in all ESP8266 boards?), and I don't have a good handle on J5's overall philosophy on changes like this one.

If it's useful to anyone in the meantime, the source code and step-by-step instructions for the Feather NodeBots workshop are on GitHub. I'm working on making a more generic version, as this was for a specific event and has elements (competition schedule, connection to a bot motion-path visualization dashboard, etc.) that aren't broadly applicable.

Tagging @BrianGenisio, as we talked about this issue yesterday and he kindly offered his help.

@monteslu
Copy link
Contributor

Keep your eyes on this PR: firmata/firmata.js#149

Soon as it lands we can get to having j5 make use of it to get PWM resolution working.

@monteslu
Copy link
Contributor

also more info about it in the conversation here that could be helpful: firmata/firmata.js#144

@rwaldron
Copy link
Owner

Hi! Sorry for the delay, I was on parental leave from January 20th until last week and I'm still trying to catch up with everything. I appreciate your patience ❤️

@dtex
Copy link
Collaborator

dtex commented Jan 11, 2018

Hi @hxlnt

This issue is super important (arguably the most important issue we have open right now) and my closing this certainly doesn't mean that we don't care, we just haven't gotten to it yet. I'm worried about it getting lost in issues so rather than leave it languishing we have created a Requested Features page and added your the request for leveraging io.resolution there.

There are two other related issues that I am closing along with this one, so we definitely have mots of people interested in this. We just need a motivated contributor.

@dtex dtex closed this as completed Jan 11, 2018
dtex added a commit to dtex/johnny-five that referenced this issue Aug 26, 2018
dtex added a commit to dtex/johnny-five that referenced this issue Sep 11, 2018
@dtex
Copy link
Collaborator

dtex commented Sep 11, 2018

@hxlnt I have a PR for this at #1495. I think it's good to go (passing unit tests) but I don't have a non-8-bit board to test with. It required changes to the LED, RGB and Motor classes. Would you have a chance to try it out? The input range for all the devices is still 0-255 but we are mapping to 0-1023. It does require that firmata.js and firmata both be somewhat recent versions, but honestly, both have had support for a couple of years.

rwaldron pushed a commit that referenced this issue Sep 18, 2018
@dtex
Copy link
Collaborator

dtex commented Sep 22, 2018

This landed in #1495 and will be in the next release of Johnny-Five (v1.1.0?)

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