Hey, that’s great news! Im really happy someone has decided to make this public! (arduino code & instructions on how to fine tune the PPM/PWM signal)
I first heard about this ‘‘throttle ramping’’ on an instructable about making electric scooter. The guy who wrote it had some serious background in robotics and he was also studying at MIT or a similar level school. Too bad he did not give much instructions on how to make one, though.
Good to hear you will get some help, I have very limited arduino knowledge, I’ve turned on some basic matrix displays, did ultrasonic and light sensor things, perhaps a few other little tweaks but nothing major so far… I would appreciate if arduino code and all the instructions / functions were more easy to understand as it gets quite intense and non - understandable fast
Also takes a lot of time, patience and endurance to find what is not working! Once I spent about 3 hours to get some basic lights working
I have only tested this with a servo at the other end but it does work. Pin 2 is the signal pin from the receiver and pin 3 is the transmit pin for the servo. The UNO cant supply enough juice for the receiver and is only 5V not 6V so I have 4 AA batteries in series to give me 6V. The servo seems to need to be powered from the UNO (otherwise strange things happen) and you must have a common ground or nothing works.
I’m going to split the parts of the loop into functions and get that working hopefully tomorrow or over the weekend.
A lot of the comments are from the original writers of the code that I have copy/pasted and modified so it works. I’ll compile a list of sources and add them so I can give credit where credit is due.
yes thats exactly what I’m thinking.
I just got one of the modules and I’m researching vesc/ble for an android vesc app.
Once i have the data, i might make an online tool to upload directly/compare trouble shoot…
This is all very early stage ideas tho. not sure when i’ll feel like coding…
I’ve been trying to get data from vesc via uart but still not receiving anything from the VESC. I have an arduino uno connected to a small lcd, which displays the voltage and rpm. The uno is hooked up to a lipo on the uno’s 5v vcc pin and GND pin. Only the vesc’s rx and TX pin are connected to the arduino.
did you enable ppm+uart?
also, im not sure about this since i haven’t done any vesc uart dev but i believe you have to query the vesc?
Also, its a good idea to have a common GND from the vesc to the arduino. And since the vesc can provide 5v you can just use 5v, GND, TX, RT from the vesc.
Yes, I have ppm+uart enabled; baud rate is also identical.
I should add that plugging in a Bluetooth module to the VESC’s uart works with the VSC Monitor app (by solarturtle?). Also, what’s “query the VESC”?(Im a noob)
I am thinking of sticking an Arduino 101 on my board for a bit of throttle smoothing. Might go for a custom controller using a Trinket as well since they are so small
The 101 has bluetooth, a 3-Axis gyro and 3-Axis acceleromter all built in so could be perfect for data-logging, connecting to phone etc.
I use the serial pins on the arduino uno (pin 0/1) but I unplug the USB. If I don’t use the serial monitor on the pc and have the values output to the lcd, it should work…right? (I will test this later)
I’m still trying to fully figure it all out but its a start. The name will probably change in the future and once I have something working a little more I’ll probably start a thread about it.
If anyone is able to give any advice or help, it would be greatly appreciated as I’m a total beginner at this.
Yeah, as long as you’re not using usb tx/rx pins should work fine, but its much easier to use software serial, that way you can use serial monitor for debugging and quicker code changes turnaround.
Have you tried this code out yet? Looks like a good basis to start.
You probably know this but interrupts can only be added to pins 2/3 on an uno so you might want to change the servo pin to 9/10 so you can add other interrupts in future
Should probably ditch the delay in your main loop for millis() compare or an interrupt. Should prevent any problems later on
If I use software serial (let’s say I set pin 2 as rx and pin 3 as tx and name it “mySerial”), in the “VescUart.h” file – I’ll have to change “#define SERIALIO Serial”. What do I replace it with?
@domw95 The code as it is works but yeah i have to remove the delay and time the tasks. I actually just found this - https://learn.adafruit.com/multi-tasking-the-arduino-part-1/using-millis-for-timing after reading your post as it got me thinking. I got a good few hours on Saturday to start getting my head around this and tinkering. You are totally right about the pins and those will change as well. I was thinking about using the second channel for something but I’ll focus on the core first, extras later.
Cheers @EssEnn … il power up the netbook later and have a look, see if I can understand any of it. Currently making a stand for my PC PSU and accucell. Bit chilly and cloudy here today though, not sure I should charge my lipos just in case I don’t make it out!
Actually found an app for android which allows you to open .Ino file and edit etc which saves me copying stuff to a .txt to mess with on my phone on the go