Atm_AccelStepper.cpp 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543
  1. #include "Atm_AccelStepper.h"
  2. /* Add optional parameters for the state machine to begin()
  3. * Add extra initialization code
  4. */
  5. Atm_AccelStepper& Atm_AccelStepper::begin(int step_pin, int dir_pin) {
  6. // clang-format off
  7. const static state_t state_table[] PROGMEM = {
  8. /* ON_ENTER ON_LOOP ON_EXIT EVT_DISABLE EVT_ENABLE EVT_ENABLED_TIMEOUT EVT_MOVE EVT_STOP EVT_EMERGENCY_STOP EVT_ON_LIMIT_LOW EVT_ON_LIMIT_HIGH EVT_ON_TARGET EVT_HOMING_LOW EVT_HOMING_HIGH ELSE */
  9. /* DISABLE */ ENT_DISABLED, -1, -1, -1, ENABLED, -1, RUNNING, -1, -1, -1, -1, -1, HOMING_LOW, HOMING_HIGH, -1,
  10. /* ENABLED */ ENT_ENABLED, -1, -1, DISABLE, -1, DISABLE, RUNNING, STOP, STOP, LIMIT_LOW, LIMIT_HIGH, -1, HOMING_LOW, HOMING_HIGH, -1,
  11. /* RUNNING */ ENT_RUNNING, LP_RUNNING, -1, DISABLE, -1, -1, RUNNING, STOP, STOP, LIMIT_LOW, LIMIT_HIGH, ENABLED, -1, -1, -1,
  12. /* STOP */ ENT_STOP, LP_STOP, -1, DISABLE, -1, -1, RUNNING, -1, -1, -1, -1, ENABLED, -1, -1, -1,
  13. /* HOMING_LOW */ ENT_HOMING_LOW, LP_HOMING_LOW, EXT_HOMING_LOW, DISABLE, -1, -1, -1, STOP, STOP, LIMIT_LOW, LIMIT_HIGH, -1, -1, -1, -1,
  14. /* HOMING_HIGH */ ENT_HOMING_HIGH, LP_HOMING_HIGH, EXT_HOMING_HIGH, DISABLE, -1, -1, -1, STOP, STOP, LIMIT_LOW, LIMIT_HIGH, -1, -1, -1, -1,
  15. /* LIMIT_LOW */ ENT_LIMIT_LOW, -1, -1, -1, -1, -1, RUNNING, STOP, STOP, LIMIT_LOW, -1, -1, -1, -1, -1,
  16. /* LIMIT_HIGH */ ENT_LIMIT_HIGH, -1, -1, -1, -1, -1, RUNNING, STOP, STOP, -1, LIMIT_HIGH, -1, -1, -1, -1
  17. };
  18. // clang-format on
  19. Machine::begin( state_table, ELSE );
  20. stepper = new AccelStepper(1, step_pin, dir_pin);
  21. stepper->setMaxSpeed(max_speed);
  22. stepper->setAcceleration(acceleration);
  23. idle_timer.set(ATM_TIMER_OFF);
  24. position_timer.set(POSITION_SEND_TIMER);
  25. return *this;
  26. }
  27. /* Add C++ code for each internally handled event (input)
  28. * The code must return 1 to trigger the event
  29. */
  30. int Atm_AccelStepper::event( int id ) {
  31. //updateLimitSwitch();
  32. switch ( id ) {
  33. case EVT_DISABLE:
  34. return 0;
  35. case EVT_ENABLE:
  36. return 0;
  37. case EVT_ENABLED_TIMEOUT:
  38. return 0;
  39. case EVT_MOVE:
  40. return 0;
  41. case EVT_STOP:
  42. return 0;
  43. case EVT_EMERGENCY_STOP:
  44. return 0;
  45. case EVT_ON_LIMIT_LOW:
  46. switch(_limitLow_Mode) {
  47. case 0:
  48. //
  49. Serial.println("no limit");
  50. return 0;
  51. case 1: //digital INPUT
  52. // Serial.println("digital");
  53. limitLow_State = digitalRead(_limitLow_Pin);
  54. limitLow_State = _limitLow_Reversed ? !limitLow_State : limitLow_State;
  55. return limitLow_State;
  56. case 2:
  57. int analogTemp = analogRead(_limitLow_Pin);
  58. limitLow_State = (_limitLow_Thresholds[0] < analogTemp) && (analogTemp < _limitLow_Thresholds[1]);
  59. limitLow_State = _limitLow_Reversed ? !limitLow_State : limitLow_State;
  60. return limitLow_State;
  61. }
  62. case EVT_ON_LIMIT_HIGH:
  63. switch(_limitHigh_Mode) {
  64. case 0:
  65. return 0;
  66. case 1: //digital INPUT
  67. limitHigh_State = digitalRead(_limitHigh_Pin);
  68. limitHigh_State = _limitHigh_Reversed ? !limitHigh_State : limitHigh_State;
  69. return limitHigh_State;
  70. case 2:
  71. //Serial.println("analog");
  72. int analogTemp = analogRead(_limitHigh_Pin);
  73. limitHigh_State = (_limitHigh_Thresholds[0] < analogTemp) && (analogTemp < _limitHigh_Thresholds[1]);
  74. limitHigh_State = _limitHigh_Reversed ? !limitHigh_State : limitHigh_State;
  75. return limitHigh_State;
  76. }
  77. case EVT_ON_TARGET:
  78. return runMode ? 0 : _currentStep == _targetStep;
  79. case EVT_HOMING_LOW:
  80. return 0;
  81. case EVT_HOMING_HIGH:
  82. return 0;
  83. }
  84. return 0;
  85. }
  86. /* Add C++ code for each action
  87. * This generates the 'output' for the state machine
  88. *
  89. * Available connectors:
  90. * push( connectors, ON_CHANGEPOSITION, 0, <v>, <up> );
  91. * push( connectors, ON_CHANGESTATE, 0, <v>, <up> );
  92. * push( connectors, ON_ONLIMITHIGH, 0, <v>, <up> );
  93. * push( connectors, ON_ONLIMITLOW, 0, <v>, <up> );
  94. * push( connectors, ON_ONTARGET, 0, <v>, <up> );
  95. * push( connectors, ON_STOP, 0, <v>, <up> );
  96. */
  97. void Atm_AccelStepper::action( int id ) {
  98. switch ( id ) {
  99. case ENT_DISABLED:
  100. push(connectors, ON_CHANGESTATE, 0, state(), 0);
  101. enabled = _enableReversed ? HIGH : LOW;
  102. digitalWrite(_enablePin, enabled);
  103. return;
  104. case ENT_ENABLED:
  105. _isHoming = 0 ;
  106. if(last_trigger == EVT_ON_TARGET){push( connectors, ON_ONTARGET, 0, _currentStep, 0 );};
  107. push(connectors, ON_CHANGESTATE, 0, state(), 0);
  108. enabled = _enableReversed ? LOW : HIGH ;
  109. digitalWrite(_enablePin, enabled);
  110. return;
  111. case ENT_RUNNING:
  112. push(connectors, ON_CHANGESTATE, 0, state(), 0);
  113. _isHoming = 0;
  114. //push(connectors, ON_CHANGEPOSITION, 0, _currentStep, stepper->speed());
  115. position_timer.setFromNow(this, POSITION_SEND_TIMER);
  116. return;
  117. case LP_RUNNING:
  118. stepper_update();
  119. return;
  120. case ENT_STOP:
  121. push(connectors, ON_CHANGESTATE, 0, state(), 0);
  122. if (last_trigger == EVT_STOP) {
  123. runMode = 0 ;
  124. stepper->stop();
  125. _targetStep = stepper->targetPosition();
  126. push( connectors, ON_STOP, 0, 0, 0 );
  127. }
  128. if (last_trigger == EVT_EMERGENCY_STOP) {
  129. _currentStep = stepper->currentPosition();
  130. _targetStep = _currentStep ;
  131. stepper->moveTo(_targetStep);
  132. stepper->setSpeed(0);
  133. push( connectors, ON_STOP, 0, 1, 0 );
  134. }
  135. return;
  136. case LP_STOP:
  137. stepper_update();
  138. _currentStep = stepper->currentPosition();
  139. return;
  140. case ENT_HOMING_LOW:
  141. push(connectors, ON_CHANGESTATE, 0, state(), 0);
  142. runMode = 1;
  143. _isHoming = 1 ;
  144. stepper->setSpeed(-1*homing_speed);
  145. return;
  146. case LP_HOMING_LOW:
  147. stepper_update();
  148. return;
  149. case EXT_HOMING_LOW:
  150. if(last_trigger == EVT_ON_LIMIT_LOW) {
  151. stepper->setCurrentPosition(0);
  152. _currentStep = 0;
  153. Serial.println("homing low done");
  154. }
  155. else{Serial.println("homing low failed");}
  156. _targetStep = _currentStep;
  157. return;
  158. case ENT_HOMING_HIGH:
  159. push(connectors, ON_CHANGESTATE, 0, state(), 0);
  160. runMode = 1;
  161. _isHoming = 2 ;
  162. stepper->setSpeed(homing_speed);
  163. return;
  164. case LP_HOMING_HIGH:
  165. stepper_update();
  166. return;
  167. case EXT_HOMING_HIGH:
  168. if(last_trigger == EVT_ON_LIMIT_HIGH) {
  169. _maxStep = stepper->currentPosition();
  170. _currentStep = _maxStep;
  171. Serial.println("homing high done");
  172. }
  173. else{Serial.println("homing high failed");}
  174. _targetStep = _currentStep;
  175. return;
  176. case ENT_LIMIT_LOW:
  177. push( connectors, ON_ONLIMITLOW, 0, 0, 0 );
  178. //stop motor if going down, allow going up
  179. if(_limitLow_Hard && (stepper->speed()<0) ) {trigger(EVT_EMERGENCY_STOP);}
  180. else{ stepper_update(); _isHoming ? trigger(EVT_ENABLE):trigger(EVT_MOVE);}
  181. // switch(_isHoming) {
  182. // case 0 :
  183. // trigger(EVT_MOVE);
  184. // break;
  185. // case 1 :
  186. // trigger(EVT_HOMING_LOW);
  187. // break;
  188. // case 2 :
  189. // trigger(EVT_HOMING_HIGH);
  190. // break;
  191. // }
  192. // }
  193. return;
  194. case ENT_LIMIT_HIGH:
  195. push( connectors, ON_ONLIMITHIGH, 0, 1, 0 );
  196. if(_limitHigh_Hard && (stepper->speed()>0)) {trigger(EVT_EMERGENCY_STOP);}
  197. else{ stepper_update(); _isHoming ? trigger(EVT_ENABLE):trigger(EVT_MOVE);}
  198. // stepper_update();
  199. // switch(_isHoming) {
  200. // case 0 :
  201. // trigger(EVT_MOVE);
  202. // break;
  203. // case 1 :
  204. // trigger(EVT_HOMING_HIGH);
  205. // break;
  206. // case 2 :
  207. // trigger(EVT_HOMING_HIGH);
  208. // break;
  209. // }
  210. // }
  211. return;
  212. }
  213. }
  214. /* Optionally override the default trigger() method
  215. * Control how your machine processes triggers
  216. */
  217. Atm_AccelStepper& Atm_AccelStepper::trigger( int event ) {
  218. Machine::trigger( event );
  219. return *this;
  220. }
  221. /* Optionally override the default state() method
  222. * Control what the machine returns when another process requests its state
  223. */
  224. int Atm_AccelStepper::state( void ) {
  225. return Machine::state();
  226. }
  227. /* Nothing customizable below this line
  228. ************************************************************************************************
  229. */
  230. /* Still I'll customize a little just here
  231. */
  232. void Atm_AccelStepper::stepper_update(void) {
  233. switch (runMode) {
  234. case 0: //positional modae
  235. stepper->run();
  236. break;
  237. case 1: // speed mode
  238. stepper->runSpeed();
  239. break;
  240. }
  241. long int tempStep = stepper->currentPosition();
  242. if (tempStep != _currentStep){
  243. _currentStep = tempStep;
  244. if (position_timer.expired(this)){
  245. push(connectors, ON_CHANGEPOSITION, 0, _currentStep, stepper->speed());
  246. position_timer.setFromNow(this, POSITION_SEND_TIMER);
  247. }
  248. }
  249. }
  250. Atm_AccelStepper& Atm_AccelStepper::setMaxSpeed( long int maxSpeed){
  251. max_speed = maxSpeed ;
  252. stepper->setMaxSpeed(max_speed);
  253. return *this ;
  254. }
  255. Atm_AccelStepper& Atm_AccelStepper::setHomingSpeed(long int homingSpeed){
  256. homing_speed = homingSpeed ;
  257. return *this ;
  258. }
  259. Atm_AccelStepper& Atm_AccelStepper::setAcceleration(long int acc){
  260. acceleration = acc ;
  261. stepper->setAcceleration(max_speed);
  262. return *this ;
  263. }
  264. Atm_AccelStepper& Atm_AccelStepper::position_refresh(long int refresh_ms){
  265. POSITION_SEND_TIMER = refresh_ms ;
  266. return *this ;
  267. }
  268. Atm_AccelStepper& Atm_AccelStepper::move( long int stepRel) {
  269. _targetStep = _currentStep + stepRel;
  270. runMode = 0;
  271. _isHoming = 0;
  272. //Serial.println(_targetStep);
  273. stepper->moveTo(_targetStep);
  274. enable();
  275. trigger( EVT_MOVE );
  276. return *this;
  277. }
  278. Atm_AccelStepper& Atm_AccelStepper::moveTo( long int stepAbs) {
  279. _targetStep = stepAbs;
  280. _isHoming = 0 ;
  281. runMode = 0;
  282. stepper->moveTo(_targetStep);
  283. enable();
  284. trigger( EVT_MOVE );
  285. return *this;
  286. }
  287. Atm_AccelStepper& Atm_AccelStepper::rotate( long int speed) {
  288. runMode = 1;
  289. _isHoming = 0 ;
  290. stepper->setSpeed( speed);
  291. enable();
  292. trigger( EVT_MOVE );
  293. return *this;
  294. }
  295. Atm_AccelStepper& Atm_AccelStepper::homing( bool direction ){
  296. enable();
  297. direction == 1 ? _isHoming = 2 : _isHoming = 1;
  298. direction == 1 ? this->trigger(EVT_HOMING_HIGH) : this->trigger(EVT_HOMING_LOW);
  299. return *this;
  300. }
  301. // Atm_AccelStepper& Atm_AccelStepper::rotationReversed(bool reversed){
  302. // _rotationReversed = reversed ? -1 : 1 ;
  303. // }
  304. Atm_AccelStepper& Atm_AccelStepper::setEnablePin( int enablePin ){
  305. _enablePin = enablePin ;
  306. pinMode(_enablePin, OUTPUT);
  307. return *this;
  308. }
  309. Atm_AccelStepper& Atm_AccelStepper::pinReversed( bool directionInvert,
  310. bool stepInvert, bool enableInvert){
  311. stepper->setPinsInverted(directionInvert, stepInvert, enableInvert);
  312. return *this;
  313. }
  314. Atm_AccelStepper& Atm_AccelStepper::limitLow_set(int mode, int pin, int reversed){
  315. _limitLow_Mode = mode ;
  316. _limitLow_Pin = pin ;
  317. _limitLow_Reversed = reversed ;
  318. if (_limitLow_Mode==1) {pinMode(_limitLow_Pin, INPUT_PULLUP);}
  319. if (_limitLow_Mode==2) {pinMode(_limitLow_Pin, INPUT);}
  320. return *this;
  321. }
  322. Atm_AccelStepper& Atm_AccelStepper::limitLow_isHard(bool hardlimit){
  323. _limitLow_Hard = hardlimit;
  324. return *this;
  325. }
  326. Atm_AccelStepper& Atm_AccelStepper::limitLow_setThresholds (int threshold_low, int threshold_high){
  327. _limitLow_Thresholds[0] = threshold_low ;
  328. _limitLow_Thresholds[1] = threshold_high ;
  329. return *this;
  330. }
  331. Atm_AccelStepper& Atm_AccelStepper::limitHigh_set(int mode, int pin, int reversed){
  332. _limitHigh_Mode = mode ;
  333. _limitHigh_Pin = pin ;
  334. _limitHigh_Reversed = reversed ;
  335. if (_limitHigh_Mode==1) {pinMode(_limitHigh_Pin, INPUT_PULLUP);}
  336. if (_limitHigh_Mode==2) {pinMode(_limitHigh_Pin, INPUT);}
  337. return *this;
  338. }
  339. Atm_AccelStepper& Atm_AccelStepper::limitHigh_isHard(bool hardlimit){
  340. _limitHigh_Hard = hardlimit;
  341. return *this;
  342. }
  343. Atm_AccelStepper& Atm_AccelStepper::limitHigh_setThresholds (int threshold_low, int threshold_high){
  344. _limitHigh_Thresholds[0] = threshold_low ;
  345. _limitHigh_Thresholds[1] = threshold_high ;
  346. return *this;
  347. }
  348. /* Public event methods
  349. *
  350. */
  351. Atm_AccelStepper& Atm_AccelStepper::disable() {
  352. trigger( EVT_DISABLE );
  353. return *this;
  354. }
  355. Atm_AccelStepper& Atm_AccelStepper::enable() {
  356. trigger( EVT_ENABLE );
  357. return *this;
  358. }
  359. // Atm_AccelStepper& Atm_AccelStepper::move() {
  360. // trigger( EVT_MOVE );
  361. // return *this;
  362. // }
  363. Atm_AccelStepper& Atm_AccelStepper::stop() {
  364. trigger( EVT_STOP );
  365. return *this;
  366. }
  367. Atm_AccelStepper& Atm_AccelStepper::emergency_stop() {
  368. trigger( EVT_EMERGENCY_STOP );
  369. return *this;
  370. }
  371. Atm_AccelStepper& Atm_AccelStepper::on_limit_low() {
  372. trigger( EVT_ON_LIMIT_LOW );
  373. return *this;
  374. }
  375. Atm_AccelStepper& Atm_AccelStepper::on_limit_high() {
  376. trigger( EVT_ON_LIMIT_HIGH );
  377. return *this;
  378. }
  379. Atm_AccelStepper& Atm_AccelStepper::on_target() {
  380. trigger( EVT_ON_TARGET );
  381. return *this;
  382. }
  383. /*
  384. * onChangeposition() push connector variants ( slots 1, autostore 0, broadcast 0 )
  385. */
  386. Atm_AccelStepper& Atm_AccelStepper::onChangeposition( Machine& machine, int event ) {
  387. onPush( connectors, ON_CHANGEPOSITION, 0, 1, 1, machine, event );
  388. return *this;
  389. }
  390. Atm_AccelStepper& Atm_AccelStepper::onChangeposition( atm_cb_push_t callback, int idx ) {
  391. onPush( connectors, ON_CHANGEPOSITION, 0, 1, 1, callback, idx );
  392. return *this;
  393. }
  394. /*
  395. * onChangestate() push connector variants ( slots 1, autostore 0, broadcast 0 )
  396. */
  397. Atm_AccelStepper& Atm_AccelStepper::onChangestate( Machine& machine, int event ) {
  398. onPush( connectors, ON_CHANGESTATE, 0, 1, 1, machine, event );
  399. return *this;
  400. }
  401. Atm_AccelStepper& Atm_AccelStepper::onChangestate( atm_cb_push_t callback, int idx ) {
  402. onPush( connectors, ON_CHANGESTATE, 0, 1, 1, callback, idx );
  403. return *this;
  404. }
  405. /*
  406. * onOnlimithigh() push connector variants ( slots 1, autostore 0, broadcast 0 )
  407. */
  408. Atm_AccelStepper& Atm_AccelStepper::onOnlimithigh( Machine& machine, int event ) {
  409. onPush( connectors, ON_ONLIMITHIGH, 0, 1, 1, machine, event );
  410. return *this;
  411. }
  412. Atm_AccelStepper& Atm_AccelStepper::onOnlimithigh( atm_cb_push_t callback, int idx ) {
  413. onPush( connectors, ON_ONLIMITHIGH, 0, 1, 1, callback, idx );
  414. return *this;
  415. }
  416. /*
  417. * onOnlimitlow() push connector variants ( slots 1, autostore 0, broadcast 0 )
  418. */
  419. Atm_AccelStepper& Atm_AccelStepper::onOnlimitlow( Machine& machine, int event ) {
  420. onPush( connectors, ON_ONLIMITLOW, 0, 1, 1, machine, event );
  421. return *this;
  422. }
  423. Atm_AccelStepper& Atm_AccelStepper::onOnlimitlow( atm_cb_push_t callback, int idx ) {
  424. onPush( connectors, ON_ONLIMITLOW, 0, 1, 1, callback, idx );
  425. return *this;
  426. }
  427. /*
  428. * onOntarget() push connector variants ( slots 1, autostore 0, broadcast 0 )
  429. */
  430. Atm_AccelStepper& Atm_AccelStepper::onOntarget( Machine& machine, int event ) {
  431. onPush( connectors, ON_ONTARGET, 0, 1, 1, machine, event );
  432. return *this;
  433. }
  434. Atm_AccelStepper& Atm_AccelStepper::onOntarget( atm_cb_push_t callback, int idx ) {
  435. onPush( connectors, ON_ONTARGET, 0, 1, 1, callback, idx );
  436. return *this;
  437. }
  438. /*
  439. * onStop() push connector variants ( slots 1, autostore 0, broadcast 0 )
  440. */
  441. Atm_AccelStepper& Atm_AccelStepper::onStop( Machine& machine, int event ) {
  442. onPush( connectors, ON_STOP, 0, 1, 1, machine, event );
  443. return *this;
  444. }
  445. Atm_AccelStepper& Atm_AccelStepper::onStop( atm_cb_push_t callback, int idx ) {
  446. onPush( connectors, ON_STOP, 0, 1, 1, callback, idx );
  447. return *this;
  448. }
  449. Atm_AccelStepper& Atm_AccelStepper::onOnhominglow( Machine& machine, int event ) {
  450. onPush( connectors, ON_ONTARGET, 0, 1, 1, machine, event );
  451. return *this;
  452. }
  453. Atm_AccelStepper& Atm_AccelStepper::onOnhominglow( atm_cb_push_t callback, int idx ) {
  454. onPush( connectors, ON_ONTARGET, 0, 1, 1, callback, idx );
  455. return *this;
  456. }
  457. Atm_AccelStepper& Atm_AccelStepper::onOnhominghigh( Machine& machine, int event ) {
  458. onPush( connectors, ON_ONTARGET, 0, 1, 1, machine, event );
  459. return *this;
  460. }
  461. Atm_AccelStepper& Atm_AccelStepper::onOnhominghigh( atm_cb_push_t callback, int idx ) {
  462. onPush( connectors, ON_ONTARGET, 0, 1, 1, callback, idx );
  463. return *this;
  464. }
  465. /* State trace method
  466. * Sets the symbol table and the default logging method for serial monitoring
  467. */
  468. Atm_AccelStepper& Atm_AccelStepper::trace( Stream & stream ) {
  469. Machine::setTrace( &stream, atm_serial_debug::trace,
  470. "ACCELSTEPPER\0EVT_DISABLE\0EVT_ENABLE\0EVT_ENABLED_TIMEOUT\0EVT_MOVE\0EVT_STOP\0EVT_EMERGENCY_STOP\0EVT_ON_LIMIT_LOW\0EVT_ON_LIMIT_HIGH\0EVT_ON_TARGET\0EVT_HOMING_LOW\0EVT_HOMING_HIGH\0ELSE\0DISABLED\0ENABLED\0RUNNING\0STOP\0HOMING_LOW\0HOMING_HIGH\0LIMIT_LOW\0LIMIT_HIGH" );
  471. return *this;
  472. }