Skip to content

Running the 121 8 Hansen motors

JoshuaGabriel edited this page Jan 8, 2023 · 3 revisions

2023 rover

Step-by-step lab to get these motors to run

This page is a guide to getting a basic feel of how to run our Hansen motors which are used for the drivetrain. This is written for the software team members.

Pre-Lab Info

  • PWM signals
  • basic Arduino coding

Needed components

All the components should be in qhut.

  • Hansen motor
  • Power Supply
  • Aligator wires

Wiring

There are special clips in Qhut to attach to the motor's +/- terminals, don't try to use alligator clips as they are a bit loose.

image

Software needed

The software needed to run this without ROS, would just be Arduino code. The code would do the following

  • Take input from the joystick
  • use input from joystick (-100 to 100) to and map it to PWM values (0 to 255).
  • Send PWM signals to output from the Arduino. Remember you can't send negative PWM values

Post-Lab

There are a couple of things to think about as to how we will fit this on the rover system.

There are encoders on these motors.

What are encoders?

By definition "closed loop feedback signals by tracking the speed and/or position of a motor shaft" taken from google. What this basically means, sending a 255 PWM signal (max speed) doesn't mean the rover will run at full speed. The rover could be going uphill or depending on the weight of the rover it will move at different speeds right? These scenarios such as uphill and weight are things we call 'under load'. With an encoder, you know the exact velocity/rotations and can more precisely measure the rotation and speed. On our rover this means you can more accurately measure where the robot is based on how far its wheels have rotated. (in practice this isn't perfect though because wheels slip)

There are encoders doesn't send us velocities and there is a bit of math involved to convert what the motors give us to what we want. (this math is available online with a bit of research)

The encoder's information is one piece of the puzzle of our odometry system. Since we can vaguely figure out how much the rover has traveled.

How would this look like in ROS, which nodes and topics would we make?

Written by Joshua Blanch

Clone this wiki locally