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
Diff: Actuators/MaxonESCON/MaxonESCON.h
- Revision:
- 0:31f7be68e52d
- Child:
- 1:6cd533a712c6
diff -r 000000000000 -r 31f7be68e52d Actuators/MaxonESCON/MaxonESCON.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Actuators/MaxonESCON/MaxonESCON.h Thu Feb 07 17:43:19 2013 +0000 @@ -0,0 +1,109 @@ +#ifndef _MAXON_ESCON_H_ +#define _MAXON_ESCON_H_ + +#include "mbed.h" +#include "Hallsensor.h" +#include "defines.h" + +/** + * @author Christian Burri + * + * @section LICENSE + * + * Copyright (c) 2013 HSLU Pren Team #1 Cruising Crêpe + * All rights reserved. + * + * @section DESCRIPTION + * + * This class implements the driver for the Maxon ESCON servo driver..... + * + * Datasheet: + * + * http://escon.maxonmotor.com + */ +class MaxonESCON +{ + +protected: + + /** Duty Cycle to set the speed */ + PwmOut _pwm; + /** To Enable the amplifier */ + DigitalOut _enb; + /** Hallsensor Class */ + Hallsensor* _hall; + /** Ready output from ESCON */ + DigitalIn _isenb; + /** Actual speed from ESCON analog Output 1 */ + AnalogIn _actualSpeed; + +private: + + /** increment the Hallpattern */ + int _pulses; + +public: + + /** 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 hall1 HALL Object + * @param Actual Speed AnalogIn Filtered Signal for ActualSpeed from Motor + */ + MaxonESCON(PinName enb, + PinName isenb, + PinName pwm, + PinName actualSpeed, + Hallsensor *hall); + + /** Set the speed of the motor with a pwm for 10%..90% + * 50% PWM is 0rpm + * Caclulate from 1/s in 1/min plus the Facotr of the ESCON + * @param speed The speed of the motor as a normalised value in [1/s] + */ + void setVelocity(float speed); + + /**Return the speed from ESCON + * + * Analog input 1.65V = 0 rpm + * + * @return speed of the motor [1/s] + */ + float getActualSpeed(void); + + /** Set the period of the pwm duty cycle. + * + * Wrapper for PwmOut::period() + * + * @param seconds - Pwm duty cycle in seconds. + */ + void period(float period); + + /** Set the Motor to a enable sate + * + * @param enable - 0 for disable 1 for enable. + */ + void enable (bool enb); + + /**Tests if the servo drive is enabled. + * + * @return <code>true</code> if the drive is enabled, <code>false</code> otherwise. + */ + bool isEnabled(void); + + /** Return the translativ Position + * + * @return position in meter + */ + int getPulses(void); + + /** Set the Pulses of the Motor + * + * @return number of turns + */ + int setPulses(int setPos); +}; + +#endif