Closed streakerau closed 6 years ago
Hmmm. I must confess I'm not that up to date with our code base to answer your question. And I'm currently on vacation so I don't have the hardware in front of me. But. I can share with you the code that is running on our Orion board. https://github.com/tiigbg/telepresence-motorcontrol/blob/master/motorcontrol/motorcontrol.ino Our robot has mecanum wheels, and we have some code on the orion to make the robot able to strafe. The orion code receives commands from a computer over serial. This command consists of a rotation speed, direction and movement speed. The Orion code then calculates the proper speeds for the four motors according to the algoritm/equations found in this paper: http://eprints.utem.edu.my/16543/1/Omni%20Directional%20Control%20Algorithm%20For%20Mecanum%20Wheel%2024%20Pages.pdf
Here is a link to the node program that sends the serial commands to the orion board: https://github.com/Dealerpriest/websocket-to-serial/blob/master/websocket-serial-server.js
I'm aware that this might be a lot to dig through, but as of now I can't provide that much more help.
A thought I had is that I see that your code calls setMode(1). In our code we never call setMode() i think. Maybe that could be an issue, even though I right now wouldn't know how.
Thanks mate, I managed to make it work getting rid of the PID because we didn't really need it for our application. Thanks so much about your help, our robot is now way less noisy and annoying which is awesome!
Nice! We should document the firmware better. I hope to find some time after vacation to do that!
Hello, I successfully uploaded your firmware to the encoder board. I'm trying to set speed from a Me Auriga board.
We are using the MeEncoderNew library from Makeblock to do so...
We can control the motors correctly but the range is very small. With the previous firmware we could control speed setting a value from -255 to 255. With the current firmware with value 10 the motors move for one second and than stop and with value 11 they go extremely fast.
I was wondering if you could share the code you use to set speed from the external board. thanks!