Johnny-five: Feather HUZZAH (ESP8266), generic H-bridge motor drivers, and PWM range

Created on 14 Jan 2017  路  6Comments  路  Source: rwaldron/johnny-five

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.

Bug Hardware Required IO-Plugin Needs Attention

All 6 comments

Keep your eyes on this PR: https://github.com/firmata/firmata.js/pull/149

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

also more info about it in the conversation here that could be helpful: https://github.com/firmata/firmata.js/pull/144

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 鉂わ笍

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.

@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.

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cannehag picture cannehag  路  12Comments

TheBekker picture TheBekker  路  6Comments

yuanhaoliang picture yuanhaoliang  路  7Comments

ntatko picture ntatko  路  11Comments

Spy474 picture Spy474  路  10Comments