The inverted pendulum skill is designed to be used with the Sainsmart v3 balance robot but technically you can use the Sainsmart hardware, combined with ARC, to balance any robot.
How to add the Inverted Pendulum robot skill
- Load the most recent release of ARC (Get ARC).
- Press the Project tab from the top menu bar in ARC.
- Press Add Robot Skill from the button ribbon bar in ARC.
- Choose the Movement Panels category tab.
- Press the Inverted Pendulum icon to add the robot skill to your project.
Don't have a robot yet?
Follow the Getting Started Guide to build a robot and use the Inverted Pendulum robot skill.
How to use the Inverted Pendulum robot skill
The inverted pendulum skill is designed to be used with the Sainsmart v3 balance robot but technically you can use the Sainsmart hardware, combined with ARC, to balance any robot. You'll just need some patience to tune the PID values. In order to use this skill you'll have to install the custom EZB firmware onto the Sainsmart robot's Arduino Mega and connect it to ARC.Main window
1. PID Gain Value Sliders
These sliders adjust the proportional, integral, and derivative (Kp, Ki, and Kd) values that are used for the closed loop balancing algorithm.
2. Values Display & Update Realtime Checkbox
The Kp, Ki, and Kd values are displayed here as well as Omega, Angle, Distance, encoder values, angle offset, and speed values. The Checkbox is used for showing realtime values if needed.
3. Angle Correction Offset Slider
Correct the angle of your balancing robot with this slider.
4. Movement panel
This panel allows you to move the balancing robot, forward, reverse, left and right.
5. Calibrate Button
This button sends the Calibration command to the Arduino Mega.
6. Status Display
This displays communication between ARC and the Arduino Mega.
How to Use Inverted Pendulum
1) Download the EZB firmware onto the Sainsmart Balancing robot's Arduino Mega.
2) Add the Inverted Pendulum Skill to your ARC project (Project -> Add Skill -> Movement Panels -> Inverted Pendulum).
3) Connect the Arduino Mega's COM port to ARC with a USB cable or Bluetooth.
4) Push the Calibrate button then start adjusting the sliders in the Inverted Pendulum Skill until you have optimal balancing. Adjust Kp, then Kd, and then Ki. Note that Kp is a usually higher in value and Kd is a very low value.
Video
Requirements
You will have to program the EZB firmware onto the Arduino Mega, located on the hardware page, in order to use this skill.
Resources
The hardware for this skill can be found here: https://synthiam.com/Docs/Hardware/SainSmart-Balance-Robot
Here is the Inverted Pendulum firmware for the Arduino Mega: https://synthiam.com/uploads/imagesrc/EZ-Mega-v1_Balance_Robot-636848728401310251.zip
The tutorial for installing the EZB firmware onto an Arduino Mega is here: https://synthiam.com/Community/Tutorials/Connecting-Arduino-to-EZ-Builder-17526
*Note: This skill is in beta stages
Link does not exist.
Connected device to EZ-B index #0 does not support the required capability. Field not found: 'EZ_B.Firmware.XMLFirmwareSimulator.CAP_INVERTED_PENDULUM_V1'.
The baud rate in the sketch is set to 115200 as is the baud rate in the EZ-B.
The firmware id = 9
// The firmware version that is reported to ARC to notify of capabilities
#define _FIRMWARE_ID 0x00000009
// The communication baud rate
#define _BAUD_RATE 115200
This is my first attempt with Arc. Is there a way to test the communication to the arduino from the arduino serial monitor?
The correct firmware is posted above
However I downloaded the firmware from the above location.
file name: EZ-Mega-v1_Balance_Robot-636848728401310251.zip
file size: 65,776 bytes
The firmwareID in the source code is: #define _FIRMWARE_ID 0x00000009
I have reduced the baud rate on both the Arduino and in the connection dialog. With no improvement.
I do not get a connection if the baud rates are not aligned.
Is there a way to get the commands send by the Skill to the Arduino? So i can simulate that with the Arduino Serial Monitor.
PS. I added a blinker to main loop of the code to see if the code is running on the mega, which it is.
Code:
Moreover with no Arduino connected I get the same error so it seems the Inverted Pendulum is not aware of the connection when connected.
Thanks for you support.
Also, the message reads Index #0, and you are using Index #1. Use Index #0 as the message describes, and do not use Index #1.
Tried those with the same result. Attached four screenshots.
1 Workspace with connection (0)
2 Debug log at that state
3 Workspace after pressing calibrate
4 debug log at that state
Note no new entries in the debug-log between 2 and 4
I created a project with the serial terminal skill.
I changed the #define CmdGetFirwareID 253 to 0x5A // Z Change for testing with Serial console.
When I send "U Z", I get this response back:
Code:
Which is expected, see attached screenshot.
Any change to get access to the code of the Inverted-Pendulum for further trouble shooting as I'm now stuck.
Thanks in advance.
I can take a look at it as well to see what's up. It should be pretty straightforward. But either way, I'll get it up fro you to look at
So if your plugins are in
Then you'll want the output folder to be that path plus the GUID. So it'll be
If you want to create your version, create a plugin, copy the GUID from the new plugin and replace it in the plugin.xml of this one.