WALL-E Version 1.0
The "WALL-E" Project is a ME 507 quarter term project inspired to recreate the robot WALL-E. The WALL-E robot is a fully 3D printed robot with modified components in order to fit the needs of the chosen peripherals and electronics. WALL-E contains a custom made PCB which is housed in the main body of WALL-E. WALL-E's peripherals and components include 2 pololu Romi Motors with encoders, 4 MG90s servos, BNO055 IMU, and a OV2640 ArduCam camera. The objective of WALL-E is to scan the surrounding area for the closest object to it. Once that object is detected, WALL-E drives up to the object, attempts to pick up or hold the object and detect the color of the object.
Loading...
Searching...
No Matches
Servo Class Reference

WALL-E servo motors class developed for hands and arm movements. More...

#include <servos.h>

Public Member Functions

 Servo (TIM_HandleTypeDef *htim, uint32_t channel)
 Constructor Function for Servo Motor Class.
void attach ()
 Function starts the PWM Channel for the Servo Movement.
void detach ()
 Function stops the PWM Signal received from the PWM.
void setPulseWidth (uint16_t pulse_us)
 Function sets the Servo's motor pulse width to determin the angle at which the servo moves to or holds.
void setAngle (uint8_t angleDeg)
 Function set's the Servo motor's pulse width based on the desired angle from the servo.
void startStopAngle (uint8_t angle1, uint8_t angle2)
 Function sets Servo to start to stop angle incrementing till requested angle.

Private Member Functions

uint16_t angleToPulse (uint8_t angleDeg)
 Function calculates the angle requested to the PWM pulse that is needed to create the angle.

Private Attributes

TIM_HandleTypeDef * htim
uint32_t channel

Detailed Description

WALL-E servo motors class developed for hands and arm movements.

Constructor & Destructor Documentation

◆ Servo()

Servo::Servo ( TIM_HandleTypeDef * htim,
uint32_t channel )

Constructor Function for Servo Motor Class.

Member Function Documentation

◆ angleToPulse()

uint16_t Servo::angleToPulse ( uint8_t angleDeg)
private

Function calculates the angle requested to the PWM pulse that is needed to create the angle.

Parameters
angleDegParameter that takes in the desired angle and translate to the pulse necessary to set the servo
Returns
uint16_t

◆ attach()

void Servo::attach ( )

Function starts the PWM Channel for the Servo Movement.

Returns
None

◆ detach()

void Servo::detach ( )

Function stops the PWM Signal received from the PWM.

Returns
None

◆ setAngle()

void Servo::setAngle ( uint8_t angleDeg)

Function set's the Servo motor's pulse width based on the desired angle from the servo.

Parameters
angleDegParameter that sets the servo to a position based on the actual angle rather than pulse
Returns
None

◆ setPulseWidth()

void Servo::setPulseWidth ( uint16_t pulse_us)

Function sets the Servo's motor pulse width to determin the angle at which the servo moves to or holds.

Parameters
pulse_usParameter that determines what pulse to send to set the Servo to a specified angle
Returns
None

◆ startStopAngle()

void Servo::startStopAngle ( uint8_t angle1,
uint8_t angle2 )

Function sets Servo to start to stop angle incrementing till requested angle.

Parameters
angle1Parameter sets the starting angle to move the servo in a sequence
angle2Parameter sets the ending angle to move the servo in a sequence
Returns
None

Member Data Documentation

◆ channel

uint32_t Servo::channel
private

Private variable channel that takes in the specified Timer Channel definition from the STM32 Config for PWM

◆ htim

TIM_HandleTypeDef* Servo::htim
private

Private variable htim that takes in the Timer definition from the STM32 Config


The documentation for this class was generated from the following files:
  • C:/Users/arath/OneDrive/Documents/ME 507/Project-WALLE/Code/Inc/servos.h
  • C:/Users/arath/OneDrive/Documents/ME 507/Project-WALLE/Code/src/servos.cpp