Agile-and-Adaptive-Robotics / Inverted_Pendulum

Repository to store code and CAD files for an inverted pendulum actuated by pneumatic artificial muscles.
2 stars 0 forks source link

IMU Wiring #8

Closed reyna-ayala closed 4 years ago

reyna-ayala commented 4 years ago

At this point in the commit history for the electricalSchematic-ReynaAy-hdw branch (https://github.com/Agile-and-Adaptive-Robotics/Inverted_Pendulum/tree/4fdef6c5dde514bbfdee974c51bf0fd215c8dcdd), I have created a schematic on Eagle CAD of the possible electrical system we will use & mount onto the IP.

First off, I used an Arduino MEGA 2560, which I can change, but it's the one I have at home and offers ample opportunity for future improvement on the project.

Mainly, I wanted to double-check the IMU wiring. The datasheet can be found here: https://learn.adafruit.com/nxp-precision-9dof-breakout/downloads . Will the current configuration of the IMU wiring in the schematic work? If not, what should I change? I haven't worked with IMU's before.

I've also attached a screenshot of the most recent file in case there are any troubles with the commit history link. (The servos are for turning the tendon string spools... these may disappear depending on what we decide later on)

image

reyna-ayala commented 4 years ago

In addition, I would also like some advice on the valve manifold wiring. I need to change this still but was planning on hooking it up to digital pwm pins. Is this the correct signal type used?

jakechung42 commented 4 years ago

This question should be addressed to @Scharzenberger. Cody, can you upload the datasheet of the valve manifold that we have also?

jakechung42 commented 4 years ago

IMU has several communication protocols. It looks like you are using the SCL/SDA protocol. The Mega has specific pins for SCL/SDA communication, which is pin 20 and 21. SDA on the IMU goes with SDA on the Mega, and same for SCL. I like your idea of controlling the tension string spool. Are those servos controlled using the PWM signal?

jakechung42 commented 4 years ago

We also need to read data from the Encoder. to get the joint angle information. Let me find that data sheet.

jakechung42 commented 4 years ago

Actually, you should have the datasheet for the encoder. It is in \Inverted_Pendulum\Documentation\Datasheets\Encoder_amt10.pdf

reyna-ayala commented 4 years ago

Yes, I'll work on adding in the encoder, just haven't gotten that far yet. The servos are using PWM. I always ignored the SDA and SCL labels since I didn't know what they meant but just now noticed them -- very cool! I will make that change.

reyna-ayala commented 4 years ago

image (Updated version)

jakechung42 commented 4 years ago

It looks good now.

Scharzenberger commented 4 years ago

Datasheets I added the transistor array and valve manifold datasheets to the documentation folder.

Unfortunately, the valve manifold datasheet is mostly concerned with pneumatic diagrams -- so it won't actually be that useful. In order to find the manifold pinout, we would probably have to look up the specific component that festo uses on their manifold. I think I figured out the wiring from a hard copy datasheet that they sent with the manifold, if I remember correctly.

Fortunately, you can see the correct wiring for both the transistor array and the valve manifold on the transistor valve breakout PCB file I made for the quadruped. It is this one: https://github.com/Agile-and-Adaptive-Robotics/Quadruped_Robot/blob/master/CAD_Electrical/Rev2/Valve_Breakout_Circuit/Transistor_Valve_Breakout_Circuit_Manual.brd

Valve Manifold Advice The valve manifold requires 24 volts to switch on a valve. You need to use a transistor array like this one TransistorArray_TBD62783APG.pdf, because the Arduino Mega cannot output enough voltage to switch the valves by itself. You don't need to use that exact transistor array (since it has more channels than you need), but those will work and we should have some already (although, maybe getting low?). The order is:

arduino --> transistor array --> valve manifold

Can you use a PWM pin? You can use any digital pin(s) to connect to the transistor array, PWM or otherwise. I am not an Arduino expert, since I usually just use the underlying microcontrollers. If you were just using a stand alone microcontroller, you can use any digital pin for PWM applications... So I don't understand why Arduino makes a distinction...

IMU Advice I know that Connor was using I2C as the IMU communication protocol. I haven't used those IMUs before, so I would ask Connor to show you his wiring diagram.

Scharzenberger commented 4 years ago

Also, a thought about the servos... Depending on what servos you use, you may have problems with the servos being too weak to withstand the muscles. If I am understanding correctly, the idea would be that you could use them to automatically pretension / tighten the muscle "tendons." That is a good idea that will save a lot of time / effort down the line. However, the servos would have to be decently strong to develop any sort of appreciable pretension in the tendons (which is still okay) and would have to be very strong to resist the force applied by the muscles (~100-150lbs). Otherwise the spool would just unwind or the servo would break.

A possible fix to this would be to have a passive locking mechanism. Once the servos reach there desired "tight" position, you would have a pin, screw, or other locking mechanism that engaged to passively maintain the muscle tension without the servos fighting the muscle. This might be a bit of a struggle to implement, but who knows.

reyna-ayala commented 4 years ago

image I inserted the transistor array and just made an educated guess on the wiring. @Scharzenberger

Scharzenberger commented 4 years ago

Your educated guess is correct. The transistor array looks good. Good job!

When I check out the wiring I did for the valve manifold, I notice that there actually isn't a 24V supply pin. There are 26 pins: 24 for the valves (which you have hooked up to the transistor array correctly), one for ground, and the final one is actually just a dummy pin.

I just added the pressure sensor datasheet to the inverted pendulum repository. You could add those to your schematic (you need two, one for each muscle). You only need the first three pins. We have the MXP5700GP variant (there are many different variants in the datasheet, just look for that name, or the one with pins down and only a single spout).

Good luck! MPX5700.pdf

reyna-ayala commented 4 years ago

image For the wiring of the pressure sensors, is it more important that they go to analog pins or to serial? I found an example wiring diagram (below) and noticed that on the MEGA2560 A0 and RX0 are the same pin. In other words, should the second one be wired to A1 or RX1? Since it seems that the pressure sensor is likely analog then I assumed A1 was correct... image

Scharzenberger commented 4 years ago

You are correct, the pressure sensors are analog. It does not really matter which analog pins you use, but I would recommend not using the ones labeled RX or TX (e.g, you could use A2 & A3 instead). I recommend this not because the RX and TX pins wouldn't work, but because they can also be used for UART serial communication (i.e., they are dual purpose). Since there are free analog pins that are not dual purpose, we might as well save the RX / TX pins in case we decide to do serial port communication later. Otherwise, looks good.

reyna-ayala commented 4 years ago

Awesome! Looks like the IMU is correctly wired according to this link: https://learn.adafruit.com/nxp-precision-9dof-breakout/pinout

Just wanted to document it here.