We are developing a Wifi Nunchuck to control the FaradayMotion board.
It's base on a Wii Nunchuck and it's controlled by a ESP-12. Additionally it includes a micro Lcd OLED display to show ESC information and a Lipo battery with it's charger.
The communication between the Board NodeMCU and the WifiNunchuck is done by UDP protocol, where the board NodeMCU sends all debug data from the ESC (to be shown in the LCD) and the WifiNunchuck responds with the buttons and joystick data, to control the Power of the Board.
The project development is in a good state, UPD protocol working, NodeMCU power control from Wifi Nunchuck is working (but some adjustments are still needed).
The current blocking point is reading the ESC from the NodeMCU, and we don't know the reason... We have updated the Faraday.NODEMCU.ino code to enable it but it doesn't work.
Also LCD menus are on development and would be great to know what would be interesting for you to be included. The current plan is:
- Battery menu
- Speed menu
- Extra info (mAh, ???)
If anybody has used the ESC data reading feature and it's working, would be great to be in contact!!
I'll attach some pictures of the project!
Awesomes stuff! Looking forward to see pics of the progress.
Hey! This is so cool! Love the logo.
Also I have great news! Some time ago I wrote an interface to communicate with the ESC (VESC) to be able to get some data.
I will publish it asap.
Gotta run now. Here you can read a bit about how I did it.
Love the logo in the LCD! Are you using NRF24 modules or what do you use for radio communication?
That's really good news :), I was blocked on that point. It would be great to see your interface!! Because I implemented mine, but it doesn't work :(. I setup a callback function in the FaradayVESC.init(), I 've created the FaradayVESC.getdata() to trigger the call to bldc_interface_get_values() and I'm calling it cyclically, but callback function is never called...
I'm using a ESP8266 board, the ESP-12 version (http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family). It's a Wifi SoC, so I'm connecting to the Nunchuck to the AccessPoint created by the NodeMcu of the board.
For the SW, I'm using the same as NodeMcu, https://github.com/esp8266/Arduino
So last night I prepared the code and was ready to realese. I did not since I wanted to test it for making sure it drives the motor in a proper way.
My test failed since I did not have a sensored motor at home. Today I will try to do it in the office and see if I can publish it on separate branches.
Really excited to see what will come out of this.
I got news! But first:
PLEASE DO NOT DRIVE WITH THE CODE I PUSHED.
THE CODE HAS NOT BEEN 100% TESTED ON THE ROAD.
Now to the fun part :). I have push two branches on the vesc and the core-software repositories. The branch is called "vesc-communications".
To be able to use my code just pull the new branches. NOTE: For the vesc repository you will have to run "git submodule update" in order to pull the VESC UART BLDC INTERFACE.
In the vesc repository you will see FaradayVesc.cpp and FaradayVesc.h files. These are to be the future interface that I am working on. For now I only implemented the get_values function.
In the core-software repo you will see a new Faraday.Vesc file. This file contains the functions related to the communication.
I was wondering if you ever tried PlatformIO. One of the reasons it took so much time is that I am trying to rewrite the entire source code with PlatformIO. I want to make the code more OOP.
If you have any questions add me on Skype: c_costel and I can try to help you out.
Sorry for not having the time to document everything in a proper way. I will try to do it asap.
Got it! Thanks Constantin.
I've it compiling merget with my changed, but I had to modify the lib\bldc_uart_comm_stm32f4_discovery because I don't have files ch.h and hal.h, so I commented them out... Hopefully they are not nedded, as compilation doesn't complian :P.
I'll try to finish my code to read data and show in the LCD during the week and let's see how it works!
I've never tried PlatformIO, I'm so used to Arduino enviroment... but I'll have a look to it!!
We are so excited to see it.. Also let us know about the reliability, we have experienced zoned where the wifi dead zones when driving around in cities:-))
Sorry for that, a lot of work, so no time to work on the board...
I let you known as soon as we have it working!!
Regaring "wifi dead", we created a monitoring task that if there are more than 5 missing frames from Nunchuck, power of the motor is disabled. And in the nunchuck side, if there isn't connection to access point or missing frames from the board, a message is shown in the screen. So, hopefully, nothing wrong will happen :P.
ohh.. I am dying for an update. It so cool that you are doing this. So I understand there are more people cooperating on this?
Hey mate! How is the project going? We have just launched a forum and are planning to move all the content from the makerspace to the forum itself.
Would you mind making a post on the forum? I have also made some posts there regarding the refactoring of the code that I am planning.
Link to forum: http://forum.faradaymotion.com
I'm Albert Sanz, working with Lluis with this project. We have updates for all of you!! ;)
- VESC data is now perfectly read from NodeMCU and transmitted to the Nunchuk. Now we can see all data in the display. Constantin, your code help us a lot!! Thank you very much.
- Wifi testing: we performed several testing. We have it working at a distance of 10m without any communication problem :O. Eventhough, if connection is lost during (250ms without UDP packages, 5 frames missing) power of the board is disabled. So hopefully, we won't have dangerous issues over the board.
- Test of the Nunchuk: time response should be now fast enough (Nunchuk data is sent every 50ms to the NodeMCU).
- Test of the Nunchuk: mechanical response is a little problem we have: the nunchuck has only 60-70% of the mechanical movement linked to electric movement, so when you have not reached the mechanical end, the value read is already 100%. We still don't know if it's a generic problem of all nunchuks, or only from ours... Pending to investigate. But as a summary, you have short finger movement to control the power...
- The display has the battery menu finished, the speed menu ready ( but speed still not correctly calculated...), the A and the Ah in a preliminar version. Pending to define other user needs to be included, if needed.
- Code cleanup is still pending, but as soon as I have something "shareable" I will share with you!
Here I uploaded two video of the Nunchuk in opertion!!! I hope they like you! :)
I will create the post entry!
Wow guys we are freaking impressed! Awesome work! Can't wait to see the code. Thank you also for taking the time to port the post to the forum. Let me know if we can assist you in anything :)