Skip to content

Commit

Permalink
whoops, add back in deleted readme stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
apollokit committed Feb 5, 2024
1 parent 2c2055d commit edb02da
Showing 1 changed file with 75 additions and 1 deletion.
76 changes: 75 additions & 1 deletion electrical/pcb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,82 @@ TODO: identify the parts for the standoffs
|:-:|
| Figure 4.7: Mating the brain board to the motor board |

And now you're done with the assembly! Enjoy your completed Control Board!
And now you're done with the assembly! Finally, we'll move on to testing and configuration.

| <img src="../../images/pcb_assembly/v2_0_1/assembly/IMG_0849.jpeg" height="300"> <img src="../../images/pcb_assembly/v2_0_1/assembly/IMG_0850.jpeg" height="300"> <img src="../../images/pcb_assembly/v2_0_1/assembly/IMG_0851.jpeg" height="300"> <img src="../../images/pcb_assembly/v2_0_1/assembly/IMG_0852.jpeg" height="300">|
|:-:|
| Figure 4.8: Completed control board |

## 6. Testing the PCB and wiring for the drive motos

Before we insert the wiring and PCBs into the mechanical assemblies, we'll test and configure the drive motors, wiring, and PCB. This allows us to fix these critical parts if something doesn't look right and allows us to move to running the software as soon as the rover is assembled.

For this you will need:

- wiring you made earlier in [wiring readme](../wiring/README.md)
- 6 drive motors
- completed PCBs
- a power source: a benchtop power supply or a charged battery

Secure the PCB assembly so it doesn't fall or move while it's on. You can attach it to the bottom body plate already. Avoid contact with any surfaces that can generate high-voltage sparks like carpets as that can destroy the electrical components.

Arrange the drive motors around the PCB and connect them using the wiring. Since we'll be calibrating them, make sure you connect the right motors to the right PCB receptacles. It helps to mark them using a sticky note or marker. The silk screen lettering should help here.

Connect a power source to your board as you did before. Verify that the roboclaws all receive power. A green light should be on on each roboclaw.

### 6.1 RoboClaw Testing and Verification

In this section you will be going one by one and and testing the operation of the RoboClaw Motor controllers. You will be doing this by using the GUI provided by the manufacturer of the motor controllers. The GUI can be found at [the BasicMicro website](https://www.basicmicro.com/downloads), under general downloads, then BasicMicro Motion Studio.

You'll also need the `USB RoboClaw Windows Driver` from the RoboClaw General Downloads section of the page. This should be installed before you run the Motion Studio.

To use the GUI, insert a USB to Micro USB cable from your computer to the motor controller you are going to be testing. In the Basic Motion GUI you should see an available device appear. It might require an update to proceed. Install the latest firmware update and then connect to the device.

Verify that all status lights are green and that the following values are shown at the top:

Temperature1: ~30
M1/M2 Amps: 0.00
M1/M2 Encoder: 0
M1/M2 Speed: 0
Main Battery: Between 11.5-16.7V
Logic Battery: 5V
Model: 2x7a

#### 6.2 Configuring general settings

The addresses for each Roboclaw unit by default are `128` which we want to change such that the Raspberry Pi can distinguish between Roboclaws and thus motors. We'll leave Roboclaw 1 at 128 and set Roboclaw 2 and 3 to 129 and 130 respectively.

In the `General Settings` tab:

- under `Setup`, set `Control Mode` to `Packet Serial`
- Enable the `Multi-Unit` mode flag
- Under `Serial`, set the `Packet Serial Address` to either 128, 129, or 130 depending on which roboclaw is plugged in
- set the `Baudrate` to `115200`
- Under `I/O`, make sure `Encoder 1 Mode` and `Encoder 2 Mode` are both set to `Quadrature`
- Under `Battery`, set `Max Main Battery` to `18.5V` and `Min Main Battery` to `11.5V`

Next, we'll check the correct direction and calibrate velocity before we repeat the process for the other roboclaws and motors.

#### 6.3 Prepare PWM signal

Click on the PWM tab. We will now send a PWM signal to the motor and test that connections are all made correctly to the motor and encoder. Start by selecting the `Enable Space Bar Stop All` button in the bottom left which allows you to set velocity to zero when you hit the space bar.

#### 6.4 Vary PWM signal

Slowly move the slider bar for the corresponding motor output channel. Verify that the right motor is spinning and that the encoder value is also changing.

- If there is no movement, the motors aren't getting current through the MA and MB wires. Check your wiring and look for red status lights within the Motion Studio GUI to troubleshoot.
- If the motor spins but the encoder value for that same motor/channel (M1 or M2) isn't changing, there likely is an issue with your encoder cabling. Use a multi-meter to verify connectivity.
- If all your connections are correct, you may have to test your solder contact between the components on the board itself.

> **Note**: When troubleshooting electrical connections, always remove power to the PCB to prevent shorting and injury.
Switch direction of the slide bar and verify that it spins the other direction and the encoder value does the opposite of previous as well.

Once you've verified this, we'll focus on the direction. We want the motor to spin as in the diagram below when we send a positive PWM:

![motor direction diagram](images/motor_direction_diagram.png)

For both motors check that the direction matches the diagram. If it doesn't, for that motor in the `General Settings` tab, select `M1 Reverse`. Check again to verify it matches. Now verify that the encoder value increases when you send a positive PWM for each motor. If it doesn't, select the `invert` checkbox in `General Settings` and verify again.

> **Important**: Make sure to save these settings to each Roboclaw's non-volatile memory by clicking on the `Device` menu > `Write Settings`.
Repeat starting from Section [6.1](6.1-RoboClaw-Testing-and-Verification) for the other two roboclaws.

0 comments on commit edb02da

Please sign in to comment.