![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
This program is for an autonomous robot for the competition at the Hochschule Luzern. http://cruisingcrepe.wordpress.com/ We are one of the 32 teams. http://cruisingcrepe.wordpress.com/ The postition control is based on this Documentation: Control of Wheeled Mobile Robots: An Experimental Overview from Alessandro De Luca, Giuseppe Oriolo, Marilena Vendittelli. For more information see here: http://www.dis.uniroma1.it/~labrob/pub/papers/Ramsete01.pdf
Fork of autonomous Robot Android by
ActuatorsSensor/MaxonESCON.h
- Committer:
- chrigelburri
- Date:
- 2013-04-26
- Revision:
- 15:cb1337567ad4
- Parent:
- 12:235e318a414f
- Child:
- 38:d76e488e725f
File content as of revision 15:cb1337567ad4:
#ifndef _MAXON_ESCON_H_ #define _MAXON_ESCON_H_ #include "Hallsensor.h" #include "defines.h" /** * @author Christian Burri * * @copyright Copyright © 2013 HSLU Pren Team #1 Cruising Crêpe * All rights reserved. * * @brief * * This class implements the driver for the Maxon ESCON servo driver. * For more information see the Datasheet: * <a href="http://escon.maxonmotor.com">http://escon.maxonmotor.com</a> */ class MaxonESCON { private: /** @brief To Enable the amplifier */ DigitalOut _enb; /** @brief Duty Cycle to set the speed */ PwmOut _pwm; /** @brief Hallsensor Class */ Hallsensor* _hall; /** @brief Ready output from ESCON */ DigitalIn _isenb; /** @brief Actual speed from ESCON analog Output 1 */ AnalogIn _actualSpeed; /** @brief increment the Hallpattern */ int _pulses; public: /** * @brief Create a motor control object. * @param enb DigitalOut, set high for enable * @param isenb DigitalIn, high for enable * @param pwm PwmOut pin, set the velocity * @param actualSpeed AnalogIn filtered signal for ActualSpeed from Motor * @param hall The object of the hallsensor from Motor */ MaxonESCON(PinName enb, PinName isenb, PinName pwm, PinName actualSpeed, Hallsensor *hall); /** * @brief Set the speed of the motor with a pwm for 10%..90%. * 50% PWM is 0rpm. * Caclulate from [1/s] in [1/min] and the factor of the ESCON. * @param speed The speed of the motor as a normalised value, given in [1/s] */ void setVelocity(float speed); /** * @brief Return the speed from ESCON. * 0 rpm is defined in the analog input as 1.65V * @return speed of the motor, given in [1/s] */ float getActualSpeed(void); /** * @brief Set the period of the pwm duty cycle. * Wrapper for PwmOut::period() * @param period Pwm duty cycle, given in [s]. */ void period(float period); /** * @brief Set the motor to a enable sate. * @param enb <code>false</code> for disable <code>true</code> for enable. */ void enable(bool enb); /** * @brief Tests if the servo drive is enabled. * @return <code>true</code> if the drive is enabled, * <code>false</code> otherwise. */ bool isEnabled(void); /** * @brief Return the number of pulses. * @return Pulses, given in [count] */ int getPulses(void); /** * @brief Set the pulses of the motor, given in [count] * @return Pulses, given in [count] */ int setPulses(int setPos); }; #endif