I have not been able to find a full tutorial on how to take apart a regular wii nunchuck(not wireless) and use an arduino chip to control a vesc.
I was working on something similar, until my Drv chip decided to break. I used UART to communicate between the rx arduino and the VESC using this library: https://github.com/RollingGecko/VescUartControl Connecting it is simple, arduino rx to vesc tx and vice versa and selecting uart as the control mode on the VESC.
Especially look for the nunchuck part. Pm me if you need help with it.
First I have not received my VESC yet it should be shipping out this week. So I can’t test anything. But to clear up what I want to do is hookup HM-10 or NRF24L01+(I have more of these laying around) to communicate to the VESC. I need one for the vesc end and one for arduino side I’m thinking.
I can’t find information on the data sent over from arduino to the VESC to get the motor to move. So I can make specific buttons do specific things.
If you go on YouTube and search up great Scott electric longboard it is either part 2 or 3
I want to use UART. Also Not a VESC he is using but I suppose it would not matter if I was using PWM(but his esc did not have breaks so I don’t know if it would be the same). Something to note is that his code with the delay function can destroy your electronics cause the delay function stops sending signals which stops the motor from spinning then spins up faster then repeats this process of Stop and go fast.
Bit of a rant on why Great Scott’s setup is incorrect.
I’m not sure if I could find the data for reverse and brakes using the same methods he used.
I want to use UART so I could read data like speed and battery voltage from the VESC.
That is the same link. It is the communication library not protocol
Please take time to look at what the community gives you, this link https://github.com/RollingGecko/ArduBoardControler was in the links given to you above and seems to be what you’re looking for
I have read most of these links before starting my question. I’m still having problems understanding everything. It is not that I’m ignoring peoples help.
I have just created my contoller using the sketch and libraries from RollingGecko. He has a wiki page on his github on how to set it up https://github.com/RollingGecko/ArduBoardControler/wiki.
I have used a cheap chinese nunchuck and stripped most of the guts out of it. I only used the thumbstick-potmeter and the circuitboard for the c and z button. I have placed an arduino nano in it and connected the potmeter and buttons to it. To power the arduino I used a 1s lipo with a power cell board from sparkfun.
I also want to use leds to know the battery level of the esk8, remote and connection status because RolingGecko added this functionality to his sketch.
It takes some patience
You could also send a ppm signal to the vesc with almost the same setup. But using the setup as shown above, gives you the ability to use the features as if you connect a Nyko Kama nunchuck to the vesc (Cruise control, switching motor directions and some telemetry features added by RollingGecko).
That is very helpful diagram. I really appreciate that. So now some questions.
- VESC side arduino is being powered by the VESC?
- Controller side why do you have two potentiometers?(what are you using them for)
- Do you have any code you used on the arduinos that I could use?
Is there an issue with code above?
- Those potmeters are the potmeters of the thumbstick. X and Y axis. I only use the Y axis for throttle control.
- I used the code @cjoliver gave you.
That code is probably what I to use for starting. I might be confused because I don’t have my vesc yet to test things with.
I should be getting my VESC by the end of the week. So I will make a new thread on a simple how to and add a link on this thread onces I have made that.
How did you figure that was the correct wiring for everything. I have an Uno’s that I’m making PCB boards for so I don’t want to screw this up.
I highly recommend connecting the VESC directly to a rf24 module, less room for fuck ups that way.
I’m interested in Wiring to VESC like which pins are for what. It looks like in the code pins for potentiometer and buttons are not set. I have some NRF 24L01+ but have never used them so I’m new to how to wire them.
@Workaround I think you are missing the config.h
In the config.h are al the connections listed. You can find the config.h for tx and rx here: under the title, Pin settings, on the given URL.
I do not really know how the code exactly works but I know it mymics a nyko kama nunchuck ( I do not know this completely sure, but it looks like the controlls and behaviour are the same) and that it works flawless for me.