# Progress (2)

A project log for Jumbled Clock

Jumbled digits on clockface, but hands still point to the correct digits

Michael Möller 01/19/2020 at 19:080 Comments

Electronics (one directly connected UL2001 with Darlington transistors - no more or less) now works.

Shows the basic principle (and a messy work bench, but such are creative people :-) )

## Various challenges

When I mounted the drive on a clockface, I noticed the minute hand seems further off than the +/-½ tooth.. Minor problem with the math (truncate vs. rounding) so I do not stop at the nearest tooth but the floor(nearest).

It seems to be one minute off. Although I can not test it at the moment, I reason it is caused by the stepper motor/circuit/count logic. I simply start with the first coil (of the 4 it has), but it may not be the coil that is aligned with the vertical. One minute is 3⅓ steps. I just need to twist the clock dial or add a start offset in the code.

The rounding error was tricky, the calculation became complex as all factors needed taking into account

```Before
MinuteNxt =
Jumble[((Minute+2)/5)%12]*Full/12 + (( T>2 )?T-5:T)*Full
/60;
HourNxt =
Jumble[Hour+(Minute>29?1:0)]*Full/12+(Minute>29?-(60-Minute):Minute)
/12 ;

After
#define Round(Num, Den) ((Num)+(Den)/2)/(Den)
#define Positiv(Val,Wrap) ((Val)<0?((Val)+(Wrap)):(Val))
MinuteNxt = Positiv( Round(
( Jumble[((Minute+2)%60)/5]*5 + ((T>2)?T-5:T) )*Full
, 60), Full);
HourNxt = Positiv( Round(
( Jumble[Hour+(Minute>29?1:0)]*60L + (Minute>29?-(60-Minute):Minute) )*Full
, 60L*12), Full) ;
```

The offset is simply solved by powering on the stepper, jiggling it a little and then manualy turn the hands to the start position (they are only pressfit, so they can be turned while the motor is still)